1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
11 cfMesh is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 3 of the License, or (at your
14 option) any later version.
16 cfMesh 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
21 You should have received a copy of the GNU General Public License
22 along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
26 \*---------------------------------------------------------------------------*/
28 #include "processorBoundaryPatch.H"
29 #include "addToRunTimeSelectionTable.H"
30 #include "dictionary.H"
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 defineTypeNameAndDebug(processorBoundaryPatch, 0);
41 addToRunTimeSelectionTable(boundaryPatchBase, processorBoundaryPatch, dictionary);
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 processorBoundaryPatch::processorBoundaryPatch
50 const label startFace,
52 const label neighbProcNo
55 boundaryPatchBase(name, type, nFaces, startFace),
57 neighbProcNo_(neighbProcNo)
60 processorBoundaryPatch::processorBoundaryPatch
63 const dictionary& dict
66 boundaryPatchBase(name, dict),
67 myProcNo_(readLabel(dict.lookup("myProcNo"))),
68 neighbProcNo_(readLabel(dict.lookup("neighbProcNo")))
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 dictionary processorBoundaryPatch::dict() const
78 dict.add("type", type_);
80 dict.add("nFaces", nFaces_);
81 dict.add("startFace", startFace_);
82 dict.add("myProcNo", myProcNo_);
83 dict.add("neighbProcNo", neighbProcNo_);
88 void processorBoundaryPatch::write(Ostream& os) const
93 void processorBoundaryPatch::writeDict(Ostream& os) const
98 Ostream& processorBoundaryPatch::operator<<(Ostream& os) const
100 os << patchName() << nl << token::BEGIN_BLOCK << nl
101 << " type " << patchType() << token::END_STATEMENT << nl
102 << " nFaces " << patchSize() << token::END_STATEMENT << nl
103 << " startFace " << patchStart() << token::END_STATEMENT << nl
104 << " myProcNo " << myProcNo_ << token::END_STATEMENT << nl
105 << " neighbProcNo " << neighbProcNo_
106 << token::END_STATEMENT << nl
107 << token::END_BLOCK << endl;
112 Istream& processorBoundaryPatch::operator>>(Istream& is)
116 is >> t >> type_ >> t;
117 is >> t >> nFaces_ >> t;
118 is >> t >> startFace_ >> t;
119 is >> t >> myProcNo_ >> t;
120 is >> t >> neighbProcNo_ >> t;
126 void processorBoundaryPatch::operator=(const processorBoundaryPatch& wp)
130 nFaces_ = wp.nFaces_;
131 startFace_ = wp.startFace_;
132 myProcNo_ = wp.myProcNo_;
133 neighbProcNo_ = wp.neighbProcNo_;
136 bool processorBoundaryPatch::operator!=(const processorBoundaryPatch& wp) const
138 if( name_ != wp.name_ )
142 else if( type_ != wp.name_ )
146 else if( (nFaces_ != wp.nFaces_) || (startFace_ != wp.startFace_) )
151 (myProcNo_ != wp.myProcNo_) || (neighbProcNo_ != wp.neighbProcNo_)
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 } // End namespace Foam
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //