Go to the documentation of this file.
58 const vectorField& faceCentres = surfaceEngine_.faceCentres();
60 const labelList& bPoints = surfaceEngine_.boundaryPoints();
66 # pragma omp parallel for schedule(dynamic, 50)
70 const label bpI = nodesToMap[i];
72 mappingDistance[i] = 0.0;
78 mappingDistance[i] =
Foam::max(mappingDistance[i], d);
82 mappingDistance[i] *= 4.0;
89 const VRWGraph& bpAtProcs = surfaceEngine_.bpAtProcs();
91 surfaceEngine_.globalBoundaryPointLabel();
94 std::map<label, DynList<labelledScalar> > exchangeData;
106 const label bpI = nodesToMap[nI];
109 globalToLocal.insert(globalPointLabel[bpI], nI);
113 const label neiProc = bpAtProcs(bpI, i);
117 exchangeData[neiProc].append
147 const face& bf = surfaceEngine_.boundaryFaces()[bfI];
158 meshOctree_.findNearestSurfacePointInRegion
170 meshOctree_.findNearestSurfacePointInRegion
187 projPoints[bf.fcIndex(pI)],
220 # pragma omp parallel for schedule(dynamic, 50)
222 forAll(nodesToMap, cornerI)
224 const label bpI = nodesToMap[cornerI];
225 if( !corners.
found(bpI) )
228 "meshSurfaceMapper::mapCorners(const labelLongList&)"
229 ) <<
"Trying to map a point that is not a corner"
233 const scalar maxDist = mappingDistance[cornerI];
263 if(
magSqr(newP - mapPointApprox) < 1
e-8 * maxDist )
266 mapPointApprox = newP;
268 distSqApprox =
magSqr(mapPointApprox -
p);
271 scalar distSq(mappingDistance[cornerI]);
275 const label cornerID = surfCorners[scI];
276 const point& sp = sPoints[cornerID];
299 if( distSq > 1.2 * distSqApprox )
301 mapPoint = mapPointApprox;
336 # pragma omp parallel for schedule(dynamic, 50)
340 const label bpI = nodesToMap[i];
346 const scalar maxDist = mappingDistance[i];
374 if(
magSqr(newP - mapPointApprox) < 1
e-8 * maxDist )
377 mapPointApprox = newP;
379 distSqApprox =
magSqr(mapPointApprox -
p);
382 point mapPoint(mapPointApprox);
383 scalar distSq(distSqApprox);
388 if( distSq > 1.2 * distSqApprox )
390 mapPoint = mapPointApprox;
391 distSq = distSqApprox;
395 if( distSq > maxDist )
400 distSq = mappingDistance[i];
401 mapPoint =
f * (mapPoint -
p) +
p;
407 if( bpAtProcsPtr && bpAtProcsPtr->
sizeOfRow(bpI) )
410 # pragma omp critical
438 selectedPoints.
append(it.key());
442 selectedPoints.
clear();
445 selectedPoints.
append(it.key());
const VRWGraph & bpAtProcs() const
processors which contain the vertex
vector normal(const pointField &) const
Vector normal; magnitude is equal to area of face.
void append(const T &e)
Append an element at the end of the list.
const meshSurfaceEngine & surfaceEngine_
mesh surface
scalar faceMetricInPatch(const label bfI, const label patchI) const
calculate face metric
#define forAll(list, i)
Loop across all elements in list.
const pointField & points() const
access to points
void clear()
Clear the list, i.e. set next free to zero.
static bool & parRun()
Is this a parallel run?
point centre(const pointField &) const
Centre point of face.
const triSurfacePartitioner & surfacePartitioner() const
label size() const
Size of the active part of the list.
dimensioned< scalar > mag(const dimensioned< Type > &)
bool contains(const T &e) const
check if the element is in the list (takes linear time)
void findMappingDistance(const labelLongList &nodesToMap, scalarList &mappingDistance) const
find mapping distance for selected points
label scalarLabel() const
return scalar label
const VRWGraph & pointPatches() const
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=*(cellModeller::lookup("hex"));labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells]=cellShape(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< SMALL) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &oldCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]
const scalar & value() const
return the value
void mapToSmallestDistance(LongList< parMapperHelper > &)
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.
bool findNearestEdgePoint(point &edgePoint, scalar &distSq, label &nearestEdge, const point &p, const DynList< label > ®ions) const
find nearest feature-edges vertex to a given vertex
void moveBoundaryVertexNoUpdate(const label bpI, const point &newP)
relocate the selected boundary vertex
#define forAllRow(graph, rowI, index)
const pointFieldPMG & points() const
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
bool found(const Key &) const
Return true if hashedEntry is found in table.
void updateGeometry(const labelLongList &)
errorManip< error > abort(error &err)
const double e
Elementary charge.
void mapCornersAndEdges()
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void setSize(const label)
Reset size of List.
void mapEdgeNodes(const labelLongList &nodesToMap)
const labelHashSet & edgePoints() const
return labels of edge points (from the list of boundary points)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedScalar sqrt(const dimensionedScalar &ds)
void exchangeMap(const std::map< label, ListType > &m, LongList< T > &data, const Pstream::commsTypes commsType)
const labelList & corners() const
return corner nodes
const meshSurfacePartitioner & meshPartitioner() const
const labelList & boundaryPoints() const
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
void findNearestSurfacePointInRegion(point &nearest, scalar &distSq, label &nearestTriangle, const label region, const point &p) const
find nearest surface point for vertex in a given region
const triSurf & surface() const
return a reference to the surface
const labelHashSet & corners() const
return labels of corner points (from the list of boundary points)
void mapCorners(const labelLongList &nodesToMap)
map corner nodes to the boundary
dimensioned< scalar > magSqr(const dimensioned< Type > &)
const meshOctree & meshOctree_
reference to the octree
const List< DynList< label > > & cornerPatches() const
return corner patches
triangle< point, const point & > triPointRef