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 | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "procLduInterface.H"
27 #include "lduInterfaceField.H"
28 #include "cyclicLduInterface.H"
29 #include "processorLduInterface.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
34 (
36  const scalarField& coeffs
37 )
38 :
39  faceCells_(interface.interface().faceCells()),
40  coeffs_(coeffs),
41  myProcNo_(-1),
42  neighbProcNo_(-1),
43  tag_(-1),
44  comm_(-1)
45 {
46  if (isA<processorLduInterface>(interface.interface()))
47  {
48  const processorLduInterface& pldui =
49  refCast<const processorLduInterface>(interface.interface());
50 
51  myProcNo_ = pldui.myProcNo();
52  neighbProcNo_ = pldui.neighbProcNo();
53  tag_ = pldui.tag();
54  comm_ = pldui.comm();
55  }
56  else if (isA<cyclicLduInterface>(interface.interface()))
57  {
58  }
59  else
60  {
62  << "Unknown lduInterface type "
63  << interface.interface().type()
64  << exit(FatalError);
65  }
66 }
67 
68 
70 :
71  faceCells_(is),
72  coeffs_(is),
73  myProcNo_(readLabel(is)),
74  neighbProcNo_(readLabel(is)),
75  tag_(readLabel(is)),
76  comm_(readLabel(is))
77 {}
78 
79 
80 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
81 
83 {
84  os << cldui.faceCells_
85  << cldui.coeffs_
86  << cldui.myProcNo_
87  << cldui.neighbProcNo_
88  << cldui.tag_
89  << cldui.comm_;
90 
91  return os;
92 }
93 
94 
95 // ************************************************************************* //
Foam::procLduInterface::comm_
label comm_
Definition: procLduInterface.H:60
Foam::procLduInterface::procLduInterface
procLduInterface(const procLduInterface &)
Dissallow construction as copy.
Foam::processorLduInterface
An abstract base class for processor coupled interfaces.
Definition: processorLduInterface.H:50
Foam::procLduInterface::myProcNo_
label myProcNo_
Definition: procLduInterface.H:57
Foam::procLduInterface::neighbProcNo_
label neighbProcNo_
Definition: procLduInterface.H:58
cyclicLduInterface.H
processorLduInterface.H
interface
interfaceProperties interface(alpha1, U, mixture())
Foam::processorLduInterface::tag
virtual int tag() const =0
Return message tag used for sending.
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::procLduInterface::tag_
label tag_
Definition: procLduInterface.H:59
Foam::procLduInterface
IO interface for processorLduInterface.
Definition: procLduInterface.H:51
Foam::operator<<
Ostream & operator<<(Ostream &, const edgeMesh &)
Definition: edgeMeshIO.C:130
Foam::processorLduInterface::neighbProcNo
virtual int neighbProcNo() const =0
Return neigbour processor number (rank in communicator)
Foam::FatalError
error FatalError
Foam::lduInterfaceField
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
Definition: lduInterfaceField.H:55
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
procLduInterface.H
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:318
Foam::processorLduInterface::myProcNo
virtual int myProcNo() const =0
Return processor number (rank in communicator)
lduInterfaceField.H
Foam::processorLduInterface::comm
virtual label comm() const =0
Return communicator used for parallel communication.
Foam::readLabel
label readLabel(Istream &is)
Definition: label.H:64
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::procLduInterface::coeffs_
scalarField coeffs_
Definition: procLduInterface.H:56
Foam::procLduInterface::faceCells_
labelList faceCells_
Definition: procLduInterface.H:55