70 globalCellIDs[cellI] = globalNumbering.toGlobal(cellI);
72 overlap.cellInterpolationMap().distribute(globalCellIDs);
91 Pout<<
"oversetFvMeshBase::update() : extended addressing from" 93 <<
" to nFaces:" << lowerAddr.
size()
94 <<
" nExtraFaces:" << nExtraFaces <<
endl;
118 const label nbrCelli = nbrs[nbri];
119 label globalNbr = globalCellIDs[nbrCelli];
120 label proci = globalNumbering.whichProcID(globalNbr);
121 label remoteCelli = globalNumbering.toLocal(proci, globalNbr);
126 procOwner[proci].
append(celli);
127 dynProcNeighbour[proci].append(remoteCelli);
139 procNeighbour[i] = std::move(dynProcNeighbour[i]);
142 Pstream::exchange<labelList, label>(procNeighbour, mySendCells);
147 if (procOwner[proci].size())
151 if (mySendCells[proci].size())
171 Pout<<
"Adding interface " << nbri
172 <<
" to receive my " << procOwner[proci].size()
173 <<
" from " << proci <<
endl;
175 procToInterface[proci] = nbri;
179 new lduPrimitiveProcessorInterface
193 Pout<<
"Adding interface " << nbri
194 <<
" to send my " << mySendCells[proci].size()
195 <<
" to " << proci <<
endl;
200 new lduPrimitiveProcessorInterface
217 Pout<<
"Adding interface " << nbri
218 <<
" to receive my " << procOwner[proci].size()
219 <<
" from " << proci <<
endl;
221 procToInterface[proci] = nbri;
225 new lduPrimitiveProcessorInterface
239 Pout<<
"Adding interface " << nbri
240 <<
" to send my " << mySendCells[proci].size()
241 <<
" to " << proci <<
endl;
246 new lduPrimitiveProcessorInterface
273 UPtrList<const labelUList> patchAddr;
285 patchAddr.set(patchi, &fvp[patchi].faceCells());
290 label patchi = fvp.size()+i;
291 const lduPrimitiveProcessorInterface&
pp =
300 patchAddr.set(patchi, &
pp.faceCells());
307 lduPrimitiveMesh::nonBlockingSchedule<processorLduInterface>
315 new fvMeshPrimitiveLduAddressing
318 std::move(lowerAddr),
319 std::move(upperAddr),
329 const lduAddressing& addr =
lduPtr_();
331 Pout<<
"Adapted addressing:" 332 <<
" lower:" << addr.lowerAddr().size()
333 <<
" upper:" << addr.upperAddr().size() <<
endl;
338 Pout<<
" " << patchi <<
"\tpatchAddr:" 339 << addr.patchAddr(patchi).size()
345 Pout<<
"Adapted interFaces:" << iFaces.size() <<
endl;
348 if (iFaces.set(patchi))
350 Pout<<
" " << patchi <<
"\tinterface:" 351 << iFaces[patchi].type() <<
endl;
370 const labelList& own = mesh_.faceOwner();
371 const labelList& nei = mesh_.faceNeighbour();
372 const cell& cFaces = mesh_.cells()[celli];
376 for (
const label facei : cFaces)
378 if (mesh_.isInternalFace(facei))
380 label nbrCelli = (own[facei] == celli ? nei[facei] : own[facei]);
381 if (norm[nbrCelli] == -GREAT)
389 avg += norm[nbrCelli];
395 if (nbrNorm[facei-mesh_.nInternalFaces()] == -GREAT)
401 avg += nbrNorm[facei-mesh_.nInternalFaces()];
420 const GAMGAgglomeration& agglom
433 mesh_.time().timeName(),
445 fld[celli] = cellToCoarse[celli];
451 oversetFvPatchField<scalar>
452 >(scalarAgglomeration.boundaryFieldRef(),
false);
453 scalarAgglomeration.
write();
455 Info<<
"Writing initial cell distribution to " 456 << mesh_.time().timeName() <<
endl;
460 for (label level = 0; level < agglom.size(); level++)
462 const labelList& addr = agglom.restrictAddressing(level);
463 label coarseSize =
max(addr)+1;
466 <<
" current size : " 468 <<
" agglomerated size : " 473 const labelList& cellLabels = coarseToCell[fineI];
476 cellToCoarse[cellLabels[i]] = addr[fineI];
488 mesh_.time().timeName(),
500 fld[celli] = cellToCoarse[celli];
509 oversetFvPatchField<scalar>
510 >(scalarAgglomeration.boundaryFieldRef(),
false);
511 scalarAgglomeration.
write();
519 Foam::oversetFvMeshBase::oversetFvMeshBase(
const fvMesh&
mesh,
bool doInit)
542 return mesh_.fvMesh::lduAddr();
557 return mesh_.fvMesh::interfaces();
564 return allInterfaces_;
609 mesh_.schemesDict().findDict(
"oversetInterpolationSuppressed")
613 suppressed.insert(dictPtr->toc());
629 const bool writeOnProc
644 mesh_.time().timeName(),
655 forAll(volTypes.internalField(), cellI)
659 volTypes.correctBoundaryConditions();
660 volTypes.writeObject(streamOpt, writeOnProc);
668 mesh_.time().timeName(),
684 volZoneID[cellI] = zoneID[cellI];
686 volZoneID.correctBoundaryConditions();
687 volZoneID.writeObject(streamOpt, writeOnProc);
708 mesh_.time().timeName(),
720 forAll(cellStencil, cellI)
722 const labelList& stencil = cellStencil[cellI];
725 volDonorZoneID[cellI] = donorZoneID[stencil[0]];
726 for (label i = 1; i < stencil.size(); i++)
728 if (donorZoneID[stencil[i]] != volDonorZoneID[cellI])
731 << cellI <<
" at " << mesh_.C()[cellI]
732 <<
" donors:" << UIndirectList<point>(cc, stencil)
734 volDonorZoneID[cellI] = -2;
744 oversetFvPatchField<scalar>
749 ok = volDonorZoneID.
writeObject(streamOpt, writeOnProc);
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
void size(const label n)
Older name for setAddressableSize.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void append(const T &val)
Append an element at the end of the list.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute List data using default commsType, default flip/negate operator.
static const cellCellStencilObject & New(const fvMesh &mesh, Args &&... args)
Get existing or create MeshObject registered with typeName.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
cellMask correctBoundaryConditions()
Ostream & endl(Ostream &os)
Add newline and flush stream.
const fvMeshPrimitiveLduAddressing & primitiveLduAddr() const
Return extended ldu addressing.
lduInterfacePtrsList allInterfaces_
Interfaces for above mesh. Contains both original and above added processorLduInterfaces.
static int & msgType() noexcept
Message tag of standard messages.
interfaceProperties interface(alpha1, U, thermo->transportPropertiesDict())
List< lduScheduleEntry > lduSchedule
A List of lduSchedule entries.
A simple container for options an IOstream can normally have.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
GeometricField< vector, fvPatchField, volMesh > volVectorField
static void interpolate(Field< T > &psi, const fvMesh &mesh, const cellCellStencil &overlap, const List< scalarList > &wghts)
Interpolation of acceptor cells from donor cells.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
List< labelList > labelListList
List of labelList.
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
GeometricField< sphericalTensor, fvPatchField, volMesh > volSphericalTensorField
labelList reverseFaceMap_
From old to new face labels.
labelListList stencilFaces_
Corresponding faces (in above lduPtr) to the stencil.
Macros for easy insertion into run-time selection tables.
virtual const labelUList & cellTypes() const
Return the cell type list.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
static labelList addAddressing(const lduAddressing &addr, const labelListList &nbrCells, label &nExtraFaces, labelList &lower, labelList &upper, labelListList &nbrCellFaces, const globalIndex &, const labelList &globalCellIDs, labelListList &localFaceCells, labelListList &remoteFaceCells)
Given additional addressing (in the form of additional neighbour cells, i.e. like cellCells) ...
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
vectorField pointField
pointField is a vectorField.
IOList< label > labelIOList
IO for a List of label.
void setSize(const label n)
Alias for resize()
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
label size() const noexcept
Return number of equations.
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
virtual const labelListList & cellStencil() const
Per interpolated cell the neighbour cells (in terms of slots as.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const cellCellStencilObject & overlap
UPtrList< const lduInterface > lduInterfacePtrsList
Store lists of lduInterface as a UPtrList.
scalar cellAverage(const labelList &types, const labelList &nbrTypes, const scalarField &norm, const scalarField &nbrNorm, const label celli, bitSet &isFront) const
Average norm of valid neighbours.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
errorManip< error > abort(error &err)
const labelList & cellTypes
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
void setSize(const label newLen)
Same as resize()
virtual bool interpolateFields()
Update fields when mesh is updated.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
Support for overset functionality.
virtual bool update()
Update the mesh for both mesh motion and topology change.
autoPtr< fvMeshPrimitiveLduAddressing > lduPtr_
Extended addressing (extended with local interpolation stencils)
labelListList stencilPatches_
Corresponding patches (in above lduPtr) to the stencil.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual const lduAddressing & lduAddr() const
Return ldu addressing. If active: is (extended)
virtual lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label nCells() const noexcept
Number of mesh cells.
virtual const mapDistribute & cellInterpolationMap() const
Return a communication schedule.
const polyBoundaryMesh & patches
PtrList< const lduPrimitiveProcessorInterface > remoteStencilInterfaces_
Added (processor)lduInterfaces for remote bits of stencil.
virtual lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
void writeAgglomeration(const GAMGAgglomeration &agglom) const
Debug: dump agglomeration.
static void correctBoundaryConditions(GeoField &psi)
Version of correctBoundaryConditions that excludes 'overset' bcs.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
List< label > labelList
A List of labels.
virtual ~oversetFvMeshBase()
Destructor.
void setSize(const label n)
Alias for resize()
static const labelIOList & zoneID(const fvMesh &)
Helper: get reference to registered zoneID. Loads volScalarField.
virtual bool updateAddressing() const
Calculate the extended lduAddressing.
Defines the attributes of an object for which implicit objectRegistry management is supported...
virtual const wordHashSet & nonInterpolatedFields() const
Return the names of any (stencil or mesh specific) fields that.
const fvMesh & mesh_
Reference to mesh.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Do not request registration (bool: false)
Variant of fvMeshLduAddressing that contains addressing instead of slices.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
static constexpr const zero Zero
Global zero (0)