Go to the documentation of this file.
76 if( decomposeFace[fI] )
84 if( decomposeFace.
size() != faces.
size() )
87 "void decomposeFaces::decomposeMeshFaces(const boolList&)"
94 for(
label faceI=0;faceI<nIntFaces;++faceI)
96 const face&
f = faces[faceI];
98 if( decomposeFace[faceI] )
101 Info <<
"Decomposing internal face " << faceI <<
" with nodes "
110 newF[1] =
f.nextLabel(pI);
114 Info <<
"Storing face " << newF <<
" with label "
129 Info <<
"Storing internal face " << faceI <<
" with nodes "
130 <<
f <<
" as new face " << faceI <<
endl;
140 forAll(boundaries, patchI)
142 const label start = boundaries[patchI].patchStart();
143 const label end = start + boundaries[patchI].patchSize();
145 boundaries[patchI].patchStart() = nFaces;
147 for(
label bfI=start;bfI<end;++bfI)
149 const face&
f = faces[bfI];
150 if( decomposeFace[bfI] )
153 Info <<
"Decomposing boundary face " << bfI
154 <<
" with nodes " <<
f <<
endl;
162 newF[1] =
f.nextLabel(pI);
166 Info <<
"Storing face " << newF <<
" with label "
180 Info <<
"Storing boundary face " << bfI <<
" in patch"
181 << patchI <<
" as new face " << bfI <<
endl;
189 boundaries[patchI].patchSize() =
190 nFaces - boundaries[patchI].patchStart();
199 forAll(procBoundaries, patchI)
201 const label start = procBoundaries[patchI].patchStart();
202 const label end = start + procBoundaries[patchI].patchSize();
204 const bool own = procBoundaries[patchI].owner();
206 procBoundaries[patchI].patchStart() = nFaces;
208 for(
label bfI=start;bfI<end;++bfI)
217 f = faces[bfI].reverseFace();
220 if( decomposeFace[bfI] )
223 Info <<
"Decomposing processor boundary face " << bfI
224 <<
" with nodes " <<
f <<
endl;
232 newF[1] =
f.nextLabel(pI);
236 Info <<
"Storing face " << newF <<
" with label "
257 Info <<
"Storing boundary face " << bfI <<
" in patch"
258 << patchI <<
" as new face " << bfI <<
endl;
273 procBoundaries[patchI].patchSize() =
274 nFaces - procBoundaries[patchI].patchStart();
282 face&
f = faces[faceI];
286 f[pI] = newFaces(faceI, pI);
297 # pragma omp parallel for schedule(dynamic, 40)
307 const label faceI =
c[fJ];
313 Info <<
"Cell " << cellI <<
" with faces " <<
c
314 <<
" is changed into " << newC <<
endl;
317 c.setSize(newC.
size());
341 "void decomposeFaces::decomposeConcaveInternalFaces"
342 "(const boolList& concaveVertex)"
348 newFacesForFace_.setSize(mesh_.faces().size());
349 forAll(newFacesForFace_, fI)
350 newFacesForFace_.setRowSize(fI, 0);
352 const label nIntFaces = mesh_.nInternalFaces();
358 if( concaveVertex.
size() != mesh_.points().size() )
361 "void decomposeFaces::decomposeMeshFaces(const boolList&)"
369 const label id = mesh_.addFaceSubset(
"decomposedFaces");
373 for(
label faceI=0;faceI<nIntFaces;++faceI)
375 const face&
f = faces[faceI];
379 if( concaveVertex[
f[pI]] )
384 if( concavePos.
size() == 1 )
387 Info <<
"1. Decomposing internal face " << faceI <<
" with nodes "
389 mesh_.addFaceToSubset(
id, faceI);
392 newF[0] =
f[concavePos[0]];
396 const label pJ = (concavePos[0] + pI) %
f.
size();
398 newF[2] =
f.nextLabel(pJ);
401 Info <<
"Storing face " << newF <<
" with label "
405 newFacesForFace_.append(faceI, newFaces.
size());
409 else if( concavePos.
size() > 1 )
412 Info <<
"2. Decomposing internal face " << faceI <<
" with nodes "
414 mesh_.addFaceToSubset(
id, faceI);
421 newF[2] =
f.nextLabel(pI);
424 Info <<
"2. Storing face " << newF <<
" with label "
428 newFacesForFace_.append(faceI, newFaces.
size());
438 Info <<
"Storing internal face " << faceI <<
" with nodes "
439 <<
f <<
" as new face " << newFaces.
size() <<
endl;
442 newFacesForFace_.append(faceI, newFaces.
size());
448 forAll(boundaries, patchI)
450 const label start = boundaries[patchI].patchStart();
451 const label end = start + boundaries[patchI].patchSize();
454 boundaries[patchI].patchStart() = newFaces.
size();
457 for(
label bfI=start;bfI<end;++bfI)
459 newFacesForFace_.append(bfI, newFaces.
size());
471 faces[faceI][pI] = newFaces(faceI, pI);
480 # pragma omp parallel for schedule(dynamic, 40)
490 const label faceI =
c[fJ];
492 newC.
append(newFacesForFace_(faceI, nfI));
496 Info <<
"Cell " << cellI <<
" with faces " <<
c
497 <<
" is changed into " << newC <<
endl;
500 c.setSize(newC.
size());
508 mesh_.updateFaceSubsets(newFacesForFace_);
526 "const VRWGraph& decomposeFaces::newFacesForFace() const"
527 ) <<
"Decomposition is not yet performed!" <<
endl;
~decomposeFaces()
Destructor.
face reverseFace() const
Return face with reverse direction.
#define forAll(list, i)
Loop across all elements in list.
const VRWGraph & newFacesForFace() const
static bool & parRun()
Is this a parallel run?
Ostream & endl(Ostream &os)
Add newline and flush stream.
const pointFieldPMG & points() const
access to points
void updateFaceSubsets(const ListType &)
const faceListPMG & faces() const
access to faces
label nInternalFaces() const
return number of internal faces
PtrList< boundaryPatch > & boundariesAccess()
access to boundary data
PtrList< processorBoundaryPatch > & procBoundariesAccess()
access to processor boundary data
cellListPMG & cellsAccess()
access to cells
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual Ostream & write(const token &)=0
Write next token to stream.
void decomposeConcaveInternalFaces(const boolList &concaveVertex)
decompose internal faces containing concave nodes
label size() const
Returns the number of rows.
void setSize(const label nElmts)
set the number of used elements
void setSize(const label)
Reset the number of rows.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
#define forAllRow(graph, rowI, index)
label size() const
return the number of used elements
void removeUnusedVertices()
remove unused vertices
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
pointFieldPMG & pointsAccess()
access to mesh points
bool done_
is decomposition performed
errorManip< error > abort(error &err)
void decomposeMeshFaces(const boolList &decomposeFace)
decompose selected faces into triangles using midnode subdivision
errorManipArg< error, int > exit(error &err, const int errNo=1)
polyMeshGen & mesh_
reference to the mesh
label size() const
return the number of used elements
void appendList(const ListType &l)
Append a list as a row at the end of the graph.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(const label)
Reset size of List.
void append(const label rowI, const label)
Append an element to the given row.
void clearAll()
clear out all allocated data
const dimensionedScalar c
Speed of light in a vacuum.
VRWGraph newFacesForFace_
number of points
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
A face is a list of labels corresponding to mesh vertices.
#define WarningIn(functionName)
Report a warning using Foam::Warning.
faceListPMG & facesAccess()
access to mesh faces
void size(const label)
Override size to be inconsistent with allocated storage.
A cell is defined as a list of faces with extra functionality.
void setRowSize(const label rowI, const label newSize)
Reset the size of the given row.
void append(const T &e)
Append an element at the end of the list.
decomposeFaces(const decomposeFaces &)
copy constructor