Go to the documentation of this file.
47 "correctedCellVolumeWeight"
63 const bool secondOrder
76 const bool secondOrder
89 const bool secondOrder
102 const bool secondOrder
115 const bool secondOrder
128 const bool secondOrder
141 const bool secondOrder
154 const bool secondOrder
167 const bool secondOrder
180 const bool secondOrder
193 const bool secondOrder
206 const bool secondOrder
353 Pout<<
"participating source mesh cells: " <<
cells.size() <<
endl;
362 const word& descriptor,
389 const word& methodName,
418 methodPtr->writeConnectivity(src, tgt, srcToTgtCellAddr_);
427 << methodName <<
endl;
457 newTgtFaceNeighbours,
501 Pout<<
"Created newTgt mesh:" <<
nl
503 <<
", new cells = " << newTgt.
nCells() <<
nl
505 <<
", new faces = " << newTgt.
nFaces() <<
endl;
509 Pout<<
"Writing newTgt mesh: " << newTgt.
name() <<
endl;
522 addressing[addrI] = newTgtCellIDs[addressing[addrI]];
532 addressing[addrI] = globalSrcCells.
toGlobal(addressing[addrI]);
635 case imCellVolumeWeight:
636 case imCorrectedCellVolumeWeight:
644 <<
"Unhandled enumeration " << method
655 if (!patchAMIs_.empty())
658 <<
"patch AMI already calculated"
662 patchAMIs_.setSize(srcPatchID_.size());
666 label srcPatchI = srcPatchID_[i];
667 label tgtPatchI = tgtPatchID_[i];
672 Info<<
"Creating AMI between source patch " << srcPP.
name()
673 <<
" and target patch " << tgtPP.
name()
674 <<
" using " << AMIMethodName
701 const word& methodName,
702 const word& AMIMethodName,
703 const bool interpAllPatches
706 if (interpAllPatches)
724 tgtPatchID.
append(tgtPatchI);
729 <<
"Source patch " << pp.
name()
730 <<
" not found in target mesh. "
731 <<
"Available target patches are " << tgtBM.
names()
737 srcPatchID_.transfer(srcPatchID);
738 tgtPatchID_.transfer(tgtPatchID);
742 calculate(methodName);
745 calculatePatchAMIs(AMIMethodName);
751 const word& methodName,
752 const word& AMIMethodName,
762 const word& tgtPatchName = iter.key();
763 const word& srcPatchName = iter();
776 srcPatchID_.transfer(srcIDs);
777 tgtPatchID_.transfer(tgtIDs);
780 calculate(methodName);
783 calculatePatchAMIs(AMIMethodName);
786 cuttingPatches_.setSize(cuttingPatches.
size());
787 forAll(cuttingPatches_, i)
789 const word& patchName = cuttingPatches[i];
790 cuttingPatches_[i] = tgtRegion_.boundaryMesh().findPatchID(patchName);
802 bool interpAllPatches
822 constructNoCuttingPatches
824 interpolationMethodNames_[method],
827 interpolationMethodAMI(method)
838 const word& methodName,
839 const word& AMIMethodName,
840 bool interpAllPatches
860 constructNoCuttingPatches(methodName, AMIMethodName, interpAllPatches);
888 constructFromCuttingPatches
890 interpolationMethodNames_[method],
893 interpolationMethodAMI(method)
905 const word& methodName,
906 const word& AMIMethodName,
926 constructFromCuttingPatches
interpolationMethod
Enumeration specifying interpolation method.
const labelListList & subMap() const
From subsetted data back to original data.
virtual const pointField & points() const
Return raw points.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
List< scalar > scalarList
A List of scalars.
static word interpolationMethodToWord(const interpolationMethod &method)
Convert interpolationMethod to word representation.
volScalarField w(IOobject("w", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE), mesh, dimensionedScalar("w", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0))
label singleMeshProc_
Index of processor that holds all of both sides. -1 in all other.
label findPatchID(const word &patchName) const
Find patch index given a name.
A class for handling words, derived from string.
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
meshToMesh(const meshToMesh &)
Disallow default bitwise copy construct.
List< label > labelList
A List of labels.
const point & max() const
Maximum describing the bounding box.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
#define forAll(list, i)
Loop across all elements in list.
void distributeAndMergeCells(const mapDistribute &map, const polyMesh &tgt, const globalIndex &globalI, pointField &tgtPoints, faceList &tgtFaces, labelList &tgtFaceOwners, labelList &tgtFaceNeighbours, labelList &tgtCellIDs) const
Collect pieces of tgt mesh from other procssors and restructure.
void calculatePatchAMIs(const word &amiMethodName)
Calculate patch overlap.
static void distribute(const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &, const negateOp &negOp, const int tag=UPstream::msgType())
Distribute data. Note:schedule only used for Pstream::scheduled.
void mapAndOpSrcToTgt(const AMIPatchToPatchInterpolation &AMI, const Field< Type > &srcField, Field< Type > &tgtField, const CombineOp &cop) const
Helper function to interpolate patch field. Template.
Plus op for FixedList<scalar>
const labelList & tetBasePtIs() const
Return the tetBasePtIs.
void constructNoCuttingPatches(const word &methodName, const word &AMIMethodName, const bool interpAllPatches)
Constructor helper.
void inflate(const scalar s)
Inflate box by factor*mag(span) in all dimensions.
const Time & time() const
Return time.
Class containing functor to negate primitives. Dummy for all other types.
const cellList & cells() const
virtual bool write() const
Write using setting from DB.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual ~meshToMesh()
Destructor.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
label calcDistribution(const polyMesh &src, const polyMesh &tgt) const
Determine whether the meshes are split across multiple pocessors.
scalarListList tgtToSrcCellWght_
Target to source cell interpolation weights.
Mesh consisting of general polyhedral cells.
wordList names() const
Return a list of patch names.
scalarListList srcToTgtCellWght_
Source to target cell interplation weights.
const polyMesh & srcRegion_
Reference to the source mesh.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
autoPtr< mapDistribute > calcProcMap(const polyMesh &src, const polyMesh &tgt) const
Calculate the mapping between processors.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
static const NamedEnum< interpolationMethod, 4 > interpolationMethodNames_
labelList maskCells(const polyMesh &src, const polyMesh &tgt) const
Return src cell IDs for the overlap region.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
void mapInternalSrcToTgt(const GeometricField< Type, fvPatchField, volMesh > &field, const CombineOp &cop, GeometricField< Type, fvPatchField, volMesh > &result, const bool secondOrder) const
Helper function to interpolate internal field. Optionally uses.
bool overlaps(const boundBox &) const
Overlaps/touches boundingBox?
A patch is a list of labels that address the faces in the global face list.
labelListList tgtToSrcCellAddr_
Target to source cell addressing.
Class containing processor-to-processor mapping information.
InternalField & internalField()
Return internal field.
void calcAddressing(const word &methodName, const polyMesh &src, const polyMesh &tgt)
Calculate the addressing between overlapping regions of src and tgt.
const word & name() const
Return name.
const point & min() const
Minimum describing the bounding box.
static bool constraintType(const word &pt)
Return true if the given type is a constraint type.
autoPtr< mapDistribute > tgtMapPtr_
Target map pointer - parallel running only.
label size() const
Return number of elements in table.
label nInternalFaces() const
void constructFromCuttingPatches(const word &methodName, const word &AMIMethodName, const HashTable< word > &patchMap, const wordList &cuttingPatches)
Constructor helper.
scalar V_
Cell total volume in overlap region [m3].
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
errorManip< error > abort(error &err)
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const polyMesh & tgtRegion_
Reference to the target mesh.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
labelListList srcToTgtCellAddr_
Source to target cell addressing.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
An STL-conforming hash table.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const boundBox & bounds() const
Return mesh bounding box.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
void calculate(const word &methodName)
Calculate - main driver function.
prefixOSstream Pout(cout, "Pout")
interpolationMethod
Enumeration specifying interpolation method.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
void addPatches(const List< polyPatch * > &, const bool validBoundary=true)
Add boundary patches.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
static AMIPatchToPatchInterpolation::interpolationMethod interpolationMethodAMI(const interpolationMethod method)
Conversion between mesh and patch interpolation methods.
label size() const
Return the number of elements in the PtrList.
autoPtr< mapDistribute > srcMapPtr_
Source map pointer - parallel running only.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
static const word null
An empty word.
A bounding box defined in terms of the points at its extremities.
void size(const label)
Override size to be inconsistent with allocated storage.
void mapAndOpTgtToSrc(const AMIPatchToPatchInterpolation &AMI, Field< Type > &srcField, const Field< Type > &tgtField, const CombineOp &cop) const
Helper function to interpolate patch field. Template.
Generic GeometricField class.
const labelListList & constructMap() const
From subsetted data to new reconstructed data.
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const word & name() const
Return name.
void normaliseWeights(const word &descriptor, const labelListList &addr, scalarListList &wght) const
Normalise the interpolation weights.
label index() const
Return the index of this patch in the boundaryMesh.
word name(const complex &)
Return a string representation of a complex.
Initialise the NamedEnum HashTable from the static list of names.
void mapInternalTgtToSrc(const GeometricField< Type, fvPatchField, volMesh > &field, const CombineOp &cop, GeometricField< Type, fvPatchField, volMesh > &result, const bool secondOrder) const
Helper function to interpolate internal field. Optionally uses.
label toGlobal(const label i) const
From local to global.