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();
195 AMITransforms_.clear();
211 AMITransforms_.clear();
220 nbrPatch().nbrPatchName_ = newNames[index()];
227 if (nbrPatchID_ != -1)
229 nbrPatchID_ =
findIndex(newToOldIndex, nbrPatchID_);
243 const word& patchType,
244 const bool AMIRequireMatch,
245 const word& AMIMethod
255 AMIRequireMatch_(AMIRequireMatch),
256 AMILowWeightCorrection_(-1.0),
257 AMIMethod_(AMIMethod),
272 const word& patchType,
273 const bool AMIRequireMatch,
274 const word& AMIMethod
285 AMIRequireMatch_(AMIRequireMatch),
286 AMILowWeightCorrection_(dict.
lookupOrDefault(
"lowWeightCorrection", -1.0)),
296 ) <<
"No \"neighbourPatch\" or \"coupleGroup\" provided." 300 if (nbrPatchName_ == name)
305 ) <<
"Neighbour patch name " << nbrPatchName_
306 <<
" cannot be the same as this patch " << name
346 const label newStart,
347 const word& nbrPatchName
352 nbrPatchName_(nbrPatchName),
364 if (nbrPatchName_ ==
name())
367 <<
"Neighbour patch name " << nbrPatchName_
368 <<
" cannot be the same as this patch " <<
name()
412 if (nbrPatchID_ == -1)
414 nbrPatchID_ = this->boundaryMesh().findPatchID(nbrPatchName());
416 if (nbrPatchID_ == -1)
419 <<
"Illegal neighbourPatch name " << nbrPatchName()
420 <<
nl <<
"Valid patch names are " 421 << this->boundaryMesh().names()
427 refCast<const cyclicAMIPolyPatch>
429 this->boundaryMesh()[nbrPatchID_]
435 <<
"Patch " <<
name()
436 <<
" specifies neighbour patch " << nbrPatchName()
437 <<
nl <<
" but that in return specifies " 448 return index() < nbrPatchID();
454 const polyPatch& pp = this->boundaryMesh()[nbrPatchID()];
455 return refCast<const cyclicAMIPolyPatch>(pp);
462 const word surfType(surfDict_.lookupOrDefault<
word>(
"type",
"none"));
464 if (!surfPtr_.valid() && owner() && surfType !=
"none")
466 word surfName(surfDict_.lookupOrDefault(
"name", name()));
477 mesh.time().constant(),
497 <<
"AMI interpolators only available to owner patch" 516 <<
"AMI transforms only available to owner patch" 525 return AMITransforms_;
533 return AMILowWeightCorrection_ > 0;
537 return nbrPatch().AMILowWeightCorrection_ > 0;
546 return AMIs()[0].srcWeightsSum();
550 return nbrPatch().AMIs()[0].tgtWeightsSum();
559 return AMIs()[0].tgtWeightsSum();
563 return nbrPatch().AMIs()[0].srcWeightsSum();
585 pow(
inv(AMITransforms()[i]).
T()(cmpt, cmpt), rank);
588 AMIs()[i].interpolateToSource(r*fld, defaultValues);
599 nei.
AMIs()[i].interpolateToTarget(r*fld, defaultValues);
647 point ptt = AMITransforms()[i].transformPosition(pt);
648 const vector ntt = AMITransforms()[i].transform(nt);
650 const label nbrFacei =
651 AMIs()[i].tgtPointFace(*
this, nbrPatch(), ntt, facei, ptt);
662 forAll(nbrPatch().AMIs(), i)
665 nbrPatch().AMITransforms()[i].invTransformPosition(pt);
667 nbrPatch().AMITransforms()[i].invTransform(nt);
669 const label nbrFacei =
670 nbrPatch().AMIs()[i].srcPointFace
695 const label proc = patch.
AMIs()[0].singlePatchProc();
697 for (
label i = 1; i < patch.
AMIs().size(); ++ i)
699 if (patch.
AMIs()[i].singlePatchProc() != proc)
712 if (!nbrPatchName_.empty())
714 writeEntry(os,
"neighbourPatch", nbrPatchName_);
716 coupleGroup_.write(os);
725 if (AMILowWeightCorrection_ > 0)
727 writeEntry(os,
"lowWeightCorrection", AMILowWeightCorrection_);
737 if (!surfDict_.empty())
virtual void clearGeom()
Clear geometry.
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.
#define forAll(list, i)
Loop across all elements in list.
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)
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.
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 initTopoChange(PstreamBuffers &)
Initialise the update of the patch topology.
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...
virtual void topoChange(PstreamBuffers &)
Update of the patch topology.
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.
virtual void initTopoChange(PstreamBuffers &)
Initialise the update of the patch topology.
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.
const word AMIMethod_
AMI Method.
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.
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 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.
static const word null
An empty word.
virtual void reorder(const labelUList &newToOldIndex)
Reset the patch index.
Pair< label > labelPair
Label pair.
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.
virtual void topoChange(PstreamBuffers &)
Update of the patch topology.
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 movePoints(const pointField &p)
Correct patches after moving points.
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.
cyclicAMIPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType, const bool AMIRequireMatch=true, const word &AMIMethod=faceAreaWeightAMI::typeName)
Construct from (base couped patch) components.
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 &)
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.