93 srcCells[srcCelli].
points(srcFaces, srcPts),
97 if (
meshBb.overlaps(cellBb))
99 resultDyn.
append(srcCelli);
123 const label nbrCelli = allNbrCells[i];
131 nbrCells.
append(nbrCelli);
148 localSrcProcCellsPtr_(nullptr),
149 localTgtProcCellsPtr_(nullptr),
150 localTgtMeshPtr_(nullptr)
164 const word& cellsToCellsType
167 wordConstructorTable::iterator cstrIter =
168 wordConstructorTablePtr_->find(cellsToCellsType);
170 if (cstrIter == wordConstructorTablePtr_->end())
173 <<
"Unknown " << typeName <<
" type "
175 <<
"Valid " << typeName <<
" types are : " <<
endl
176 << wordConstructorTablePtr_->sortedToc()
189 forAll(srcLocalTgtCells_, srcCelli)
191 result[srcCelli] = !srcLocalTgtCells_[srcCelli].
empty();
200 forAll(tgtLocalSrcCells_, tgtCelli)
202 result[tgtCelli] = !tgtLocalSrcCells_[tgtCelli].
empty();
211 const label srcCelli,
215 forAll(srcLocalTgtCells_[srcCelli], i)
217 const label tgtCelli = srcLocalTgtCells_[srcCelli][i];
220 singleProcess_ == -1 ? localTgtMeshPtr_() : tgtMesh;
226 ? localTgtProcCellsPtr_()[tgtCelli]
247 if (srcTotalSize == 0 || tgtTotalSize == 0)
252 Info<<
indent << typeName <<
": Calculating couplings between "
253 << srcTotalSize <<
" source cells and " << tgtTotalSize
265 if (isSingleProcess())
271 normalise(srcMesh, srcLocalTgtCells_, srcWeights_);
272 normalise(tgtMesh, tgtLocalSrcCells_, tgtWeights_);
283 tgtMeshSendCells(srcMesh, tgtMesh)
285 localTgtProcCellsPtr_.reset
297 const polyMesh& localTgtMesh = localTgtMeshPtr_();
301 Pout<<
"Writing local target mesh: "
303 localTgtMesh.
write();
314 Pout<<
"Writing trimmed local target mesh: "
316 localTgtMesh.
write();
326 localTgtProcCellsPtr_()
329 localSrcProcCellsPtr_.reset
342 localSrcProcCellsPtr_(),
355 normalise(srcMesh, srcLocalTgtCells_, srcWeights_);
356 normalise(tgtMesh, tgtLocalSrcCells_, tgtWeights_);
363 forAll(srcLocalTgtCells_, srcCelli)
365 nCouples += srcLocalTgtCells_[srcCelli].size();
367 forAll(tgtLocalSrcCells_, tgtCelli)
369 nCouples += tgtLocalSrcCells_[tgtCelli].size();
376 <<
indent << nCouples <<
" couplings calculated in "
#define forAll(list, i)
Loop across all elements in list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
const word & name() const
Return name.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void clear()
Clear the list, i.e. set size to zero.
void setSize(const label)
Reset size of List.
bool empty() const
Return true if the list is empty (ie, size() is zero).
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
A bounding box defined in terms of the points at its extremities.
const point & min() const
Minimum point defining the bounding box.
const point & max() const
Maximum point defining the bounding box.
Class to calculate interpolative addressing and weights between the cells of two overlapping meshes.
cellsToCells()
Construct null.
labelListList tgtLocalSrcCells_
For each target cell, the coupled local source cells.
virtual ~cellsToCells()
Destructor.
labelList maskCells(const polyMesh &srcMesh, const polyMesh &tgtMesh) const
Return src cell IDs for the overlap region.
scalar update(const polyMesh &srcMesh, const polyMesh &tgtMesh)
Update addressing and weights for the given meshes. Returns the.
void appendNbrCells(const label tgtCelli, const polyMesh &mesh, const DynamicList< label > &visitedTgtCells, DynamicList< label > &nbrTgtCellIDs) const
Append target cell neighbour cells to cellIDs list.
remote srcToTgtPoint(const polyMesh &tgtMesh, const label srcCelli, const point &p) const
Find the target processor and cell associated with a point in a.
PackedBoolList srcCoupled() const
Return a list indicating which source cells are coupled.
static autoPtr< cellsToCells > New(const word &cellsToCellsType)
Select from name.
scalarListList tgtWeights_
For each target cell, the coupled source weights.
labelListList srcLocalTgtCells_
For each source cell, the coupled local target cells.
scalarListList srcWeights_
For each source cell, the coupled target weights.
PackedBoolList tgtCoupled() const
Return a list indicating which target cells are coupled.
void initialise(const polyMesh &srcMesh, const polyMesh &tgtMesh)
Initialise the addressing and weights.
Starts timing CPU usage and return elapsed time from start.
double cpuTimeIncrement() const
Return CPU time (in seconds) since last call to cpuTimeIncrement()
Mesh consisting of general polyhedral cells.
virtual const faceList & faces() const
Return raw faces.
bool pointInCell(const point &p, label celli, const cellDecomposition=CELL_TETS) const
Test if point p is in the celli.
virtual const pointField & points() const
Return raw points.
const boundBox & bounds() const
Return mesh bounding box.
const labelListList & cellCells() const
const cellList & cells() const
virtual bool write(const bool write=true) const
Write using setting from DB.
Struct for keeping processor, element (cell, face, point) index.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label calculate(const fvMesh &mesh, const labelHashSet &patchIDs, const scalar minFaceFraction, GeometricField< scalar, PatchField, GeoMesh > &distance)
Calculate distance data from patches.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
prefixOSstream Pout(cout, "Pout")
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
quaternion normalise(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
Ostream & indent(Ostream &os)
Indent stream.
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(1e-3))