FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

procLduInterface.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "procLduInterface.H"
00027 #include <OpenFOAM/lduInterfaceField.H>
00028 #include <OpenFOAM/cyclicLduInterface.H>
00029 #include <OpenFOAM/processorLduInterface.H>
00030 
00031 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00032 
00033 Foam::procLduInterface::procLduInterface
00034 (
00035     const lduInterfaceField& interface,
00036     const scalarField& coeffs
00037 )
00038 :
00039     faceCells_(interface.interface().faceCells()),
00040     coeffs_(coeffs),
00041     myProcNo_(-1),
00042     neighbProcNo_(-1)
00043 {
00044     if (isA<processorLduInterface>(interface.interface()))
00045     {
00046         const processorLduInterface& pldui =
00047             refCast<const processorLduInterface>(interface.interface());
00048 
00049         myProcNo_ = pldui.myProcNo();
00050         neighbProcNo_ = pldui.neighbProcNo();
00051     }
00052     else if (isA<cyclicLduInterface>(interface.interface()))
00053     {
00054     }
00055     else
00056     {
00057         FatalErrorIn
00058         (
00059             "procLduInterface::procLduInterface"
00060             "(const lduInterfaceField&, const scalarField&"
00061         )   << "unknown lduInterface type " << interface.interface().type()
00062             << exit(FatalError);
00063     }
00064 }
00065 
00066 
00067 Foam::procLduInterface::procLduInterface(Istream& is)
00068 :
00069     faceCells_(is),
00070     coeffs_(is),
00071     myProcNo_(readLabel(is)),
00072     neighbProcNo_(readLabel(is))
00073 {}
00074 
00075 
00076 // * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
00077 
00078 Foam::Ostream& Foam::operator<<(Ostream& os, const procLduInterface& cldui)
00079 {
00080     os  << cldui.faceCells_
00081         << cldui.coeffs_
00082         << cldui.myProcNo_
00083         << cldui.neighbProcNo_;
00084 
00085     return os;
00086 }
00087 
00088 
00089 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines