Go to the documentation of this file.
64 if( origin.size() != vecs.size() )
67 "void boundaryLayerOptimisation::writeVTK(const fileName&,"
68 " const pointField&, const vectorField&)"
74 file <<
"# vtk DataFile Version 3.0\n";
75 file <<
"vtk output\n";
77 file <<
"DATASET POLYDATA\n";
80 file <<
"POINTS " << 2*origin.size() <<
" float\n";
83 const point&
p = origin[pI];
85 file <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z() <<
nl;
87 const point op =
p + vecs[pI];
89 file << op.
x() <<
' ' << op.
y() <<
' ' << op.
z() <<
nl;
93 file <<
"\nLINES " << vecs.size()
94 <<
" " << 3*vecs.size() <<
nl;
97 file << 2 <<
" " << 2*eI <<
" " << (2*eI+1) <<
nl;
110 if( vecs.size() != hairEdges_.size() )
113 "void boundaryLayerOptimisation::writeHairEdges"
114 "(const fileName&, const direction, const vectorField&) const"
120 forAll(hairEdgeType_, heI)
121 if( hairEdgeType_[heI] & eType )
132 forAll(hairEdgeType_, heI)
134 if( hairEdgeType_[heI] & eType )
136 const edge&
he = hairEdges_[heI];
139 copyVecs[counter] = vecs[heI] *
he.mag(
points);
158 forAll(hairEdgeType_, heI)
159 if( hairEdgeType_[heI] & eType )
170 forAll(hairEdgeType_, heI)
172 if( hairEdgeType_[heI] & eType )
174 const edge&
he = hairEdges_[heI];
192 if( omp_in_parallel() )
195 "const meshSurfaceEngine&"
196 " boundaryLayerOptimisation::meshSurface()"
212 if( omp_in_parallel() )
215 "const meshSurfacePartitioner& "
216 "boundaryLayerOptimisation::surfacePartitioner()"
248 # pragma omp parallel for schedule(dynamic, 100)
250 forAll(layerAtBndFace, bfI)
252 if( layerAtBndFace[bfI] < 0 )
275 # pragma omp parallel for schedule(dynamic, 100)
283 const label f0 = edgeFaces(edgeI, 0);
284 const label f1 = edgeFaces(edgeI, 1);
287 if( faceOwner[f0] != faceOwner[
f1] )
318 # pragma omp parallel for schedule(dynamic, 100)
325 const label bpI = bp[
e.start()];
330 const label beI = bpEdges(bpI, peI);
332 const edge& be = edges[bpEdges(bpI, peI)];
338 if( featureEdges.
found(beI) )
342 if( corners.
found(bpI) )
346 else if( edgePoints.
found(bpI) )
368 const label cellI = faceOwner[bfI];
374 const face&
f = faces[
c[fI]];
378 const label bpI = bp[
f[pI]];
390 const label bpI = bp[
e.start()];
397 const face&
f = faces[bpFacesHelper(bpI, pfI)];
406 if(
f.faceEdge(eI) ==
e )
415 const label eJ = (faceEdge+2) % 4;
417 const edge fe =
f.faceEdge(eJ);
419 for(
label i=0;i<2;++i)
421 const label bpJ = bp[fe[i]];
483 bool modified(
false);
490 # pragma omp parallel for schedule(dynamic, 50)
505 # pragma omp parallel for schedule(dynamic, 50)
525 Info <<
"Hair edges at exitting faces shall "
526 <<
"be modified due to inner constraints" <<
endl;
572 Info <<
"Thinned " << counter <<
" bnd hair edges" <<
endl;
582 label intCounter = 0;
586 Info <<
"Thinned " << (intCounter - counter)
587 <<
" inner hair edges" <<
endl;
const VRWGraph & boundaryPointEdges() const
const labelList & bp() const
void append(const T &e)
Append an element at the end of the list.
A class for handling file names.
boolList isExitFace_
is boundary face part of a layer where a layer exits
void setRow(const label rowI, const ListType &l)
Set row with the list.
#define forAll(list, i)
Loop across all elements in list.
void optimiseHairNormalsInside()
optimise hair normals inside the mesh
Template functions to aid in the implementation of demand driven data.
void optimiseHairNormalsAtTheBoundary()
A List obtained as a section of another List.
label addFaceSubset(const word &)
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void calculateHairEdges()
calculate hairEdges
Ostream & endl(Ostream &os)
Add newline and flush stream.
const pointFieldPMG & points() const
access to points
label size() const
Size of the active part of the list.
void appendIfNotIn(const label rowI, const label)
Append an element to the given row if it does not exist there.
boolList thinnedHairEdge_
stores information where boundary hairs are made thinner
const faceListPMG & faces() const
access to faces
void writeVTK(OFstream &os, const Type &value)
static void writeVTK(const fileName &fName, const pointField &origin, const vectorField &vecs)
write vectors into a VTK file. Helper for debugging
VRWGraph hairEdgesNearHairEdge_
hair edge to other hair edges
VRWGraph hairEdgesAtBndPoint_
hair edges attached to a boundary point
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
const faceList::subList & boundaryFaces() const
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
const meshSurfaceEngine * meshSurfacePtr_
const pointer to meshSurfaceEngine
const edgeLongList & hairEdges() const
return hair edges found in the detection process
const cellListPMG & cells() const
access to cells
label size() const
Returns the number of rows.
void setSize(const label)
Reset the number of rows.
#define forAllRow(graph, rowI, index)
label size() const
return the number of used elements
void optimiseLayer()
performs boundary layer optimisation
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
void addPointToSubset(const label, const label)
const VRWGraph & hairEdgesAtBndPoint() const
hair edges attached to a boundary point
bool optimiseLayersAtExittingFaces()
optimise layers at exitting faces due to requests from the inside
bool found(const Key &) const
Return true if hashedEntry is found in table.
const VRWGraph & edgeFaces() const
void updateGeometry(const labelLongList &)
errorManip< error > abort(error &err)
const double e
Elementary charge.
const meshSurfaceEngine & meshSurface() const
access to mesh surface
const edgeList & edges() const
polyMeshGen & mesh_
reference to polyMeshGen
void optimizeSurface(const label nIterations=5)
optimize boundary nodes after boundary regions are created
void setSize(const label)
Reset size of List.
const labelHashSet & edgePoints() const
return labels of edge points (from the list of boundary points)
void optimiseThicknessVariation(const direction edgeType=(INSIDE|BOUNDARY))
optimise thickness variation
edgeLongList hairEdges_
boundary layer hairs
const PtrList< boundaryPatch > & boundaries() const
ordinary boundaries
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const meshSurfacePartitioner * partitionerPtr_
mesh surface partitioner
boolList isBndLayerBase_
is boundary face a base for a prism in the bnd layer
void lockBoundaryFaces(const labelListType &)
lock the boundary faces which shall not be modified
const meshSurfacePartitioner & surfacePartitioner() const
access to meshSurfacePartitioner
const dimensionedScalar c
Speed of light in a vacuum.
void writeHairEdges(const fileName &fName, const direction eType, const vectorField &vecs) const
write vector correcposing to hair edges. Helper for debugging
void addFaceToSubset(const label, const label)
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
A face is a list of labels corresponding to mesh vertices.
List< direction > hairEdgeType_
classification of hair edges
const labelList & faceInLayer() const
index of a layer to which a boundary faces belong to
void size(const label)
Override size to be inconsistent with allocated storage.
void lockFeatureEdges()
lock edge points
label maxNumIterations_
maximum number of iterations
label size() const
Return the number of elements in the UList.
const labelHashSet & corners() const
return labels of corner points (from the list of boundary points)
label addPointSubset(const word &)
point subsets
A cell is defined as a list of faces with extra functionality.
const labelHashSet & featureEdges() const
return labels of boundary edges which are feature edges
void append(const T &e)
Append an element at the end of the list.
const labelList & faceOwners() const