45 const VolFieldType&
fld = *(iter.val());
54 <<
" a field named " << sampleFldName
55 <<
" already exists on the mesh" 60 label sz = sflds.size();
67 io.rename(sampleFldName);
82 Log <<
" created " << sflds[sz].name()
83 <<
" to sample " <<
fld.name() <<
endl;
93 const interpolationCellPoint<Type>& interpolator,
94 GeometricField<Type, fvPatchField, volMesh>&
fld 98 Field<Type> sampledValues(getPatchDataMapPtr_().constructSize());
100 forAll(cellToWalls_, celli)
102 const labelList& cData = cellToWalls_[celli];
106 const point& samplePt = cellToSamples_[celli][i];
107 sampledValues[cData[i]] = interpolator.interpolate(samplePt, celli);
112 getPatchDataMapPtr_().reverseDistribute
114 getPatchDataMapPtr_().constructSize(),
118 typename GeometricField<Type, fvPatchField, volMesh>::
119 Boundary& fldBf =
fld.boundaryFieldRef();
122 label nPatchFaces = 0;
123 for (
const label patchi : patchSet_)
125 fvPatchField<Type>& pfld = fldBf[patchi];
127 Field<Type> newFld(pfld.size());
130 newFld[i] = sampledValues[nPatchFaces++];
148 const word& fldName = reverseFieldMap_[sflds[i].name()];
149 const VolFieldType&
fld = obr_.lookupObject<VolFieldType>(fldName);
158 sampleBoundaryField(interpolator, sflds[i]);
bool found(const word &name, const bool recursive=false) const
Can the regIOobject object be found (by name).
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.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
A class for handling words, derived from Foam::string.
HashTable< word > fieldMap_
From original field to sampled result.
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
A HashTable similar to std::unordered_map.
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.
labelHashSet patchSet_
Patches to sample.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
const objectRegistry & obr_
Reference to the region objectRegistry.
void createFields(PtrList< GeometricField< Type, fvPatchField, volMesh >> &) const
List< Key > toc() const
The table of contents (the keys) in unsorted order.
List< label > labelList
A List of labels.
void sampleFields(PtrList< GeometricField< Type, fvPatchField, volMesh >> &) const
Defines the attributes of an object for which implicit objectRegistry management is supported...
HashTable< const Type * > lookupClass(const bool strict=false) const
Return all objects with a class satisfying isA<Type>
forAllConstIters(mixture.phases(), phase)