35 template<
class GeoField>
36 void Foam::fvMeshTools::addPatchFields
39 const dictionary& patchFieldDict,
40 const word& defaultPatchFieldType,
41 const typename GeoField::value_type& defaultPatchValue
44 HashTable<GeoField*> flds
46 mesh.objectRegistry::lookupClass<GeoField>()
51 GeoField&
fld = *iter.val();
52 auto& bfld =
fld.boundaryFieldRef();
54 const label newPatchi = bfld.size();
55 bfld.resize(newPatchi+1);
57 const dictionary*
dict = patchFieldDict.findDict(
fld.name());
66 mesh.boundary()[newPatchi],
79 defaultPatchFieldType,
80 mesh.boundary()[newPatchi],
84 bfld[newPatchi] == defaultPatchValue;
90 template<
class GeoField>
91 void Foam::fvMeshTools::setPatchFields
95 const dictionary& patchFieldDict
98 HashTable<GeoField*> flds
100 mesh.objectRegistry::lookupClass<GeoField>()
105 GeoField&
fld = *iter.val();
106 auto& bfld =
fld.boundaryFieldRef();
127 template<
class GeoField>
128 void Foam::fvMeshTools::setPatchFields
132 const typename GeoField::value_type& value
135 HashTable<GeoField*> flds
137 mesh.objectRegistry::lookupClass<GeoField>()
142 GeoField&
fld = *iter.val();
143 auto& bfld =
fld.boundaryFieldRef();
145 bfld[patchi] == value;
151 template<
class GeoField>
152 void Foam::fvMeshTools::trimPatchFields(fvMesh&
mesh,
const label
nPatches)
154 HashTable<GeoField*> flds
156 mesh.objectRegistry::lookupClass<GeoField>()
161 GeoField&
fld = *iter.val();
168 template<
class GeoField>
169 void Foam::fvMeshTools::reorderPatchFields
175 HashTable<GeoField*> flds
177 mesh.objectRegistry::lookupClass<GeoField>()
182 GeoField&
fld = *iter.val();
183 auto& bfld =
fld.boundaryFieldRef();
185 bfld.reorder(oldToNew);
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.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
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))
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
List< label > labelList
A List of labels.
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and a sub-dictionary) otherwise return nullptr...