53 nbrPatch().meshPoints()
58 const Time& t = boundaryMesh().mesh().
time();
64 transform().transformPosition(nbrPoints, nbrPoints);
78 const Time& t = boundaryMesh().mesh().
time();
99 AMILowWeightCorrection_,
108 Pout<<
"cyclicAMIPolyPatch : " <<
name()
109 <<
" constructed AMI with " <<
nl 110 <<
" " <<
"srcAddress:" << AMIs_[0].srcAddress().size()
112 <<
" " <<
"tgAddress :" << AMIs_[0].tgtAddress().size()
123 AMITransforms_.clear();
134 && !this->boundaryMesh().
mesh().time().processorCase()
145 nbrPatch().faceCentres(),
146 nbrPatch().faceAreas(),
175 AMITransforms_.clear();
198 AMITransforms_.clear();
214 AMITransforms_.clear();
223 nbrPatch().nbrPatchName_ = newNames[index()];
230 if (nbrPatchID_ != -1)
232 nbrPatchID_ =
findIndex(newToOldIndex, nbrPatchID_);
246 const word& patchType,
247 const bool AMIRequireMatch,
258 AMIRequireMatch_(AMIRequireMatch),
259 AMILowWeightCorrection_(-1.0),
260 AMIMethod_(AMIMethod),
275 const word& patchType,
276 const bool AMIRequireMatch,
288 AMIRequireMatch_(AMIRequireMatch),
289 AMILowWeightCorrection_(dict.
lookupOrDefault(
"lowWeightCorrection", -1.0)),
307 ) <<
"No \"neighbourPatch\" or \"coupleGroup\" provided." 311 if (nbrPatchName_ == name)
316 ) <<
"Neighbour patch name " << nbrPatchName_
317 <<
" cannot be the same as this patch " << name
357 const label newStart,
358 const word& nbrPatchName
363 nbrPatchName_(nbrPatchName),
375 if (nbrPatchName_ ==
name())
378 <<
"Neighbour patch name " << nbrPatchName_
379 <<
" cannot be the same as this patch " <<
name()
423 if (nbrPatchID_ == -1)
425 nbrPatchID_ = this->boundaryMesh().findPatchID(nbrPatchName());
427 if (nbrPatchID_ == -1)
430 <<
"Illegal neighbourPatch name " << nbrPatchName()
431 <<
nl <<
"Valid patch names are " 432 << this->boundaryMesh().names()
438 refCast<const cyclicAMIPolyPatch>
440 this->boundaryMesh()[nbrPatchID_]
446 <<
"Patch " <<
name()
447 <<
" specifies neighbour patch " << nbrPatchName()
448 <<
nl <<
" but that in return specifies " 459 return index() < nbrPatchID();
465 const polyPatch& pp = this->boundaryMesh()[nbrPatchID()];
466 return refCast<const cyclicAMIPolyPatch>(pp);
473 const word surfType(surfDict_.lookupOrDefault<
word>(
"type",
"none"));
475 if (!surfPtr_.valid() && owner() && surfType !=
"none")
477 word surfName(surfDict_.lookupOrDefault(
"name", name()));
488 mesh.time().constant(),
508 <<
"AMI interpolators only available to owner patch" 527 <<
"AMI transforms only available to owner patch" 536 return AMITransforms_;
544 return AMILowWeightCorrection_ > 0;
548 return nbrPatch().AMILowWeightCorrection_ > 0;
557 return AMIs()[0].srcWeightsSum();
561 return nbrPatch().AMIs()[0].tgtWeightsSum();
570 return AMIs()[0].tgtWeightsSum();
574 return nbrPatch().AMIs()[0].srcWeightsSum();
596 pow(
inv(AMITransforms()[i]).
T()(cmpt, cmpt), rank);
599 AMIs()[i].interpolateToSource(r*fld, defaultValues);
610 nei.
AMIs()[i].interpolateToTarget(r*fld, defaultValues);
658 point ptt = AMITransforms()[i].transformPosition(pt);
659 const vector ntt = AMITransforms()[i].transform(nt);
661 const label nbrFacei =
662 AMIs()[i].tgtPointFace(*
this, nbrPatch(), ntt, facei, ptt);
673 forAll(nbrPatch().AMIs(), i)
676 nbrPatch().AMITransforms()[i].invTransformPosition(pt);
678 nbrPatch().AMITransforms()[i].invTransform(nt);
680 const label nbrFacei =
681 nbrPatch().AMIs()[i].srcPointFace
706 const label proc = patch.
AMIs()[0].singlePatchProc();
708 for (
label i = 1; i < patch.
AMIs().size(); ++ i)
710 if (patch.
AMIs()[i].singlePatchProc() != proc)
723 if (!nbrPatchName_.empty())
725 writeEntry(os,
"neighbourPatch", nbrPatchName_);
727 coupleGroup_.write(os);
736 if (AMILowWeightCorrection_ > 0)
738 writeEntry(os,
"lowWeightCorrection", AMILowWeightCorrection_);
748 if (!surfDict_.empty())
virtual void clearGeom()
Clear geometry.
static word interpolationMethodToWord(const interpolationMethod &method)
Convert interpolationMethod to word representation.
virtual void resetAMI() const
Reset the AMI interpolator.
virtual void initCalcGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
static bool valid(char)
Is this character valid for a word.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
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.
virtual bool order(PstreamBuffers &, const primitivePatch &, labelList &faceMap, labelList &rotation) const
Return new ordering for primitivePatch.
A class for handling file names.
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
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.
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
T & ref() const
Return non-const reference or generate a fatal error.
Unit conversion functions.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
virtual void reorder(const labelUList &newToOldIndex)
Reset the patch index.
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelPair pointAMIAndFace(const label facei, const vector &n, point &p) const
Return the transform and face indices on neighbour patch which.
bool applyLowWeightCorrection() const
Return true if applying the low weight correction.
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
tmp< Field< Type > > interpolate(const Field< Type > &fld, const UList< Type > &defaultValues=UList< Type >()) const
Interpolate field.
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
virtual void clearGeom()
Clear geometry.
interpolationMethod
Enumeration specifying interpolation method.
virtual void movePoints(PstreamBuffers &, const pointField &p)
Correct patches after moving points.
const bool AMIRequireMatch_
Flag to indicate that patches should match/overlap.
const dictionary surfDict_
Dictionary used during projection surface construction.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
virtual const scalarField & nbrWeightsSum() const
Return the weights sum for the neighbour patch.
const List< transformer > & AMITransforms() const
Return a reference to the AMI transforms.
virtual label nbrPatchID() const
Neighbour patch ID.
virtual const cyclicAMIPolyPatch & nbrPatch() const
Return a reference to the neighbour patch.
const coupleGroupIdentifier coupleGroup_
Optional patchGroup to find nbrPatch.
cyclicAMIPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType, const bool AMIRequireMatch=true, const AMIInterpolation::interpolationMethod AMIMethod=AMIInterpolation::imFaceAreaWeight)
Construct from (base couped patch) components.
A list of faces which address into the list of points.
A List obtained as a section of another List.
const bool AMIReverse_
Flag to indicate that slave patch should be reversed for AMI.
An ordered pair of two objects of type <T> with first() and second() elements.
const AMIInterpolation::interpolationMethod AMIMethod_
AMI Method.
const PtrList< AMIInterpolation > & AMIs() const
Return a reference to the AMI interpolators.
static const word & geometryDir()
Return the geometry directory name.
A class for handling words, derived from string.
const autoPtr< searchableSurface > & surfPtr() const
Return a reference to the projection surface.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const scalar AMILowWeightCorrection_
Low weight correction threshold for AMI.
label singlePatchProc() const
Index of processor that holds all of both sides, or -1 if.
virtual void rename(const wordList &newNames)
Reset the patch name.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
static const word null
An empty word.
virtual void reorder(const labelUList &newToOldIndex)
Reset the patch index.
Pair< label > labelPair
Label pair.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
Cyclic patch for Arbitrary Mesh Interface (AMI)
errorManip< error > abort(error &err)
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...
virtual ~cyclicAMIPolyPatch()
Destructor.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
const Time & time() const
Return time.
defineTypeNameAndDebug(combustionModel, 0)
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
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)
word name(const complex &)
Return a string representation of a complex.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
void setSize(const label)
Reset size of List.
static bool & parRun()
Is this a parallel run?
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
Initialise ordering for primitivePatch. Does not.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
virtual void initCalcGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
const word & nbrPatchName() const
Neighbour patch name.
prefixOSstream Pout(cout, "Pout")
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
virtual bool owner() const
Does this side own the patch?
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
static autoPtr< searchableSurface > New(const word &surfaceType, const IOobject &io, const dictionary &dict)
Return a reference to the selected searchableSurface.
static interpolationMethod wordTointerpolationMethod(const word &method)
Convert word to interpolationMethod.
Mesh consisting of general polyhedral cells.
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
fileName path() const
Return path.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
word nbrPatchName_
Name of cyclic neighbour patch.
virtual void rename(const wordList &newNames)
Reset the patch name.
dictionary subOrEmptyDict(const word &, const bool mustRead=false) const
Find and return a sub-dictionary as a copy, or.
dimensionSet transform(const dimensionSet &)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
virtual void movePoints(PstreamBuffers &pBufs, const pointField &)
Correct patches after moving points.
virtual void initMovePoints(PstreamBuffers &pBufs, const pointField &)
Initialise the patches for moving points.