Go to the documentation of this file.
43 Info <<
"Creating tets around edges" <<
endl;
61 for(
label plI=0;plI<8;++plI)
63 const label leafI = pLeaves(nodeI, plI);
71 nodeLevel[nodeI] = level;
81 forAll(curLevelLeaves, leafI)
83 const label curLeaf = curLevelLeaves[leafI];
85 if( cubeLabel[curLeaf] == -1 )
92 Info <<
"Search cube " << curLeaf <<
" has coordinates "
94 Info <<
"Node labels for cube are " << nodeLabels[curLeaf] <<
endl;
98 for(
label eI=0;eI<12;++eI)
100 const label startNode =
103 const label start = nodeLabels(curLeaf, startNode);
112 Info <<
"Creating tets around edge " << eI <<
endl;
113 Info <<
"Edge nodes are " << start <<
" and " << end <<
endl;
121 (nodeLevel[start] ==
direction(levelI)) &&
128 const label fI = 2*(eI/4)+1;
130 const label* fNodes =
135 for(
label i=0;i<4;++i)
136 edgeCubes[i] = pLeaves(start, fNodes[i]);
141 Info <<
"Cube " << i <<
" is " << edgeCubes[i] <<
endl;
143 if( edgeCubes[i] < 0 )
146 Info <<
"Cubes has node labels "
147 << nodeLabels[edgeCubes[i]] <<
endl;
155 const label cLabel = edgeCubes[i];
157 if( (cLabel == -1) || (cubeLabel[cLabel] == -1) )
167 Info <<
"Edge cube " << i <<
" is " << oc <<
endl;
168 Info <<
"Node labels ";
170 Info << nodeLabels(cLabel,
k) <<
" ";
176 if( cLabel < curLeaf )
183 Info <<
"Adding centre label " << cubeLabel[cLabel]
187 centreNodes.
append(cubeLabel[cLabel]);
190 if( faceCentreLabel.
sizeOfRow(cLabel) != 0 )
192 const label helpFace = eI/4;
206 Info <<
"Centre nodes after cube " << i
207 <<
" are " << centreNodes <<
endl;
213 Info <<
"Edge cube " << cLabel <<
endl;
216 Info <<
"Adding pos "
217 << vlPos[startNode][fNodes[i]] <<
endl;
222 cc + vlPos[startNode][fNodes[i]]
231 for(
label j=0;j<8;j++)
243 "void tetCreatorOctree::"
244 "createTetsAroundEdges()"
245 ) <<
"Cannot find cube position"
252 centreNodes.
append(subNodeLabels(cLabel,
pos));
255 Info <<
"Centre node " << i <<
" is "
256 << subNodeLabels(cLabel,
pos)
267 const label nCentres = centreNodes.
size();
271 if( centreNodes[i] == -1 )
273 if( centreNodes[(i+1)%nCentres] == -1 )
279 centreNodes[(i+1)%nCentres],
287 Info <<
"Last added tet "
288 <<
tets_.size()-1 <<
" is "
#define forAll(list, i)
Loop across all elements in list.
Template functions to aid in the implementation of demand driven data.
const VRWGraph & nodeLabels() const
return nodeLabels
const FixedList< FixedList< meshOctreeCubeCoordinates, 8 >, 8 > & positionsOfLeavesAtNodes() const
return positions to find the leaves at each cube node
Ostream & endl(Ostream &os)
Add newline and flush stream.
meshOctreeAddressing octreeCheck_
reference to the octree
const meshOctreeCubeCoordinates & coordinates() const
return coordinates in the octree
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
VRWGraph * faceCentreLabelPtr_
cube face label
meshOctreeCubeCoordinates refineForPosition(const label) const
return the coordinates of child cube at the given position
#define forAllRow(graph, rowI, index)
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
void createTetsAroundEdges()
create tetrahedra from faces, owner and neighbour
#define forAllReverse(list, i)
Reverse loop across all elements in list.
VRWGraph * subNodeLabelsPtr_
node labels of vertices created inside split-hex boxes
errorManip< error > abort(error &err)
static const label edgeNodes_[12][2]
edge nodes for an octree cube
static const label faceNodes_[6][4]
cube nodes making each face
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
LongList< point > tetPoints_
points of the tetrahedrisation
const meshOctree & octree() const
return const reference to meshOctree
static const label faceCentreHelper_[3][4]
helper for finding face centres of cubes sharing an edge
direction level() const
return level
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T> with a fixed size <Size>.
List< labelLongList > sortedLeaves_
octree leaves sorted according to their level
label k
Boltzmann constant.
const FRWGraph< label, 8 > & nodeLeaves() const
return nodeLeaves
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
LongList< partTet > tets_
tetrahedra
label numberOfNodes() const
return number of octree nodes
const meshOctreeCubeBasic & returnLeaf(const label) const
labelList * cubeLabelPtr_
cube centre label
void append(const T &e)
Append an element at the end of the list.
dimensionedScalar pos(const dimensionedScalar &ds)