42 const GeometricField<Type, pointPatchField, pointMesh>&
fld 45 if (!tgtMeshRef_ || !distMapRef_)
48 <<
"Cannot map field without target mesh and/or distribution!" 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],
134 forAll(newPatchFields, patchi)
136 if (!newPatchFields.set(patchi))
144 tgtMesh.boundary()[patchi],
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 const UPtrList<const IOobject> fieldObjects
190 selectedFields.empty()
191 ? objects.csorted<fieldType>()
192 : objects.csorted<fieldType>(selectedFields)
196 for (
const IOobject&
io : fieldObjects)
202 Info<<
" Reconstructing " 203 << fieldType::typeName <<
"s\n" <<
nl;
209 tmp<fieldType> tfld(distributePointField<Type>(
io));
212 if (isWriteProc_.good())
219 else if (writeHandler_ && writeHandler_->good())
231 if (nFields && verbose_)
Info<<
endl;
239 const PtrList<GeometricField<Type, pointPatchField, pointMesh>>&
fields 245 auto tfld = distributeField(
fld);
249 tfld().mesh().thisDb().store(tfld);
DistributedFieldMapper< directPointPatchFieldMapper > distributedPointPatchFieldMapper
A directPointPatchFieldMapper with direct mapping from local or remote quantities.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static const DimensionedField< Type, GeoMesh > & null() noexcept
Return a null DimensionedField (reference to a nullObject).
const word & name() const noexcept
Return the object name.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
tmp< GeometricField< Type, pointPatchField, pointMesh > > distributePointField(const IOobject &fieldObject) const
Read and distribute point field.
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler()
bool hasPatchPointMaps() const
True if patch maps (per boundary) exist.
static const word & emptyType() noexcept
The type name for empty patch fields.
Ignore writing from objectRegistry::writeObject()
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
#define forAll(list, i)
Loop across all elements in list.
label distributePointFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
Read, distribute and write all/selected point fields.
static autoPtr< pointPatchField< Type > > New(const word &patchFieldType, const pointPatch &p, const DimensionedField< Type, pointMesh > &iF)
Return a pointer to a new patchField created on freestore given.
tmp< GeometricField< Type, pointPatchField, pointMesh > > distributeField(const GeometricField< Type, pointPatchField, pointMesh > &fld) const
Distribute point field.
errorManip< error > abort(error &err)
void distributeAndStore(const PtrList< GeometricField< Type, pointPatchField, pointMesh >> &) const
Distributed each (unregistered!) point field and store the result on its objectRegistry.
DistributedFieldMapper< directFieldMapper > distributedFieldMapper
A directFieldMapper with distributed (with local or remote) quantities.
static label commWorld() noexcept
Communicator for all ranks (respecting any local worlds)
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))
Automatically write from objectRegistry::writeObject()
static const UList< label > & null() noexcept
Return a null UList (reference to a nullObject). Behaves like an empty UList.
messageStream Info
Information stream (stdout output on master, null elsewhere)
static const fileOperation & fileHandler()
Return the current file handler. Will create the default file handler if necessary.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
A class for managing temporary objects.
parPointFieldDistributor(const parPointFieldDistributor &)=delete
No copy construct.