45 if (fieldMapIter.good())
47 const word& sampleFldName = fieldMapIter.val();
52 <<
" a field named " << sampleFldName
53 <<
" already exists on the mesh" 61 io.rename(sampleFldName);
64 const label newFieldi = sflds.size();
65 sflds.resize(newFieldi+1);
79 Log <<
" created " <<
io.name()
80 <<
" to sample " <<
fld.name() <<
endl;
90 const interpolationCellPoint<Type>& interpolator,
91 GeometricField<Type, fvPatchField, volMesh>&
fld 95 Field<Type> sampledValues(getPatchDataMapPtr_().constructSize());
97 forAll(cellToWalls_, celli)
99 const labelList& cData = cellToWalls_[celli];
103 const point& samplePt = cellToSamples_[celli][i];
104 sampledValues[cData[i]] = interpolator.interpolate(samplePt, celli);
109 getPatchDataMapPtr_().reverseDistribute
111 getPatchDataMapPtr_().constructSize(),
115 typename GeometricField<Type, fvPatchField, volMesh>::
116 Boundary& fldBf =
fld.boundaryFieldRef();
119 label nPatchFaces = 0;
120 for (
const label patchi : patchIDs_)
122 fvPatchField<Type>& pfld = fldBf[patchi];
124 Field<Type> newFld(pfld.size());
127 newFld[i] = sampledValues[nPatchFaces++];
145 const word& fldName = reverseFieldMap_[sflds[i].name()];
146 const VolFieldType&
fld = obr_.lookupObject<VolFieldType>(fldName);
155 sampleBoundaryField(interpolator, sflds[i]);
UPtrList< const Type > csorted() const
Return sorted list of objects with a class satisfying isA<Type> or isType<Type> (with Strict) ...
labelList patchIDs_
Patches to sample.
void sampleBoundaryField(const interpolationCellPoint< Type > &interpolator, GeometricField< Type, fvPatchField, volMesh > &fld) const
Override boundary fields with sampled values.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Generic GeometricField class.
Ignore writing from objectRegistry::writeObject()
#define forAll(list, i)
Loop across all elements in list.
A class for handling words, derived from Foam::string.
HashTable< word > fieldMap_
From original field to sampled result.
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))
Given cell centre values and point (vertex) values decompose into tetrahedra and linear interpolate w...
vector point
Point is a vector.
#define WarningInFunction
Report a warning using Foam::Warning.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
const objectRegistry & obr_
Reference to the region objectRegistry.
static const word & calculatedType() noexcept
The type name for calculated patch fields.
bool found(const word &name, bool recursive=false) const
Same as contains()
void createFields(PtrList< GeometricField< Type, fvPatchField, volMesh >> &) const
List< label > labelList
A List of labels.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
void sampleFields(PtrList< GeometricField< Type, fvPatchField, volMesh >> &) const
Defines the attributes of an object for which implicit objectRegistry management is supported...