Go to the documentation of this file.
44 Info<<
"meshToMesh0::calculateAddressing() : "
45 <<
"calculating mesh-to-mesh cell addressing" <<
endl;
65 Info<<
"meshToMesh0::calculateAddressing() : "
66 <<
"Setting up rescue" <<
endl;
74 forAll(patchesFrom, patchI)
77 const labelUList& bCells = patchesFrom[patchI].faceCells();
81 boundaryCell[bCells[faceI]] =
true;
87 scalar typDim =
meshBb.avgDim()/(2.0*
cbrt(scalar(fromCells.
size())));
99 Info<<
" bounding box (shifted) : " << shiftedBb <<
endl;
154 if (fromPatch.empty())
157 <<
"Source patch " << fromPatch.
name()
158 <<
" has no faces. Not performing mapping for it."
166 wallBb.
avgDim()/(2.0*
sqrt(scalar(fromPatch.size())));
171 wallBb.
max() +
vector(typDim, typDim, typDim)
190 scalar distSqr =
sqr(wallBb.
mag());
196 centresToBoundary[toi],
206 Info<<
"meshToMesh0::calculateAddressing() : "
207 <<
"finished calculating mesh-to-mesh cell addressing" <<
endl;
242 scalar distSqr =
magSqr(
p - centresFrom[curCell]);
251 const labelList& neighbours = cc[curCell];
256 magSqr(
p - centresFrom[neighbours[nI]]);
260 if (curDistSqr < (1 - SMALL)*distSqr)
262 curCell = neighbours[nI];
263 distSqr = curDistSqr;
269 cellAddressing_[toI] = -1;
274 cellAddressing_[toI] = curCell;
281 if (boundaryCell[curCell])
291 const labelList& neighbours = cc[curCell];
299 cellAddressing_[toI] = neighbours[nI];
310 const labelList& neighbours = cc[curCell];
315 const labelList& nn = cc[neighbours[nI]];
323 cellAddressing_[toI] = nn[nI];
virtual const pointField & points() const
Return raw points.
scalar mag() const
The magnitude of the bounding box span.
labelList cellAddressing_
Cell addressing.
const point & max() const
Maximum describing the bounding box.
HashTable< label > cuttingPatches_
toMesh patch labels which cut the from-mesh
#define forAll(list, i)
Loop across all elements in list.
HashTable< word > patchMap_
Patch map.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
Standard boundBox + extra functionality for use in octree.
const cellList & cells() const
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool pointInCell(const point &p, label celli, const cellDecomposition=CELL_TETS) const
Test if point p is in the celli.
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(rndGen, 1e-3))
Pre-declare related SubField type.
Encapsulation of data needed to search in/for cells. Used to find the cell containing a point (e....
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.
A patch is a list of labels that address the faces in the global face list.
scalar typDim() const
Typical dimension length,height,width.
const labelListList & cellCells() const
Non-pointer based hierarchical recursive searching.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
const point & min() const
Minimum describing the bounding box.
label findInside(const point &) const
Find shape containing point. Only implemented for certain.
void print(prefixOSstream &, const bool printContents, const label) const
Print tree. Either print all indices (printContent = true) or.
labelListList boundaryAddressing_
Boundary addressing.
bool found(const Key &) const
Return true if hashedEntry is found in table.
Mesh data needed to do the Finite Volume discretisation.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
void setSize(const label)
Reset size of List.
const vectorField & cellCentres() const
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const vectorField::subField faceCentres() const
Return face centres.
prefixOSstream Pout(cout, "Pout")
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)
Encapsulation of data needed to search for faces.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
scalar avgDim() const
Average length/height/width dimension.
void cellAddresses(labelList &cells, const pointField &points, const fvMesh &fromMesh, const List< bool > &boundaryCell, const indexedOctree< treeDataCell > &oc) const
void findNearest(const label nodeI, const linePointRef &ln, treeBoundBox &tightest, label &nearestShapeI, point &linePoint, point &nearestPoint, const FindNearestOp &fnOp) const
Find nearest point to line.
void size(const label)
Override size to be inconsistent with allocated storage.
dimensionedScalar cbrt(const dimensionedScalar &ds)
const word & name() const
Return name.
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
HashTable< label > fromMeshPatches_
fromMesh patch labels