49 const DimensionedField<Type, volMesh>&
fld
60 auto tfield = tmp<DimensionedField<Type, volMesh>>
::New
73 Field<Type>(
fld, mapper)
76 tfield.ref().oriented() =
fld.oriented();
86 const GeometricField<Type, fvPatchField, volMesh>&
fld
96 DimensionedField<Type, volMesh> internalField
101 tgtMesh_.time().timeName(),
109 Field<Type>(
fld.internalField(), mapper)
112 internalField.oriented() =
fld.oriented();
118 PtrList<fvPatchField<Type>> oldPatchFields(
fld.mesh().boundary().size());
120 const auto& bfld =
fld.boundaryField();
124 if (patchFaceMaps_.set(patchi))
127 oldPatchFields.set(patchi, bfld[patchi].clone());
132 patchFaceMaps_[patchi]
136 oldPatchFields[patchi].autoMap(mapper);
144 PtrList<fvPatchField<Type>> newPatchFields(tgtMesh_.boundary().size());
146 forAll(oldPatchFields, patchi)
148 if (oldPatchFields.set(patchi))
150 const auto& pfld = oldPatchFields[patchi];
161 tgtMesh_.boundary()[patchi],
172 forAll(newPatchFields, patchi)
174 if (!newPatchFields.set(patchi))
182 tgtMesh_.boundary()[patchi],
191 return tmp<GeometricField<Type, fvPatchField, volMesh>>
::New
193 std::move(internalField),
203 const GeometricField<Type, fvsPatchField, surfaceMesh>&
fld
214 Field<Type> primitiveField;
217 Field<Type> flatFld(
fld.mesh().nFaces(), Type(
Zero));
218 SubList<Type>(flatFld,
fld.internalField().size())
219 =
fld.internalField();
221 for (
const fvsPatchField<Type>& fvp :
fld.boundaryField())
223 SubList<Type>(flatFld, fvp.size(), fvp.patch().start()) = fvp;
227 primitiveField = Field<Type>(flatFld, mapper,
fld.oriented()());
230 primitiveField.resize
234 primitiveField.size(),
235 tgtMesh_.nInternalFaces()
241 DimensionedField<Type, surfaceMesh> internalField
246 tgtMesh_.time().timeName(),
254 std::move(primitiveField)
257 internalField.oriented() =
fld.oriented();
263 PtrList<fvsPatchField<Type>> oldPatchFields(
fld.mesh().boundary().size());
265 const auto& bfld =
fld.boundaryField();
269 if (patchFaceMaps_.set(patchi))
272 oldPatchFields.set(patchi, bfld[patchi].clone());
277 patchFaceMaps_[patchi]
281 oldPatchFields[patchi].autoMap(mapper);
286 PtrList<fvsPatchField<Type>> newPatchFields(tgtMesh_.boundary().size());
290 forAll(oldPatchFields, patchi)
292 if (oldPatchFields.set(patchi))
294 const fvsPatchField<Type>& pfld = oldPatchFields[patchi];
305 tgtMesh_.boundary()[patchi],
315 forAll(newPatchFields, patchi)
317 if (!newPatchFields.set(patchi))
325 tgtMesh_.boundary()[patchi],
334 return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
::New
336 std::move(internalField),
346 const IOobject& fieldObject
350 DimensionedField<Type, volMesh>
fld
357 return distributeField(
fld);
365 const IOobject& fieldObject
369 GeometricField<Type, fvPatchField, volMesh>
fld
376 return distributeField(
fld);
384 const IOobject& fieldObject
388 GeometricField<Type, fvsPatchField, surfaceMesh>
fld
395 return distributeField(
fld);
402 const IOobjectList& objects,
403 const wordRes& selectedFields
406 typedef DimensionedField<Type, volMesh> fieldType;
411 selectedFields.empty()
412 ? objects.sortedNames<fieldType>()
413 : objects.sortedNames<fieldType>(selectedFields)
417 for (
const word& fieldName : fieldNames)
419 if (
"cellDist" == fieldName)
428 Info<<
" Reconstructing "
429 << fieldType::typeName <<
"s\n" <<
nl;
431 Info<<
" " << fieldName <<
nl;
437 distributeInternalField<Type>(*(objects[fieldName]))
445 if (nFields && verbose_)
Info<<
endl;
453 const IOobjectList& objects,
454 const wordRes& selectedFields
457 typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
462 selectedFields.empty()
463 ? objects.sortedNames<fieldType>()
464 : objects.sortedNames<fieldType>(selectedFields)
468 for (
const word& fieldName : fieldNames)
470 if (
"cellDist" == fieldName)
478 Info<<
" Reconstructing "
479 << fieldType::typeName <<
"s\n" <<
nl;
481 Info<<
" " << fieldName <<
nl;
487 distributeVolumeField<Type>(*(objects[fieldName]))
495 if (nFields && verbose_)
Info<<
endl;
503 const IOobjectList& objects,
504 const wordRes& selectedFields
507 typedef GeometricField<Type, fvsPatchField, surfaceMesh> fieldType;
512 selectedFields.empty()
513 ? objects.sortedNames<fieldType>()
514 : objects.sortedNames<fieldType>(selectedFields)
518 for (
const word& fieldName : fieldNames)
524 Info<<
" Reconstructing "
525 << fieldType::typeName <<
"s\n" <<
nl;
527 Info<<
" " << fieldName <<
nl;
533 distributeSurfaceField<Type>(*(objects[fieldName]))
541 if (nFields && verbose_)
Info<<
endl;
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))
static const DimensionedField< Type, GeoMesh > & null()
Return a NullObjectRef DimensionedField.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static word timeName(const scalar t, const int precision=precision_)
static const UList< label > & null()
Return a UList reference to a nullObject.
const Time & time() const
Return the top-level database.
const mapDistribute & cellMap() const noexcept
Cell distribute map.
label distributeInternalFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, redistribute and write all/selected volume internal fields.
tmp< DimensionedField< Type, volMesh > > distributeField(const DimensionedField< Type, volMesh > &) const
Redistribute volume internal field.
label distributeSurfaceFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, reconstruct and write all/selected surface fields.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > distributeSurfaceField(const IOobject &fieldObject) const
Read and distribute surface field.
label distributeVolumeFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, redistribute and write all/selected volume fields.
tmp< DimensionedField< Type, volMesh > > distributeInternalField(const IOobject &fieldObject) const
Read and distribute volume internal field.
tmp< GeometricField< Type, fvPatchField, volMesh > > distributeVolumeField(const IOobject &fieldObject) const
Read and distribute volume field.
A class for managing temporary objects.
DirectFieldMapper< fvPatchFieldMapper > directFvPatchFieldMapper
A fvPatchFieldMapper with direct mapping.
DistributedFieldMapper< directFieldMapper > distributedFieldMapper
A directFieldMapper with distributed (with local or remote) quantities.
List< word > wordList
A List of words.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static constexpr const zero Zero
Global zero (0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
DistributedFieldMapper< directFvPatchFieldMapper > distributedFvPatchFieldMapper
A directFvPatchFieldMapper with direct mapping from local or remote quantities.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
The type name used in ensight case files.