53 nbrPatch().meshPoints()
64 transform().transformPosition(nbrPoints, nbrPoints);
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();
145 nbrPatch().faceCentres(),
146 nbrPatch().faceAreas(),
175 AMITransforms_.clear();
198 AMITransforms_.clear();
214 AMITransforms_.clear();
229 const word& patchType,
230 const bool AMIRequireMatch,
241 AMIRequireMatch_(AMIRequireMatch),
242 AMILowWeightCorrection_(-1.0),
243 AMIMethod_(AMIMethod),
258 const word& patchType,
259 const bool AMIRequireMatch,
271 AMIRequireMatch_(AMIRequireMatch),
272 AMILowWeightCorrection_(dict.
lookupOrDefault(
"lowWeightCorrection", -1.0)),
290 ) <<
"No \"neighbourPatch\" or \"coupleGroup\" provided." 294 if (nbrPatchName_ == name)
299 ) <<
"Neighbour patch name " << nbrPatchName_
300 <<
" cannot be the same as this patch " << name
340 const label newStart,
341 const word& nbrPatchName
346 nbrPatchName_(nbrPatchName),
358 if (nbrPatchName_ ==
name())
361 <<
"Neighbour patch name " << nbrPatchName_
362 <<
" cannot be the same as this patch " <<
name()
406 if (nbrPatchID_ == -1)
408 nbrPatchID_ = this->
boundaryMesh().findPatchID(nbrPatchName());
410 if (nbrPatchID_ == -1)
413 <<
"Illegal neighbourPatch name " << nbrPatchName()
414 <<
nl <<
"Valid patch names are " 421 refCast<const cyclicAMIPolyPatch>
429 <<
"Patch " <<
name()
430 <<
" specifies neighbour patch " << nbrPatchName()
431 <<
nl <<
" but that in return specifies " 442 return index() < nbrPatchID();
449 return refCast<const cyclicAMIPolyPatch>(pp);
456 const word surfType(surfDict_.lookupOrDefault<
word>(
"type",
"none"));
458 if (!surfPtr_.valid() && owner() && surfType !=
"none")
460 word surfName(surfDict_.lookupOrDefault(
"name", name()));
471 mesh.time().constant(),
491 <<
"AMI interpolators only available to owner patch" 510 <<
"AMI transforms only available to owner patch" 519 return AMITransforms_;
527 return AMILowWeightCorrection_ > 0;
531 return nbrPatch().AMILowWeightCorrection_ > 0;
540 return AMIs()[0].srcWeightsSum();
544 return nbrPatch().AMIs()[0].tgtWeightsSum();
553 return AMIs()[0].tgtWeightsSum();
557 return nbrPatch().AMIs()[0].srcWeightsSum();
579 pow(
inv(AMITransforms()[i]).
T()(cmpt, cmpt), rank);
582 AMIs()[i].interpolateToSource(r*fld, defaultValues);
593 nei.
AMIs()[i].interpolateToTarget(r*fld, defaultValues);
641 point ptt = AMITransforms()[i].transformPosition(pt);
642 const vector ntt = AMITransforms()[i].transform(nt);
644 const label nbrFacei =
645 AMIs()[i].tgtPointFace(*
this, nbrPatch(), ntt, facei, ptt);
656 forAll(nbrPatch().AMIs(), i)
659 nbrPatch().AMITransforms()[i].invTransformPosition(pt);
661 nbrPatch().AMITransforms()[i].invTransform(nt);
663 const label nbrFacei =
664 nbrPatch().AMIs()[i].srcPointFace
689 const label proc = patch.
AMIs()[0].singlePatchProc();
691 for (
label i = 1; i < patch.
AMIs().size(); ++ i)
693 if (patch.
AMIs()[i].singlePatchProc() != proc)
706 if (!nbrPatchName_.empty())
708 writeEntry(os,
"neighbourPatch", nbrPatchName_);
710 coupleGroup_.write(os);
719 if (AMILowWeightCorrection_ > 0)
721 writeEntry(os,
"lowWeightCorrection", AMILowWeightCorrection_);
731 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.
fileName path() const
Return path.
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.
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.
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.
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 updateMesh(PstreamBuffers &)
Update of the patch topology.
static const word null
An empty word.
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)
defineTypeNameAndDebug(combustionModel, 0)
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
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
Initialize 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.
const bMesh & mesh() const
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
word nbrPatchName_
Name of cyclic neighbour patch.
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.