91#ifndef Foam_wallDistAddressing_H
92#define Foam_wallDistAddressing_H
114 public MeshObject<fvMesh, UpdateableMeshObject, wallDistAddressing>,
219 const bool correctWalls =
true,
220 const label updateInterval = 1
227 const word& patchTypeName,
230 const bool correctWalls =
true,
231 const label updateInterval = 1
264 template<
class Container,
class Type>
268 template<
class VolField>
271 const Field<typename VolField::value_type>& patchFld,
279 template<
class VolField,
class TransformOp>
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))
Wave propagation of information through grid. Every iteration information goes through one layer of c...
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...
MeshObject(const fvMesh &mesh)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
const polyMesh & mesh() const
Access mesh.
Mesh data needed to do the Finite Volume discretisation.
Class containing processor-to-processor mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for managing temporary objects.
labelList transformedPatchStarts_
virtual bool movePoints()
Update the y-field when the mesh moves.
const word patchTypeName_
Name for the patch set, e.g. "wall".
ClassName("wallDistAddressing")
labelList untransformedPatchStarts_
Start of patches. Start of untransformedPatchStarts_[0] is end.
void extract(const Field< typename VolField::value_type > &patchFld, VolField &fld) const
Take collected/distributed patch field and fill volField.
volScalarField y_
Distance-to-wall field.
void addItem(const label item, const labelPair &data, label &untransformi, label &transformi, labelPairList &transformedWallInfo)
Store nearest-data to cell or boundary face.
const VolField & map(VolField &fld, const TransformOp &top=mapDistribute::transform()) const
Map nearest-patch information. Take wall patch values.
label getValues(const FaceCellWave< wallPointAddressing > &wave, const List< wallPointAddressing > &allCellInfo, const List< wallPointAddressing > &allFaceInfo, volScalarField &y) const
Extract FaceCellWave data.
const bool correctWalls_
Do accurate distance calculation for near-wall cells.
autoPtr< globalIndex > globalWallsPtr_
Number of wall faces.
labelList untransformedSlots_
Corresponding slot in mapPtr distribution result.
const labelUList & patchIDs() const noexcept
Return the patchIDs.
wallDistAddressing(const wallDistAddressing &)=delete
No copy construct.
virtual ~wallDistAddressing()
Destructor.
void operator=(const wallDistAddressing &)=delete
No copy assignment.
bool requireUpdate_
Flag to indicate whether the wall distance requires updating.
autoPtr< mapDistribute > mapPtr_
Map to pull wall face info to cell or boundary face.
labelList transformedSlots_
labelList untransformedItems_
Indices of cells followed by boundary faces.
virtual void updateMesh(const mapPolyMesh &)
Update the y-field when the mesh changes.
const label updateInterval_
Update wall distance every updateInterval_ steps.
tmp< Field< Type > > collectPatchFields(const Container &bfld) const
Collect patchFields from patchIDs into straight list.
const volScalarField & y() const noexcept
Return reference to cached distance-to-wall field. Unvisited.
const labelList patchIDs_
Set of patch IDs.
labelList transformedItems_
Holds information (coordinate and origin) regarding nearest wall point.
A class for handling words, derived from Foam::string.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
List< wallPoints > allFaceInfo(mesh_.nFaces())
List< wallPoints > allCellInfo(mesh_.nCells())
Pair< label > labelPair
A pair of labels.
List< labelPair > labelPairList
List of labelPair.
List< label > labelList
A List of labels.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
UList< label > labelUList
A UList of labels.