32 template<
class GeoField>
33 void Foam::fvMeshTools::addPatchFields
36 const dictionary& patchFieldDict,
37 const word& defaultPatchFieldType,
38 const typename GeoField::value_type& defaultPatchValue
41 HashTable<GeoField*> flds
43 mesh.objectRegistry::lookupClass<GeoField>()
46 forAllIter(
typename HashTable<GeoField*>, flds, iter)
48 GeoField& fld = *iter();
50 typename GeoField::Boundary& bfld =
51 fld.boundaryFieldRef();
53 label sz = bfld.size();
56 if (patchFieldDict.found(fld.name()))
65 patchFieldDict.subDict(fld.name())
76 defaultPatchFieldType,
81 bfld[sz] == defaultPatchValue;
87 template<
class GeoField>
88 void Foam::fvMeshTools::setPatchFields
92 const dictionary& patchFieldDict
95 HashTable<GeoField*> flds
97 mesh.objectRegistry::lookupClass<GeoField>()
100 forAllIter(
typename HashTable<GeoField*>, flds, iter)
102 GeoField& fld = *iter();
104 typename GeoField::Boundary& bfld =
105 fld.boundaryFieldRef();
107 if (patchFieldDict.found(fld.name()))
116 patchFieldDict.subDict(fld.name())
126 template<
class GeoField>
127 void Foam::fvMeshTools::setPatchFields
131 const typename GeoField::value_type& value
134 HashTable<GeoField*> flds
136 mesh.objectRegistry::lookupClass<GeoField>()
139 forAllIter(
typename HashTable<GeoField*>, flds, iter)
141 GeoField& fld = *iter();
143 typename GeoField::Boundary& bfld =
144 fld.boundaryFieldRef();
152 template<
class GeoField>
153 void Foam::fvMeshTools::trimPatchFields(fvMesh& mesh,
const label nPatches)
155 HashTable<GeoField*> flds
157 mesh.objectRegistry::lookupClass<GeoField>()
160 forAllIter(
typename HashTable<GeoField*>, flds, iter)
162 GeoField& fld = *iter();
163 fld.boundaryFieldRef().setSize(nPatches);
169 template<
class GeoField>
170 void Foam::fvMeshTools::reorderPatchFields
176 HashTable<GeoField*> flds
178 mesh.objectRegistry::lookupClass<GeoField>()
181 forAllIter(
typename HashTable<GeoField*>, flds, iter)
183 GeoField& fld = *iter();
185 typename GeoField::Boundary& bfld =
186 fld.boundaryFieldRef();
188 bfld.reorder(oldToNew);
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
List< label > labelList
A List of labels.