procLduInterface.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2015 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28#include "procLduInterface.H"
29#include "lduInterfaceField.H"
30#include "cyclicLduInterface.H"
32
33// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34
36(
38 const scalarField& coeffs
39)
40:
41 faceCells_(interface.interface().faceCells()),
42 coeffs_(coeffs),
43 myProcNo_(-1),
44 neighbProcNo_(-1),
45 tag_(-1),
46 comm_(-1)
47{
48 if (isA<processorLduInterface>(interface.interface()))
49 {
50 const processorLduInterface& pldui =
51 refCast<const processorLduInterface>(interface.interface());
52
53 myProcNo_ = pldui.myProcNo();
54 neighbProcNo_ = pldui.neighbProcNo();
55 tag_ = pldui.tag();
56 comm_ = pldui.comm();
57 }
58 else if (isA<cyclicLduInterface>(interface.interface()))
59 {
60 }
61 else
62 {
64 << "Unknown lduInterface type "
65 << interface.interface().type()
66 << exit(FatalError);
67 }
68}
69
70
72:
73 faceCells_(is),
74 coeffs_(is),
75 myProcNo_(readLabel(is)),
76 neighbProcNo_(readLabel(is)),
77 tag_(readLabel(is)),
78 comm_(readLabel(is))
79{}
80
81
82// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
83
85{
86 os << cldui.faceCells_
87 << cldui.coeffs_
88 << cldui.myProcNo_
89 << cldui.neighbProcNo_
90 << cldui.tag_
91 << cldui.comm_;
92
93 return os;
94}
95
96
97// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:59
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
IO interface for processorLduInterface.
An abstract base class for processor coupled interfaces.
virtual label comm() const =0
Return communicator used for parallel communication.
virtual int neighbProcNo() const =0
Return neighbour processor number (rank in communicator)
virtual int myProcNo() const =0
Return processor number (rank in communicator)
virtual int tag() const =0
Return message tag used for sending.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
OBJstream os(runTime.globalPath()/outputName)
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
Definition: label.H:66
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
error FatalError
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
interfaceProperties interface(alpha1, U, thermo->transportPropertiesDict())