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 "tetCreatorOctree.H"
29 #include "meshOctree.H"
30 #include "demandDrivenData.H"
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 const meshOctreeCubeCoordinates tetCreatorOctree::edgeCoordinates_[12][4]=
44 meshOctreeCubeCoordinates(0, 0, 1, 0),
45 meshOctreeCubeCoordinates(0, -1, 1, 0),
46 meshOctreeCubeCoordinates(0, -1, 0, 0),
47 meshOctreeCubeCoordinates(0, 0, 0, 0)
50 meshOctreeCubeCoordinates(0, 0, 0, 0),
51 meshOctreeCubeCoordinates(0, -1, 0, 0),
52 meshOctreeCubeCoordinates(0, -1, -1, 0),
53 meshOctreeCubeCoordinates(0, 0, -1, 0)
56 meshOctreeCubeCoordinates(0, 1, 0, 0),
57 meshOctreeCubeCoordinates(0, 0, 0, 0),
58 meshOctreeCubeCoordinates(0, 0, -1, 0),
59 meshOctreeCubeCoordinates(0, 1, -1, 0)
62 meshOctreeCubeCoordinates(0, 1, 1, 0),
63 meshOctreeCubeCoordinates(0, 0, 1, 0),
64 meshOctreeCubeCoordinates(0, 0, 0, 0),
65 meshOctreeCubeCoordinates(0, 1, 0, 0)
68 meshOctreeCubeCoordinates(0, 0, 0, 0),
69 meshOctreeCubeCoordinates(0, 0, 1, 0),
70 meshOctreeCubeCoordinates(1, 0, 1, 0),
71 meshOctreeCubeCoordinates(1, 0, 0, 0)
74 meshOctreeCubeCoordinates(0, 0, -1, 0),
75 meshOctreeCubeCoordinates(0, 0, 0, 0),
76 meshOctreeCubeCoordinates(1, 0, 0, 0),
77 meshOctreeCubeCoordinates(1, 0, -1, 0)
80 meshOctreeCubeCoordinates(-1, 0, -1, 0),
81 meshOctreeCubeCoordinates(-1, 0, 0, 0),
82 meshOctreeCubeCoordinates(0, 0, 0, 0),
83 meshOctreeCubeCoordinates(0, 0, -1, 0)
86 meshOctreeCubeCoordinates(-1, 0, 0, 0),
87 meshOctreeCubeCoordinates(-1, 0, 1, 0),
88 meshOctreeCubeCoordinates(0, 0, 1, 0),
89 meshOctreeCubeCoordinates(0, 0, 0, 0)
92 meshOctreeCubeCoordinates(-1, 0, 0, 0),
93 meshOctreeCubeCoordinates(-1, -1, 0, 0),
94 meshOctreeCubeCoordinates(0, -1, 0, 0),
95 meshOctreeCubeCoordinates(0, 0, 0, 0)
98 meshOctreeCubeCoordinates(0, 0, 0, 0),
99 meshOctreeCubeCoordinates(0, -1, 0, 0),
100 meshOctreeCubeCoordinates(1, -1, 0, 0),
101 meshOctreeCubeCoordinates(1, 0, 0, 0)
104 meshOctreeCubeCoordinates(0, 1, 0, 0),
105 meshOctreeCubeCoordinates(0, 0, 0, 0),
106 meshOctreeCubeCoordinates(1, 0, 0, 0),
107 meshOctreeCubeCoordinates(1, 1, 0, 0)
110 meshOctreeCubeCoordinates(-1, 1, 0, 0),
111 meshOctreeCubeCoordinates(-1, 0, 0, 0),
112 meshOctreeCubeCoordinates(0, 0, 0, 0),
113 meshOctreeCubeCoordinates(0, 1, 0, 0)
117 const label tetCreatorOctree::faceCentreHelper_[3][4] =
124 void tetCreatorOctree::createTets()
126 createPointsAndAddressing();
128 createTetsFromFacesWithCentreNode();
130 createTetsAroundSplitEdges();
132 createTetsAroundEdges();
134 createTetsFromSplitFaces();
137 sortedLeaves_.setSize(0);
142 void tetCreatorOctree::clearOut()
144 sortedLeaves_.clear();
145 deleteDemandDrivenData(subNodeLabelsPtr_);
146 deleteDemandDrivenData(cubeLabelPtr_);
147 deleteDemandDrivenData(faceCentreLabelPtr_);
150 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
152 // Construct from octree and mesh data
153 tetCreatorOctree::tetCreatorOctree
155 const meshOctree& octree,
156 const IOdictionary& meshDict
159 octreeCheck_(octree, meshDict, true),
163 subNodeLabelsPtr_(NULL),
165 faceCentreLabelPtr_(NULL),
173 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
175 tetCreatorOctree::~tetCreatorOctree()
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 } // End namespace Foam
187 // ************************************************************************* //