34void Foam::functionObjects::mapFields::evaluateConstraintTypes
36 GeometricField<Type, fvPatchField, volMesh>&
fld
39 auto& fldBf =
fld.boundaryFieldRef();
53 fvPatchField<Type>& tgtField = fldBf[patchi];
57 tgtField.type() == tgtField.patch().patch().type()
61 tgtField.initEvaluate(commsType);
77 fvPatchField<Type>& tgtField = fldBf[patchi];
81 tgtField.type() == tgtField.patch().patch().type()
85 tgtField.evaluate(commsType);
92 fld.mesh().globalData().patchSchedule();
94 for (
const auto& schedEval : patchSchedule)
96 const label patchi = schedEval.patch;
98 fvPatchField<Type>& tgtField = fldBf[patchi];
102 tgtField.type() == tgtField.patch().patch().type()
108 tgtField.initEvaluate(commsType);
112 tgtField.evaluate(commsType);
121bool Foam::functionObjects::mapFields::mapFieldType()
const
123 typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
125 const fvMesh& mapRegion = mapRegionPtr_();
127 wordList fieldNames(this->mesh_.names(VolFieldType::typeName));
129 const labelList selected(fieldNames_.matching(fieldNames));
131 for (
const label fieldi : selected)
133 const word& fieldName = fieldNames[fieldi];
135 const VolFieldType&
field = lookupObject<VolFieldType>(fieldName);
137 if (!mapRegion.foundObject<VolFieldType>(fieldName))
139 VolFieldType* tmappedField =
151 dimensioned<Type>(
field.dimensions(),
Zero)
154 tmappedField->store();
157 VolFieldType& mappedField =
158 mapRegion.template lookupObjectRef<VolFieldType>(fieldName);
160 mappedField = interpPtr_->mapTgtToSrc(
field);
162 Log <<
" " << fieldName <<
": interpolated";
167 return !selected.empty();
172bool Foam::functionObjects::mapFields::writeFieldType()
const
174 typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
176 const fvMesh& mapRegion = mapRegionPtr_();
178 wordList fieldNames(this->mesh_.names(VolFieldType::typeName));
180 const labelList selected(fieldNames_.matching(fieldNames));
182 for (
const label fieldi : selected)
184 const word& fieldName = fieldNames[fieldi];
186 const VolFieldType& mappedField =
187 mapRegion.template lookupObject<VolFieldType>(fieldName);
191 Log <<
" " << fieldName <<
": written";
194 return !selected.empty();
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
commsTypes
Types of communications.
@ nonBlocking
"nonBlocking"
static label nRequests()
Get number of outstanding requests.
static void waitRequests(const label start=0)
Wait until all requests (from start onwards) have finished.
static commsTypes defaultCommsType
Default commsType.
static bool & parRun() noexcept
Test if this a parallel run.
virtual const word & constraintType() const
Return the constraint type this pointPatch implements.
List< word > wordList
A List of words.
List< label > labelList
A List of labels.
List< lduScheduleEntry > lduSchedule
A List of lduSchedule entries.
void evaluateConstraintTypes(GeometricField< Type, fvPatchField, volMesh > &fld)
static constexpr const zero Zero
Global zero (0)
#define forAll(list, i)
Loop across all elements in list.