50 #ifndef Foam_cyclicAMIPolyPatch_H 51 #define Foam_cyclicAMIPolyPatch_H 241 const word& patchType,
243 const word& defaultAMIMethod = faceAreaWeightAMI::typeName
253 const word& patchType,
254 const word& defaultAMIMethod = faceAreaWeightAMI::typeName
268 const label newStart,
269 const word& nbrPatchName
315 virtual autoPtr<polyPatch>
clone 323 return autoPtr<polyPatch>
413 virtual bool owner()
const;
506 template<
class Type,
class CombineOp>
510 const CombineOp& cop,
virtual void clearGeom()
Clear geometry.
virtual void resetAMI() const
Reset the AMI interpolator, use current patch points.
vector separationVector_
Translation vector.
virtual refPtr< labelListList > mapCollocatedFaces() const
Return collocated faces map.
const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
virtual label neighbPatchID() const
Neighbour patch ID.
virtual bool order(PstreamBuffers &, const primitivePatch &, labelList &faceMap, labelList &rotation) const
Return new ordering for primitivePatch.
cyclicAMIPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType, const transformType transform=UNKNOWN, const word &defaultAMIMethod=faceAreaWeightAMI::typeName)
Construct from (base coupled patch) components.
autoPtr< coordSystem::cylindrical > cylindricalCS() const
Create a coordinate system from the periodic patch (or nullptr)
friend class polyBoundaryMesh
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
label start() const noexcept
Return start label of this patch in the polyMesh face list.
virtual bool coupled() const
Is patch 'coupled'. Note that on AMI the geometry is not coupled but the fields are! ...
bool moveFaceCentres_
Move face centres (default = no)
virtual bool addAMIFaces(polyTopoChange &topoChange)
Collect faces to add in the topoChange container.
A range or interval of labels defined by a start and a size.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
static const scalar tolerance_
Tolerance used e.g. for area calculations/limits.
virtual void calcTransforms()
Recalculate the transformation tensors.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
virtual void transformPosition(pointField &) const
Transform patch-based positions from nbr side to this side.
bool applyLowWeightCorrection() const
Return true if applying the low weight correction.
vectorField & faceCentres0() const
Return access to the initial face centres.
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
vector rotationAxis_
Axis of rotation for rotational cyclics.
bool rotationAngleDefined_
Flag to show whether the rotation angle is defined.
label periodicPatchID_
Periodic patch.
virtual void reverseTransformDirection(vector &d, const label facei) const
Transform a patch-based direction from this side to nbr side.
tmp< Field< Type > > interpolate(const Field< Type > &fld, const UList< Type > &defaultValues=UList< Type >()) const
Interpolate field.
List< labelList > labelListList
List of labelList.
virtual bool setTopology(polyTopoChange &topoChange)
Set topology changes in the polyTopoChange object.
scalar fraction() const
Particle fraction increase between AMI pathces.
A class for managing references or pointers (no reference counting)
UList< label > labelUList
A UList of labels.
virtual void newInternalProcFaces(label &, label &) const
Return number of new internal of this polyPatch faces.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
bool createAMIFaces_
Flag to indicate that new AMI faces will created.
void initInterpolate(const Field< Type > &fld, labelRange &sendRequests, PtrList< List< Type >> &sendBuffers, labelRange &recvRequests, PtrList< List< Type >> &recvBuffers) const
const dictionary surfDict_
Dictionary used during projection surface construction.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
label nbrPatchID_
Index of other half.
virtual void setAMIFaces()
Set properties of newly inserted faces after topological changes.
vectorField faceAreas0_
Temporary storage for AMI face areas.
const vector & separationVector() const
Translation vector for translational cyclic AMI.
const coupleGroupIdentifier coupleGroup_
Optional patchGroup to find neighbPatch.
virtual ~cyclicAMIPolyPatch()=default
Destructor.
A list of faces which address into the list of points.
const vector & rotationAxis() const
Axis of rotation for rotational cyclic AMI.
const scalar fraction_
Particle displacement fraction accross AMI.
const word & neighbPatchName() const
Neighbour patch name.
const point & rotationCentre() const
Point on axis of rotation for rotational cyclic AMI.
const labelUList & faceCells() const
Return face-cell addressing.
bool updatingAMI() const
Return access to the updated flag.
A class for handling words, derived from Foam::string.
const autoPtr< searchableSurface > & surfPtr() const
Create and return pointer to the projection surface.
autoPtr< AMIPatchToPatchInterpolation > AMIPtr_
AMI interpolation class.
point rotationCentre_
Point on axis of rotation for rotational cyclics.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
bool createAMIFaces() const
Return access to the createAMIFaces flag.
word periodicPatchName_
Periodic patch name.
Cyclic patch for Arbitrary Mesh Interface (AMI)
const Field< point_type > & points() const noexcept
Return reference to global points.
label periodicPatchID() const
Periodic patch ID (or -1)
bool canResetAMI() const
Flag to indicate whether the AMI can be reset.
void initInterpolateUntransformed(const Field< Type > &fld, labelRange &sendRequests, PtrList< List< Type >> &sendBuffers, labelRange &recvRequests, PtrList< List< Type >> &recvBuffers) const
vectorField & faceAreas0() const
Return access to the initial face areas.
virtual const labelUList & nbrCells() const
Return nbrCells.
const scalarField & weightsSum() const
Helper function to return the weights sum.
Encapsulates using "patchGroups" to specify coupled patch.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
vectorField faceCentres0_
Temporary storage for AMI face centres.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
const word & name() const noexcept
The patch name.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Buffers for inter-processor communications streams (UOPstream, UIPstream).
virtual void restoreScaledGeometry()
Helper to re-apply the geometric scaling lost during mesh updates.
labelListList srcFaceIDs_
virtual bool removeAMIFaces(polyTopoChange &topoChange)
Collect faces to remove in the topoChange container.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
tmp< Field< Type > > interpolateUntransformed(const Field< Type > &fld, const UList< Type > &defaultValues) const
Interpolate without periodic.
TypeName("cyclicAMI")
Runtime type information.
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
Initialize ordering for primitivePatch. Does not refer to *this (except for name() and type() etc...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
virtual const cyclicAMIPolyPatch & neighbPatch() const
Return a reference to the neighbour patch.
virtual bool owner() const
Does this side own the patch?
Direct mesh changes based on v1.3 polyTopoChange syntax.
labelListList tgtFaceIDs_
virtual bool changeTopology() const
Return true if this patch changes the mesh topology.
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
virtual transformType transform() const
Type of transform.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
label index() const noexcept
The index of this patch in the boundaryMesh.
A class for managing temporary objects.
const labelListList & srcAddress() const
Return const access to source patch addressing.
word nbrPatchName_
Name of other half.
virtual bool masterImplicit() const
Return implicit master.
virtual label neighbPolyPatchID() const
Return nbr patch ID.
virtual void reverseTransformPosition(point &l, const label facei) const
Transform a patch-based position from this side to nbr side.
scalar rotationAngle_
Rotation angle.
label pointFace(const label facei, const vector &n, point &p) const
Return face index on neighbour patch which shares point p following trajectory vector n...
const scalarListList & weights() const
Helper function to return the weights.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
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.
autoPtr< searchableSurface > surfPtr_
Projection surface.
const vectorField::subField faceCentres() const
Return face centres.