Loading...
Searching...
No Matches
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 Copyright (C) 2024 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
30#include "lduInterfaceField.H"
31#include "cyclicLduInterface.H"
33
34// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35
37(
39 const scalarField& coeffs
40)
41:
42 faceCells_(interface.interface().faceCells()),
43 coeffs_(coeffs),
44 myProcNo_(-1),
45 neighbProcNo_(-1),
46 tag_(-1),
47 comm_(-1)
48{
50 {
51 const processorLduInterface& pldui =
52 refCast<const processorLduInterface>(interface.interface());
53
54 myProcNo_ = pldui.myProcNo();
55 neighbProcNo_ = pldui.neighbProcNo();
56 tag_ = pldui.tag();
57 comm_ = pldui.comm();
58 }
59 else if (isA<cyclicLduInterface>(interface.interface()))
60 {
61 }
62 else
63 {
64 FatalErrorInFunction
65 << "Unknown lduInterface type "
66 << interface.interface().type()
67 << exit(FatalError);
68 }
69}
70
71
74 read(is);
75}
76
77
78// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
79
81{
82 is >> faceCells_
83 >> coeffs_
84 >> myProcNo_
85 >> neighbProcNo_
86 >> tag_
87 >> comm_;
88}
89
90
92{
93 os << faceCells_
94 << coeffs_
95 << myProcNo_
96 << neighbProcNo_
97 << tag_
98 << comm_;
99}
100
101
102// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
103
105{
106 intf.read(is);
107 return is;
108}
109
110
111Foam::Ostream& Foam::operator<<(Ostream& os, const procLduInterface& intf)
112{
113 intf.write(os);
114 return os;
115}
116
117
118// ************************************************************************* //
if(patchID !=-1)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Smooth ATC in cells next to a set of patches supplied by type.
Definition faceCells.H:55
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
IO interface for processorLduInterface.
procLduInterface(const procLduInterface &)=delete
No copy construct.
void write(Ostream &os) const
void read(Istream &is)
OBJstream os(runTime.globalPath()/outputName)
bool read(const char *buf, int32_t &val)
Same as readInt32.
Definition int32.H:127
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
Definition typeInfo.H:87
Istream & operator>>(Istream &, directionInfo &)
interfaceProperties interface(alpha1, U, thermo->transportPropertiesDict())