84 Info<<
indent << typeName <<
" : Creating addressing and weights between " 94 if (transformPatch.
name() != nbrPatch().transformPatch().name())
97 <<
"Transform patch " << transformPatch.
name() <<
" for " 98 << typeName <<
" patch " <<
name() <<
" is not the same as for " 99 <<
"the neighbour patch " << nbrPatch().name() <<
". " 105 transformPatch.size(),
114 <<
"Transform patch " << transformPatch.
name() <<
" for " 115 << typeName <<
" patch " <<
name() <<
" has zero faces. It may " 116 <<
"have been converted to a processor cyclic during " 117 <<
"decomposition. Consider adding " << transformPatch.
name()
118 <<
" and it's neighbour to the list of preserved patches." 130 const scalarField thisMagAreas(this->magFaceAreas());
131 const scalarField nbrMagAreas(nbrPatch().magFaceAreas());
134 gSum(this->faceCentres()*thisMagAreas)/
gSum(thisMagAreas);
136 gSum(nbrPatch().faceCentres()*nbrMagAreas)/
gSum(nbrMagAreas);
139 scalar d =
mag(thisCentre - nbrCentre);
169 for (
label i = 0; i < n - 1; ++ i)
180 for (
label i = 0; i > n + 1; -- i)
192 const pointField nbrPoints(nbrPatch().localPoints());
202 SubList<face>(this->nbrPatch().localFaces(), this->nbrPatch().size()),
207 thisPoints = TLeft.transformPosition(localPoints());
218 AMILowWeightCorrection_,
224 gSum(AMILeftPtr->srcWeightsSum()*AMILeftPtr->srcMagSf())
225 /
gSum(AMILeftPtr->srcMagSf());
227 thisPoints =
T.transformPosition(localPoints());
238 AMILowWeightCorrection_,
244 gSum(AMIPtr->srcWeightsSum()*AMIPtr->srcMagSf())
245 /
gSum(AMIPtr->srcMagSf());
258 AMILowWeightCorrection_,
263 const scalar sRight =
264 gSum(AMIRightPtr->srcWeightsSum()*AMIRightPtr->srcMagSf())
265 /
gSum(AMIRightPtr->srcMagSf());
267 Info<< typeName <<
": number of transforms = " << n << endl
268 << typeName <<
": left/centre/right sum(weights) = " 269 << sLeft <<
", " << s <<
", " << sRight <<
endl;
274 AMIs_.set(0, sLeft > sRight ? AMILeftPtr.
ptr() : AMIPtr.
ptr());
275 AMIs_.set(1, sLeft > sRight ? AMIPtr.
ptr() : AMIRightPtr.
ptr());
277 AMITransforms_.resize(2);
278 AMITransforms_[0] = sLeft > sRight ? TLeft :
T;
279 AMITransforms_[1] = sLeft > sRight ?
T : TRight;
282 AMIInterpolation::sumWeights(AMIs_);
283 AMIInterpolation::reportSumWeights(AMIs_[0]);
284 AMIInterpolation::normaliseWeights(AMIs_);
312 const word& patchType
327 transformPatchID_(-1)
340 const word& patchType
353 transformPatchName_(dict.
lookup(
"transformPatch")),
354 transformPatchID_(-1)
369 transformPatchID_(-1)
382 const label newStart,
383 const word& nbrPatchName
388 transformPatchID_(-1)
406 transformPatchID_(-1)
426 return refCast<const cyclicRepeatAMIPolyPatch>(pp);
432 if (transformPatchID_ == -1)
437 if (transformPatchID_ == -1)
440 <<
"Illegal transformPatch name " << transformPatchName()
441 <<
nl <<
"Valid patch names are " 447 return transformPatchID_;
456 return refCast<const coupledPolyPatch>(pp);
482 writeEntry(os,
"transformPatch", transformPatchName_);
virtual void resetAMI() const
Reset the AMI interpolator.
virtual ~cyclicRepeatAMIPolyPatch()
Destructor.
virtual void movePoints(const Field< PointType > &)
Correct patch after moving points.
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 word & name() const
Return name.
Ostream & indent(Ostream &os)
Indent stream.
virtual const scalarField & weightsSum() const
Return the weights sum for this patch.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 2-tuple for storing two objects of different types.
const Type1 & first() const
Return first.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual const scalarField & nbrWeightsSum() const
Return the weights sum for the neighbour patch.
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
T * ptr()
Return object pointer for reuse.
virtual const transformer & transform() const =0
Return transformation between the coupled patches.
Macros for easy insertion into run-time selection tables.
virtual const scalarField & nbrWeightsSum() const
Return the weights sum for the neighbour patch.
virtual label transformPatchID() const
Neighbour patch ID.
A list of faces which address into the list of points.
Repeat patch for Arbitrary Mesh Interface (AMI)
A List obtained as a section of another List.
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))
Type gSum(const FieldField< Field, Type > &f)
virtual const cyclicRepeatAMIPolyPatch & nbrPatch() const
Return a reference to the neighbour patch.
A class for handling words, derived from string.
static const word null
An empty word.
word transformPatchName_
Name of the transform patch.
Cyclic patch for Arbitrary Mesh Interface (AMI)
virtual const scalarField & weightsSum() const
Return the weights sum for this patch.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
defineTypeNameAndDebug(combustionModel, 0)
Buffers for inter-processor communications streams (UOPstream, UIPstream).
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
word name(const complex &)
Return a string representation of a complex.
cyclicRepeatAMIPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from (base couped patch) components.
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
dimensioned< scalar > mag(const dimensioned< Type > &)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A patch is a list of labels that address the faces in the global face list.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
virtual const coupledPolyPatch & transformPatch() const
Return a reference to the transform patch.