tetCreatorOctreeTetsFromSplitFaces.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Description
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "tetCreatorOctree.H"
29 #include "demandDrivenData.H"
30 
31 //#define DEBUGTets
32 
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
41 {
42  Info << "Creating tets from split faces" << endl;
43 
44  const labelList& cubeLabel = *cubeLabelPtr_;
45  const VRWGraph& subNodeLabels = *subNodeLabelsPtr_;
46  const FRWGraph<label, 8>& pLeaves = octreeCheck_.nodeLeaves();
47 
48  forAll(pLeaves, pointI)
49  {
50  for(label i=0;i<6;++i)
51  {
52  const label* fNodes =
54 
55  const label cLabel = pLeaves(pointI, fNodes[0]);
56 
57  if( cLabel < 0 )
58  continue;
59  if( cubeLabel[cLabel] < 0 )
60  continue;
61 
62  if(
63  (cLabel == pLeaves(pointI, fNodes[1])) &&
64  (cLabel == pLeaves(pointI, fNodes[2])) &&
65  (cLabel == pLeaves(pointI, fNodes[3]))
66  )
67  {
68  //- create 4 tets
69  for(label j=0;j<4;++j)
70  {
72  (
73  partTet
74  (
75  pointI,
76  subNodeLabels(cLabel, 7-fNodes[j]),
77  subNodeLabels(cLabel, 7-fNodes[(j+1)%4]),
78  cubeLabel[cLabel]
79  )
80  );
81  }
82  }
83  }
84  }
85 }
86 
87 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88 
89 } // End namespace Foam
90 
91 // ************************************************************************* //
Foam::tetCreatorOctree::createTetsFromSplitFaces
void createTetsFromSplitFaces()
create tetrahedra from split faces
Definition: tetCreatorOctreeTetsFromSplitFaces.C:40
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::tetCreatorOctree::checkAndAppendTet
void checkAndAppendTet(const partTet)
Definition: tetCreatorOctreeI.H:33
Foam::partTet
Definition: partTet.H:53
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::tetCreatorOctree::octreeCheck_
meshOctreeAddressing octreeCheck_
reference to the octree
Definition: tetCreatorOctree.H:63
tetCreatorOctree.H
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Info
messageStream Info
Foam::tetCreatorOctree::subNodeLabelsPtr_
VRWGraph * subNodeLabelsPtr_
node labels of vertices created inside split-hex boxes
Definition: tetCreatorOctree.H:75
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::meshOctreeCubeCoordinates::faceNodes_
static const label faceNodes_[6][4]
cube nodes making each face
Definition: meshOctreeCubeCoordinates.H:73
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::meshOctreeAddressing::nodeLeaves
const FRWGraph< label, 8 > & nodeLeaves() const
return nodeLeaves
Definition: meshOctreeAddressingI.H:60
Foam::FRWGraph< label, 8 >
Foam::VRWGraph
Definition: VRWGraph.H:101
Foam::tetCreatorOctree::cubeLabelPtr_
labelList * cubeLabelPtr_
cube centre label
Definition: tetCreatorOctree.H:78