50#ifndef Foam_cyclicAMIPolyPatch_H
51#define Foam_cyclicAMIPolyPatch_H
244 const word& patchType,
246 const word& defaultAMIMethod = faceAreaWeightAMI::typeName
256 const word& patchType,
257 const word& defaultAMIMethod = faceAreaWeightAMI::typeName
271 const label newStart,
272 const word& nbrPatchName
416 virtual bool owner()
const;
509 template<
class Type,
class CombineOp>
513 const CombineOp& cop,
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const labelListList & srcAddress() const
Return const access to source patch addressing.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const Field< point_type > & points() const noexcept
Buffers for inter-processor communications streams (UOPstream, UIPstream).
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
static autoPtr< T > NewFrom(Args &&... args)
Construct autoPtr from derived type with forwarding arguments.
Encapsulates using "patchGroups" to specify coupled patch.
virtual transformType transform() const
Type of transform.
coupledPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType, const transformType transform)
Construct from components.
Cyclic patch for Arbitrary Mesh Interface (AMI).
scalar rotationAngle_
Rotation angle.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
vectorField & faceAreas0() const
Return access to the initial face areas.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
vector separationVector_
Translation vector.
word nbrPatchName_
Name of other half.
autoPtr< coordSystem::cylindrical > cylindricalCS() const
Create a coordinate system from the periodic patch (or nullptr).
virtual void resetAMI() const
Reset the AMI interpolator, use current patch points.
bool createAMIFaces_
Flag to indicate that new AMI faces will created.
virtual void initMovePoints(PstreamBuffers &pBufs, const pointField &)
Initialise the patches for moving points.
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 scalarField & weightsSum() const
Helper function to return the weights sum.
const word & neighbPatchName() const
Neighbour patch name.
const scalarListList & weights() const
Helper function to return the weights.
virtual bool owner() const
Does this side own the patch?
autoPtr< searchableSurface > surfPtr_
Projection surface.
virtual bool addAMIFaces(polyTopoChange &topoChange)
Collect faces to add in the topoChange container.
const scalar fraction_
Particle displacement fraction across AMI.
virtual label neighbPolyPatchID() const
Return nbr patch ID.
bool canResetAMI() const
Flag to indicate whether the AMI can be reset.
vectorField faceCentres0_
Temporary storage for AMI face centres.
virtual bool coupled() const
Is patch 'coupled'. Note that on AMI the geometry is not coupled but the fields are!
const vector & separationVector() const
Translation vector for translational cyclic AMI.
virtual bool masterImplicit() const
Return implicit master.
virtual void restoreScaledGeometry()
Helper to re-apply the geometric scaling lost during mesh updates.
label periodicPatchID_
Periodic patch.
virtual void clearGeom()
Clear geometry.
scalar fraction() const
Particle fraction increase between AMI pathces.
virtual bool removeAMIFaces(polyTopoChange &topoChange)
Collect faces to remove in the topoChange container.
virtual bool setTopology(polyTopoChange &topoChange)
Set topology changes in the polyTopoChange object.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
const dictionary surfDict_
Dictionary used during projection surface construction.
virtual void movePoints(PstreamBuffers &pBufs, const pointField &)
Correct patches after moving points.
virtual void newInternalProcFaces(label &, label &) const
Return number of new internal of this polyPatch faces.
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
virtual ~cyclicAMIPolyPatch()=default
Destructor.
vectorField faceAreas0_
Temporary storage for AMI face areas.
virtual void initOrder(PstreamBuffers &, const primitivePatch &) const
Initialize ordering for primitivePatch. Does not refer to *this (except for name() and type() etc....
virtual void reverseTransformDirection(vector &d, const label facei) const
Transform a patch-based direction from this side to nbr side.
tmp< Field< Type > > interpolateUntransformed(const Field< Type > &fld, const UList< Type > &defaultValues) const
Interpolate without periodic.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm, const label index, const label newSize, const label newStart) const
Construct and return a clone, resetting the face list and boundary mesh.
virtual const labelUList & nbrCells() const
Return nbrCells.
const point & rotationCentre() const
Point on axis of rotation for rotational cyclic AMI.
const vector & rotationAxis() const
Axis of rotation for rotational cyclic AMI.
const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
point rotationCentre_
Point on axis of rotation for rotational cyclics.
virtual bool changeTopology() const
Return true if this patch changes the mesh topology.
virtual const cyclicAMIPolyPatch & neighbPatch() const
Return a reference to the neighbour patch.
virtual void setAMIFaces()
Set properties of newly inserted faces after topological changes.
labelListList tgtFaceIDs_
word periodicPatchName_
Periodic patch name.
virtual void transformPosition(pointField &) const
Transform patch-based positions from nbr side to this side.
label nbrPatchID_
Index of other half.
virtual refPtr< labelListList > mapCollocatedFaces() const
Return collocated faces map.
labelListList srcFaceIDs_
static const scalar tolerance_
Tolerance used e.g. for area calculations/limits.
TypeName("cyclicAMI")
Runtime type information.
tmp< Field< Type > > interpolate(const Field< Type > &fld, const UList< Type > &defaultValues=UList< Type >()) const
Interpolate field.
const autoPtr< searchableSurface > & surfPtr() const
Create and return pointer to the projection surface.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm, const label index, const labelUList &mapAddressing, const label newStart) const
Construct and return a clone, resetting the face list.
bool rotationAngleDefined_
Flag to show whether the rotation angle is defined.
virtual bool order(PstreamBuffers &, const primitivePatch &, labelList &faceMap, labelList &rotation) const
Return new ordering for primitivePatch.
vectorField & faceCentres0() const
Return access to the initial face centres.
void initInterpolateUntransformed(const Field< Type > &fld, labelRange &sendRequests, labelRange &recvRequests, PtrList< List< Type > > &sendBuffers, PtrList< List< Type > > &recvBuffers, labelRange &sendRequests1, labelRange &recvRequests1, PtrList< List< Type > > &sendBuffers1, PtrList< List< Type > > &recvBuffers1) const
void initInterpolate(const Field< Type > &fld, labelRange &sendRequests, labelRange &recvRequests, PtrList< List< Type > > &sendBuffers, PtrList< List< Type > > &recvBuffers, labelRange &sendRequests1, labelRange &recvRequests1, PtrList< List< Type > > &sendBuffers1, PtrList< List< Type > > &recvBuffers1) const
bool createAMIFaces() const
Return access to the createAMIFaces flag.
tmp< Field< Type > > interpolate(const Field< Type > &localFld, const labelRange &requests, const PtrList< List< Type > > &recvBuffers, const labelRange &requests1, const PtrList< List< Type > > &recvBuffers1, const UList< Type > &defaultValues) const
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
bool applyLowWeightCorrection() const
Return true if applying the low weight correction.
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.
tmp< Field< Type > > interpolate(const tmp< Field< Type > > &tFld, const UList< Type > &defaultValues=UList< Type >()) const
Interpolate tmp field.
const coupleGroupIdentifier coupleGroup_
Optional patchGroup to find neighbPatch.
bool updatingAMI() const
Return access to the updated flag.
vector rotationAxis_
Axis of rotation for rotational cyclics.
virtual void reverseTransformPosition(point &l, const label facei) const
Transform a patch-based position from this side to nbr side.
autoPtr< AMIPatchToPatchInterpolation > AMIPtr_
AMI interpolation class.
bool moveFaceCentres_
Move face centres (default = no).
label periodicPatchID() const
Periodic patch ID (or -1).
virtual void calcTransforms()
Recalculate the transformation tensors.
virtual label neighbPatchID() const
Neighbour patch ID.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A range or interval of labels defined by a start and a size.
label index() const noexcept
The index of this patch in the boundaryMesh.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
const vectorField::subField faceCentres() const
Return face centres.
label start() const noexcept
Return start label of this patch in the polyMesh face list.
const labelUList & faceCells() const
Return face-cell addressing.
Direct mesh changes based on v1.3 polyTopoChange syntax.
A class for managing references or pointers (no reference counting).
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
List< scalarList > scalarListList
List of scalarList.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
A PrimitivePatch with a SubList addressing for the faces, const reference for the point field.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
AMIInterpolation AMIPatchToPatchInterpolation
Patch-to-patch interpolation == Foam::AMIInterpolation.
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.