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.is_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;
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > distributeSurfaceField(const IOobject &fieldObject) const
Read and distribute surface field.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
label distributeVolumeFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, redistribute and write all/selected volume fields.
label distributeInternalFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, redistribute and write all/selected volume internal fields.
Ignore writing from objectRegistry::writeObject()
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
const Time & time() const
Return the top-level database.
DirectFieldMapper< fvPatchFieldMapper > directFvPatchFieldMapper
A fvPatchFieldMapper with direct mapping.
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
Typename for Field.
static const DimensionedField< Type, GeoMesh > & null()
Return a NullObjectRef DimensionedField.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
const mapDistribute & cellMap() const noexcept
Cell distribute map.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
DistributedFieldMapper< directFieldMapper > distributedFieldMapper
A directFieldMapper with distributed (with local or remote) quantities.
static const UList< label > & null()
Return a UList reference to a nullObject.
DistributedFieldMapper< directFvPatchFieldMapper > distributedFvPatchFieldMapper
A directFvPatchFieldMapper with direct mapping from local or remote quantities.
tmp< DimensionedField< Type, volMesh > > distributeInternalField(const IOobject &fieldObject) const
Read and distribute volume internal field.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
tmp< DimensionedField< Type, volMesh > > distributeField(const DimensionedField< Type, volMesh > &) const
Redistribute volume internal field.
List< word > wordList
A List of words.
tmp< GeometricField< Type, fvPatchField, volMesh > > distributeVolumeField(const IOobject &fieldObject) const
Read and distribute volume field.
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< label > labelList
A List of labels.
A class for managing temporary objects.
label distributeSurfaceFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, reconstruct and write all/selected surface fields.
static tmp< fvPatchField< Type > > New(const word &patchFieldType, const fvPatch &, const DimensionedField< Type, volMesh > &)
Return a pointer to a new patchField created on freestore given.
static tmp< fvsPatchField< Type > > New(const word &patchFieldType, const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Return a pointer to a new patchField created on freestore given.
static constexpr const zero Zero
Global zero (0)