1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "tetPolyBoundaryMeshFaceDecomp.H"
28 #include "polyBoundaryMesh.H"
29 #include "faceTetPolyPatchFaceDecomp.H"
30 #include "globalTetPolyPatchFaceDecomp.H"
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 // Construct from polyBoundaryMesh
40 tetPolyBoundaryMeshFaceDecomp::tetPolyBoundaryMeshFaceDecomp
42 const tetPolyMeshFaceDecomp& m,
43 const polyBoundaryMesh& basicBdry
46 tetPolyPatchFaceDecompList(basicBdry.size()),
49 // Set boundary patches
50 tetPolyPatchFaceDecompList& Patches = *this;
52 forAll(Patches, patchI)
57 faceTetPolyPatchFaceDecomp::New(basicBdry[patchI], *this).ptr()
63 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
65 lduInterfacePtrsList tetPolyBoundaryMeshFaceDecomp::interfaces() const
67 lduInterfacePtrsList interfaces(size());
69 forAll (interfaces, patchi)
71 if (isA<lduInterface>(this->operator[](patchi)))
76 &refCast<const lduInterface>(this->operator[](patchi))
85 const globalTetPolyPatchFaceDecomp&
86 tetPolyBoundaryMeshFaceDecomp::globalPatch() const
88 const tetPolyPatchFaceDecompList& patches = *this;
90 forAll (patches, patchI)
92 if (isA<globalTetPolyPatchFaceDecomp>(patches[patchI]))
94 return refCast<const globalTetPolyPatchFaceDecomp>
103 "const globalTetPolyPatchFaceDecomp&"
104 "tetPolyBoundaryMeshFaceDecomp::globalPatch() const"
105 ) << "patch not found. Is this case running in parallel?"
106 << abort(FatalError);
109 return refCast<const globalTetPolyPatchFaceDecomp>(patches[0]);
113 faceListList tetPolyBoundaryMeshFaceDecomp::boundaryTriFaces() const
115 faceListList result(size());
117 forAll (result, patchI)
119 result[patchI] = operator[](patchI).triFaces();
126 void tetPolyBoundaryMeshFaceDecomp::updateMesh()
128 tetPolyPatchFaceDecompList& Patches = *this;
130 forAll(Patches, patchI)
132 Patches[patchI].updateMesh();
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 } // End namespace Foam
141 // ************************************************************************* //