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();
53 auto& bfld =
fld.boundaryFieldRef();
55 label sz = bfld.size();
58 if (patchFieldDict.found(
fld.name()))
67 patchFieldDict.subDict(
fld.name())
78 defaultPatchFieldType,
83 bfld[sz] == defaultPatchValue;
89 template<
class GeoField>
90 void Foam::fvMeshTools::setPatchFields
94 const dictionary& patchFieldDict
97 HashTable<GeoField*> flds
99 mesh.objectRegistry::lookupClass<GeoField>()
104 GeoField&
fld = *iter();
106 auto& bfld =
fld.boundaryFieldRef();
108 if (patchFieldDict.found(
fld.name()))
117 patchFieldDict.subDict(
fld.name())
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();
144 auto& bfld =
fld.boundaryFieldRef();
146 bfld[patchi] == value;
152 template<
class GeoField>
153 void Foam::fvMeshTools::trimPatchFields(fvMesh&
mesh,
const label
nPatches)
155 HashTable<GeoField*> flds
157 mesh.objectRegistry::lookupClass<GeoField>()
162 GeoField&
fld = *iter();
169 template<
class GeoField>
170 void Foam::fvMeshTools::reorderPatchFields
176 HashTable<GeoField*> flds
178 mesh.objectRegistry::lookupClass<GeoField>()
183 GeoField&
fld = *iter();
185 auto& bfld =
fld.boundaryFieldRef();
187 bfld.reorder(oldToNew);