94 srcCells[srcCelli].
points(srcFaces, srcPts),
98 if (
meshBb.overlaps(cellBb))
100 resultDyn.
append(srcCelli);
124 const label nbrCelli = allNbrCells[i];
132 nbrCells.
append(nbrCelli);
149 localSrcProcCellsPtr_(nullptr),
150 localTgtProcCellsPtr_(nullptr),
151 localTgtMeshPtr_(nullptr)
165 const word& cellsToCellsType
168 wordConstructorTable::iterator cstrIter =
169 wordConstructorTablePtr_->find(cellsToCellsType);
171 if (cstrIter == wordConstructorTablePtr_->end())
174 <<
"Unknown " <<
typeName <<
" type "
177 << wordConstructorTablePtr_->sortedToc()
190 forAll(srcLocalTgtCells_, srcCelli)
192 result[srcCelli] = !srcLocalTgtCells_[srcCelli].
empty();
201 forAll(tgtLocalSrcCells_, tgtCelli)
203 result[tgtCelli] = !tgtLocalSrcCells_[tgtCelli].
empty();
212 const label srcCelli,
216 forAll(srcLocalTgtCells_[srcCelli], i)
218 const label tgtCelli = srcLocalTgtCells_[srcCelli][i];
221 singleProcess_ == -1 ? localTgtMeshPtr_() : tgtMesh;
227 ? localTgtProcCellsPtr_()[tgtCelli]
248 if (srcTotalSize == 0 || tgtTotalSize == 0)
254 << srcTotalSize <<
" source cells and " << tgtTotalSize
266 if (isSingleProcess())
272 normalise(srcMesh, srcLocalTgtCells_, srcWeights_);
273 normalise(tgtMesh, tgtLocalSrcCells_, tgtWeights_);
284 tgtMeshSendCells(srcMesh, tgtMesh)
286 localTgtProcCellsPtr_.reset
298 const polyMesh& localTgtMesh = localTgtMeshPtr_();
302 Pout<<
"Writing local target mesh: "
304 localTgtMesh.
write();
315 Pout<<
"Writing trimmed local target mesh: "
317 localTgtMesh.
write();
327 localTgtProcCellsPtr_()
330 localSrcProcCellsPtr_.reset
343 localSrcProcCellsPtr_(),
356 normalise(srcMesh, srcLocalTgtCells_, srcWeights_);
357 normalise(tgtMesh, tgtLocalSrcCells_, tgtWeights_);
364 forAll(srcLocalTgtCells_, srcCelli)
366 nCouples += srcLocalTgtCells_[srcCelli].size();
368 forAll(tgtLocalSrcCells_, tgtCelli)
370 nCouples += tgtLocalSrcCells_[tgtCelli].size();
377 <<
indent << nCouples <<
" couplings calculated in "
378 <<
time.cpuTimeIncrement() <<
's' <<
endl;
#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.
Mesh consisting of general polyhedral cells.
virtual const faceList & faces() const
Return raw faces.
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.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label calculate(const fvMesh &mesh, const labelHashSet &patchIDs, const scalar minFaceFraction, GeometricField< scalar, 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.
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.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
defineRunTimeSelectionTable(fvConstraint, dictionary)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
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.
bool pointInCell(const point &p, const polyMesh &mesh, const label celli, const pointInCellShapes=pointInCellShapes::tets)
Test if a point is in a given cell.
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
Ostream & indent(Ostream &os)
Indent stream.
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Function for determining if a point is within a cell of a polyMesh.
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(1e-3))