35template<
class GeoField>
36void Foam::fvMeshTools::addPatchFields
40 const word& defaultPatchFieldType,
41 const typename GeoField::value_type& defaultPatchValue
44 for (GeoField&
fld :
mesh.objectRegistry::sorted<GeoField>())
46 auto& bfld =
fld.boundaryFieldRef();
48 const label newPatchi = bfld.size();
49 bfld.resize(newPatchi+1);
60 mesh.boundary()[newPatchi],
73 defaultPatchFieldType,
74 mesh.boundary()[newPatchi],
78 bfld[newPatchi] == defaultPatchValue;
84template<
class GeoField>
85void Foam::fvMeshTools::setPatchFields
92 for (GeoField&
fld :
mesh.objectRegistry::sorted<GeoField>())
94 auto& bfld =
fld.boundaryFieldRef();
115template<
class GeoField>
116void Foam::fvMeshTools::setPatchFields
120 const typename GeoField::value_type& value
123 for (GeoField&
fld :
mesh.objectRegistry::sorted<GeoField>())
125 auto& bfld =
fld.boundaryFieldRef();
127 bfld[patchi] == value;
133template<
class GeoField>
136 for (GeoField&
fld :
mesh.objectRegistry::sorted<GeoField>())
138 auto& bfld =
fld.boundaryFieldRef();
146template<
class GeoField>
147void Foam::fvMeshTools::reorderPatchFields
153 for (GeoField&
fld :
mesh.objectRegistry::sorted<GeoField>())
155 auto& bfld =
fld.boundaryFieldRef();
157 bfld.reorder(oldToNew);
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))
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr...
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
List< label > labelList
A List of labels.