42 const GeometricField<Type, pointPatchField, pointMesh>&
fld
45 if (!tgtMeshRef_ || !distMapRef_)
48 <<
"Cannot map field without target mesh and/or distribution!"
53 const_cast<parPointFieldDistributor&
>(*this).createPatchPointMaps();
56 const auto& tgtMesh = tgtMeshRef_();
57 const auto& distMap = distMapRef_();
66 DimensionedField<Type, pointMesh> internalField
71 tgtMesh.time().timeName(),
79 Field<Type>(
fld.internalField(), mapper)
82 internalField.oriented() =
fld.oriented();
87 PtrList<pointPatchField<Type>> newPatchFields(tgtMesh.boundary().size());
89 const auto& bfld =
fld.boundaryField();
93 if (patchPointMaps_.set(patchi))
100 patchPointMaps_[patchi]
110 tgtMesh.boundary()[patchi],
111 DimensionedField<Type, pointMesh>::null(),
134 forAll(newPatchFields, patchi)
136 if (!newPatchFields.set(patchi))
144 tgtMesh.boundary()[patchi],
145 DimensionedField<Type, pointMesh>::null()
152 tmp<GeometricField<Type, pointPatchField, pointMesh>>
::New
154 std::move(internalField),
164 const IOobject& fieldObject
168 GeometricField<Type, pointPatchField, pointMesh>
fld
175 return distributeField(
fld);
182 const IOobjectList& objects,
183 const wordRes& selectedFields
186 typedef GeometricField<Type, pointPatchField, pointMesh> fieldType;
188 UPtrList<const IOobject> fieldObjects
190 selectedFields.empty()
191 ? objects.sorted<fieldType>()
192 : objects.sorted<fieldType>(selectedFields)
196 for (
const IOobject&
io : fieldObjects)
202 Info<<
" Reconstructing "
203 << fieldType::typeName <<
"s\n" <<
nl;
209 tmp<fieldType> tfld(distributePointField<Type>(
io));
216 if (nFields && verbose_)
Info<<
endl;
224 const PtrList<GeometricField<Type, pointPatchField, pointMesh>>&
fields
230 auto tfld = distributeField(
fld);
234 tfld().mesh().thisDb().store(tfld);
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))
const word & name() const noexcept
Return the object name.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static const UList< label > & null()
Return a UList reference to a nullObject.
bool hasPatchPointMaps() const
True if patch maps (per boundary) exist.
tmp< GeometricField< Type, pointPatchField, pointMesh > > distributePointField(const IOobject &fieldObject) const
Read and distribute point field.
void distributeAndStore(const PtrList< GeometricField< Type, pointPatchField, pointMesh > > &) const
tmp< GeometricField< Type, pointPatchField, pointMesh > > distributeField(const GeometricField< Type, pointPatchField, pointMesh > &fld) const
Distribute point field.
label distributePointFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, distribute and write all/selected point fields.
A class for managing temporary objects.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
DistributedFieldMapper< directFieldMapper > distributedFieldMapper
A directFieldMapper with distributed (with local or remote) quantities.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
DistributedFieldMapper< directPointPatchFieldMapper > distributedPointPatchFieldMapper
A directPointPatchFieldMapper with direct mapping from local or remote quantities.
constexpr char nl
The newline '\n' character (0x0a)
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
The type name used in ensight case files.