34void Foam::functionObjects::mapFields::evaluateConstraintTypes
36 GeometricField<Type, fvPatchField, volMesh>&
fld
39 fld.boundaryFieldRef().evaluate_if
41 [](
const auto& pfld) ->
bool
45 pfld.type() == pfld.patch().patch().type()
55bool Foam::functionObjects::mapFields::mapFieldType()
const
57 typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
59 const fvMesh& mapRegion = lookupMapRegion();
61 wordList fieldNames(this->mesh_.sortedNames<VolFieldType>(fieldNames_));
63 const bool processed = !fieldNames.empty();
65 for (
const word& fieldName : fieldNames)
67 const VolFieldType&
field = lookupObject<VolFieldType>(fieldName);
69 auto* mapFieldPtr = mapRegion.getObjectPtr<VolFieldType>(fieldName);
73 mapFieldPtr =
new VolFieldType
85 dimensioned<Type>(
field.dimensions(),
Zero)
91 auto& mappedField = *mapFieldPtr;
93 mappedField = interpPtr_->mapTgtToSrc(
field);
95 Log <<
" " << fieldName <<
": interpolated\n";
105bool Foam::functionObjects::mapFields::writeFieldType()
const
107 typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
109 const fvMesh& mapRegion = lookupMapRegion();
111 wordList fieldNames(this->mesh_.sortedNames<VolFieldType>(fieldNames_));
113 const bool processed = !fieldNames.empty();
115 for (
const word& fieldName : fieldNames)
117 const VolFieldType& mappedField =
118 mapRegion.template lookupObject<VolFieldType>(fieldName);
122 Log <<
" " << fieldName <<
": written\n";
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))
@ REGISTER
Request registration (bool: true).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
static commsTypes defaultCommsType
Default commsType.
static bool constraintType(const word &patchType)
Return true if the given type is a constraint type.
List< word > wordList
List of word.
void evaluateConstraintTypes(GeometricField< Type, fvPatchField, volMesh > &fld)
static constexpr const zero Zero
Global zero (0).