51 const bool allowUnmapped
57 forAll(patchFields, patchi)
104 auto& result = tresult.ref();
111 auto& bf = result.boundaryFieldRef();
115 const label basePatchId =
patchMap[patchi];
117 if (basePatchId != -1)
121 const fvPatch& basePatch = vf.
mesh().boundary()[basePatchId];
122 const label baseStart = basePatch.
start();
123 const label baseSize = basePatch.
size();
127 forAll(directAddressing, i)
131 if (baseFacei >= baseStart && baseFacei < baseStart+baseSize)
133 directAddressing[i] = baseFacei-baseStart;
139 directAddressing[i] = -1;
162 result.internalField(),
167 if (allowUnmapped && hasUnmapped)
178 forAll(directAddressing, i)
180 if (directAddressing[i] == -1)
185 bf[patchi].fvPatchField<Type>::operator=(value);
204 const bool allowUnmapped
238 forAll(patchFields, patchi)
290 auto& result = tresult.ref();
297 auto& bf = result.boundaryFieldRef();
306 const label baseStart = basePatch.
start();
307 const label baseSize = basePatch.
size();
311 forAll(directAddressing, i)
315 if (baseFacei >= baseStart && baseFacei < baseStart+baseSize)
317 directAddressing[i] = baseFacei-baseStart;
324 directAddressing[i] = -1;
344 const labelUList& fc = bf[patchi].patch().faceCells();
367 label patchi = vf.
mesh().boundaryMesh().whichPatch
371 const fvPatch& otherPatch = vf.
mesh().boundary()[patchi];
393 const bool allowUnmapped
425 forAll(patchFields, patchi)
473 auto& result = tresult.ref();
480 auto& bf = result.boundaryFieldRef();
506 forAll(subMeshPoints, localI)
509 label meshPointi =
pointMap[subMeshPoints[localI]];
511 const auto iter = meshPointMap.
cfind(meshPointi);
515 directAddressing[localI] = iter.val();
526 result.internalField(),
547 const bool allowUnmapped
588 tresult.ref().oriented() = df.
oriented();
604 const bool allowUnmapped
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))
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
bool is_oriented() const noexcept
True if field is ORIENTED.
static const this_type & null() noexcept
const Mesh & mesh() const noexcept
Return const reference to mesh.
const dimensionSet & dimensions() const noexcept
Return dimensions.
orientedType oriented() const noexcept
Return oriented type.
virtual bool hasUnmapped() const
Any unmapped values?
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Generic GeometricField class.
const Internal & internalField() const noexcept
Return a const-reference to the dimensioned internal field.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
const_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
A HashTable to objects of type <T> with a label key.
static FOAM_NO_DANGLING_REFERENCE const pointMesh & New(const polyMesh &mesh, Args &&... args)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
A non-owning sub-view of a List (allocated or unallocated storage).
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
void size(const label n)
Older name for setAddressableSize.
This boundary condition provides an 'empty' condition for reduced dimensions cases,...
This boundary condition provides an 'empty' condition for reduced dimensions cases.
An empty boundary condition for pointField.
const labelList & faceMap() const
Return face map.
const labelList & cellMap() const
Return cell map.
const labelList & pointPatchMap() const
Return point-patch map. Usually identical to patchMap except if additional patches are added to the p...
static tmp< DimensionedField< Type, volMesh > > interpolate(const DimensionedField< Type, volMesh > &, const fvMesh &sMesh, const labelUList &cellMap)
Map volume internal (dimensioned) field.
const fvMesh & subMesh() const
Return reference to subset mesh.
const labelList & patchMap() const
Return patch map.
const labelList & pointMap() const
Return point map.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
static const word & calculatedType() noexcept
The type name for calculated patch fields.
static tmp< fvPatchField< Type > > New(const word &patchFieldType, const fvPatch &, const DimensionedField< Type, volMesh > &)
Return a pointer to a new patchField created on freestore given.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual label size() const
Patch size is the number of faces, but can be overloaded.
const polyPatch & patch() const noexcept
Return the polyPatch.
label start() const noexcept
The patch start within the polyMesh face list.
static const word & calculatedType() noexcept
The type name for calculated patch fields.
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
static tmp< fvsPatchField< Type > > New(const word &patchFieldType, const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Return a pointer to a new patchField created on freestore given.
Mesh representing a set of points created from polyMesh.
const Time & time() const
Return Time from polyMesh.
const pointBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
const objectRegistry & thisDb() const
Return database. For now is its polyMesh.
static const word & calculatedType() noexcept
The type name for calculated patch fields.
static autoPtr< pointPatchField< Type > > New(const word &patchFieldType, const pointPatch &p, const DimensionedField< Type, pointMesh > &iF)
Return a pointer to a new patchField created on freestore given.
Basic pointPatch represents a set of points from the mesh.
virtual const labelList & meshPoints() const =0
Return mesh points.
virtual label size() const =0
Return size.
label whichFace(const label facei) const noexcept
Return label of face in patch from global face label.
label nInternalFaces() const noexcept
Number of internal faces.
A class for managing temporary objects.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Map< label > invertToMap(const labelUList &values)
Create inverse mapping, which is a lookup table into the given list.
List< label > labelList
A List of labels.
DirectFieldMapper< fvPatchFieldMapper > directFvPatchFieldMapper
A fvPatchFieldMapper with direct mapping.
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
UList< label > labelUList
A UList of labels.
DirectFieldMapper< pointPatchFieldMapper > directPointPatchFieldMapper
A direct pointPatchFieldMapper.
#define forAll(list, i)
Loop across all elements in list.
Functor to negate primitives. Dummy for most other types.