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 \*---------------------------------------------------------------------------*/
29 #include "partTetMeshSimplex.H"
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 partTetMeshSimplex::partTetMeshSimplex
42 const partTetMesh& tm,
49 const LongList<point>& points = tm.points();
50 const LongList<partTet>& tets = tm.tets();
51 const VRWGraph& pt = tm.pointTets();
53 tets_.setSize(pt.sizeOfRow(pI));
56 Map<label> addr(2*pt.sizeOfRow(pI));
57 forAllRow(pt, pI, tetI)
59 const partTet& tet = tets[pt(pI, tetI)];
60 for(label i=0;i<4;++i)
62 const label tpI = tet[i];
63 if( !addr.found(tpI) )
65 addr.insert(tpI, counter);
66 pts_.append(points[tpI]);
72 Info << "Tet " << tetI << " is " << tet << endl;
75 const label pos = tet.whichPosition(pI);
126 "partTetMeshSimplex::partTetMeshSimplex("
127 "(const partTetMesh& tm, const label pI)"
128 ) << "Point " << pI << " is not present in tet" << tet
129 << abort(FatalError);
135 partTetMeshSimplex::partTetMeshSimplex
137 const DynList<parPartTet>& pt,
144 tets_.setSize(pt.size());
150 const parPartTet& tet = pt[tetI];
153 for(label i=0;i<4;++i)
155 if( !addr.found(tet[i].pointLabel()) )
157 addr.insert(tet[i].pointLabel(), pI);
158 pts_.append(tet[i].coordinates());
162 if( tet[i].pointLabel() == gpI )
173 addr[tet[1].pointLabel()],
174 addr[tet[3].pointLabel()],
175 addr[tet[2].pointLabel()],
176 addr[tet[0].pointLabel()]
184 addr[tet[0].pointLabel()],
185 addr[tet[2].pointLabel()],
186 addr[tet[3].pointLabel()],
187 addr[tet[1].pointLabel()]
195 addr[tet[0].pointLabel()],
196 addr[tet[3].pointLabel()],
197 addr[tet[1].pointLabel()],
198 addr[tet[2].pointLabel()]
206 addr[tet[0].pointLabel()],
207 addr[tet[1].pointLabel()],
208 addr[tet[2].pointLabel()],
209 addr[tet[3].pointLabel()]
216 "partTetMeshSimplex::partTetMeshSimplex("
217 "(const partTetMesh& tm, const label pI)"
218 ) << "Point " << gpI << " is not present in tet" << tet
219 << abort(FatalError);
225 partTetMeshSimplex::partTetMeshSimplex
227 const DynList<point, 128>& pts,
228 const DynList<partTet, 128>& tets,
237 const partTet& tet = tets[tetI];
239 const label pos = tet.whichPosition(pointI);
291 "partTetMeshSimplex::partTetMeshSimplex"
292 "(const DynList<point, 128>& pts,"
293 "const DynList<partTet, 128>& tets, const label pointI)"
294 ) << "Point " << pointI << " is not present in tet" << tet
295 << abort(FatalError);
301 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
303 partTetMeshSimplex::~partTetMeshSimplex()
306 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
308 } // End namespace Foam
310 // ************************************************************************* //