fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / tetDecompositionFiniteElement / tetPolyMeshFaceDecomp / tetPolyBoundaryMesh / tetPolyBoundaryMeshFaceDecomp.C
blobeff3a84ae4c63f61c84d64df8c7a09f437fe2a14
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 namespace Foam
37 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
39 // Construct from polyBoundaryMesh
40 tetPolyBoundaryMeshFaceDecomp::tetPolyBoundaryMeshFaceDecomp
42     const tetPolyMeshFaceDecomp& m,
43     const polyBoundaryMesh& basicBdry
46     tetPolyPatchFaceDecompList(basicBdry.size()),
47     mesh_(m)
49     // Set boundary patches
50     tetPolyPatchFaceDecompList& Patches = *this;
52     forAll(Patches, patchI)
53     {
54         Patches.set
55         (
56             patchI,
57             faceTetPolyPatchFaceDecomp::New(basicBdry[patchI], *this).ptr()
58         );
59     }
63 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
65 lduInterfacePtrsList tetPolyBoundaryMeshFaceDecomp::interfaces() const
67     lduInterfacePtrsList interfaces(size());
69     forAll (interfaces, patchi)
70     {
71         if (isA<lduInterface>(this->operator[](patchi)))
72         {
73             interfaces.set
74             (
75                 patchi,
76                &refCast<const lduInterface>(this->operator[](patchi))
77             );
78         }
79     }
81     return interfaces;
85 const globalTetPolyPatchFaceDecomp&
86 tetPolyBoundaryMeshFaceDecomp::globalPatch() const
88     const tetPolyPatchFaceDecompList& patches = *this;
90     forAll (patches, patchI)
91     {
92         if (isA<globalTetPolyPatchFaceDecomp>(patches[patchI]))
93         {
94             return refCast<const globalTetPolyPatchFaceDecomp>
95             (
96                 patches[patchI]
97             );
98         }
99     }
101     FatalErrorIn
102     (
103         "const globalTetPolyPatchFaceDecomp&"
104         "tetPolyBoundaryMeshFaceDecomp::globalPatch() const"
105     )   << "patch not found.  Is this case running in parallel?"
106         << abort(FatalError);
108     // Dummy return
109     return refCast<const globalTetPolyPatchFaceDecomp>(patches[0]);
113 faceListList tetPolyBoundaryMeshFaceDecomp::boundaryTriFaces() const
115     faceListList result(size());
117     forAll (result, patchI)
118     {
119         result[patchI] = operator[](patchI).triFaces();
120     }
122     return result;
126 void tetPolyBoundaryMeshFaceDecomp::updateMesh()
128     tetPolyPatchFaceDecompList& Patches = *this;
130     forAll(Patches, patchI)
131     {
132         Patches[patchI].updateMesh();
133     }
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 } // End namespace Foam
141 // ************************************************************************* //