37#ifndef MapGeometricFields_H
38#define MapGeometricFields_H
47template<
class Type,
class MeshMapper,
class GeoMesh>
57 const MeshMapper& mapper
68 template<
class>
class PatchField,
74 const MeshMapper& mapper
81 mapper.thisDb().objectRegistry::template csorted<FieldType>()
93 if (&
field.mesh() == &mapper.mesh())
95 field.storeOldTimes();
103 if (&
field.mesh() == &mapper.mesh())
108 << FieldType::typeName <<
' ' <<
field.name() <<
endl;
114 fld.internalFieldRef(),
119 auto& bfield =
fld.boundaryFieldRef();
128 bfield[patchi].autoMap(mapper.boundaryMap()[patchi]);
131 fld.instance() =
fld.time().timeName();
133 else if (polyMesh::debug)
135 Info<<
"Not mapping "
136 << FieldType::typeName <<
' ' <<
field.name()
137 <<
" since originating mesh differs from that of mapper."
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...
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Generic GeometricField class.
Generic internal field mapper. For "real" mapping, add template specialisations for mapping of intern...
MapInternalField()=default
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
void MapGeometricFields(const MeshMapper &mapper)
Generic Geometric field mapper.
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
#define forAll(list, i)
Loop across all elements in list.