36 const word& defaultPatchFieldType,
37 const bool validBoundary
55 if (!isA<processorPolyPatch>(patch))
57 forAll(polyPatches, patchi)
61 if (isA<processorPolyPatch>(pp))
64 startFacei = pp.
start();
105 addPatchFields<volScalarField>
109 defaultPatchFieldType,
112 addPatchFields<volVectorField>
116 defaultPatchFieldType,
119 addPatchFields<volSphericalTensorField>
123 defaultPatchFieldType,
126 addPatchFields<volSymmTensorField>
130 defaultPatchFieldType,
133 addPatchFields<volTensorField>
137 defaultPatchFieldType,
143 addPatchFields<surfaceScalarField>
147 defaultPatchFieldType,
150 addPatchFields<surfaceVectorField>
154 defaultPatchFieldType,
157 addPatchFields<surfaceSphericalTensorField>
161 defaultPatchFieldType,
164 addPatchFields<surfaceSymmTensorField>
168 defaultPatchFieldType,
171 addPatchFields<surfaceTensorField>
175 defaultPatchFieldType,
182 for (
label i = 0; i < insertPatchi; i++)
187 for (
label i = insertPatchi; i < sz; i++)
192 oldToNew[sz] = insertPatchi;
195 polyPatches.
reorder(oldToNew, validBoundary);
198 reorderPatchFields<volScalarField>(
mesh, oldToNew);
199 reorderPatchFields<volVectorField>(
mesh, oldToNew);
200 reorderPatchFields<volSphericalTensorField>(
mesh, oldToNew);
201 reorderPatchFields<volSymmTensorField>(
mesh, oldToNew);
202 reorderPatchFields<volTensorField>(
mesh, oldToNew);
203 reorderPatchFields<surfaceScalarField>(
mesh, oldToNew);
204 reorderPatchFields<surfaceVectorField>(
mesh, oldToNew);
205 reorderPatchFields<surfaceSphericalTensorField>(
mesh, oldToNew);
206 reorderPatchFields<surfaceSymmTensorField>(
mesh, oldToNew);
207 reorderPatchFields<surfaceTensorField>(
mesh, oldToNew);
213 void Foam::fvMeshTools::setPatchFields
220 setPatchFields<volScalarField>(
mesh,
patchi, patchFieldDict);
221 setPatchFields<volVectorField>(
mesh,
patchi, patchFieldDict);
222 setPatchFields<volSphericalTensorField>(
mesh,
patchi, patchFieldDict);
223 setPatchFields<volSymmTensorField>(
mesh,
patchi, patchFieldDict);
224 setPatchFields<volTensorField>(
mesh,
patchi, patchFieldDict);
225 setPatchFields<surfaceScalarField>(
mesh,
patchi, patchFieldDict);
226 setPatchFields<surfaceVectorField>(
mesh,
patchi, patchFieldDict);
227 setPatchFields<surfaceSphericalTensorField>
233 setPatchFields<surfaceSymmTensorField>(
mesh,
patchi, patchFieldDict);
234 setPatchFields<surfaceTensorField>(
mesh,
patchi, patchFieldDict);
242 setPatchFields<volSphericalTensorField>
248 setPatchFields<volSymmTensorField>
257 setPatchFields<surfaceSphericalTensorField>
263 setPatchFields<surfaceSymmTensorField>
274 void Foam::fvMeshTools::trimPatches(
fvMesh& mesh,
const label nPatches)
283 if (polyPatches.
empty())
286 <<
"No patches in mesh" 291 for (
label patchi = nPatches; patchi < polyPatches.
size(); patchi++)
300 <<
"There are still " << nFaces
301 <<
" faces in " << polyPatches.
size()-nPatches
311 trimPatchFields<volSphericalTensorField>(
mesh,
nPatches);
317 trimPatchFields<surfaceSphericalTensorField>(
mesh,
nPatches);
318 trimPatchFields<surfaceSymmTensorField>(
mesh,
nPatches);
327 const label nNewPatches,
328 const bool validBoundary
336 polyPatches.
reorder(oldToNew, validBoundary);
339 reorderPatchFields<volScalarField>(
mesh, oldToNew);
340 reorderPatchFields<volVectorField>(
mesh, oldToNew);
341 reorderPatchFields<volSphericalTensorField>(
mesh, oldToNew);
342 reorderPatchFields<volSymmTensorField>(
mesh, oldToNew);
343 reorderPatchFields<volTensorField>(
mesh, oldToNew);
344 reorderPatchFields<surfaceScalarField>(
mesh, oldToNew);
345 reorderPatchFields<surfaceVectorField>(
mesh, oldToNew);
346 reorderPatchFields<surfaceSphericalTensorField>(
mesh, oldToNew);
347 reorderPatchFields<surfaceSymmTensorField>(
mesh, oldToNew);
348 reorderPatchFields<surfaceTensorField>(
mesh, oldToNew);
351 trimPatches(mesh, nNewPatches);
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
void clearOut()
Clear all geometry and addressing.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
bool set(const label) const
Is element set.
A list of keyword definitions, which are a keyword followed by any number of values (e...
void reorder(const labelUList &)
Reorders elements. Ordering does not have to be done in.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool empty() const
Return true if the UPtrList is empty (ie, size() is zero)
label findPatchID(const word &patchName) const
Find patch index given a name.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
A class for handling words, derived from string.
errorManip< error > abort(error &err)
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
label size() const
Return the number of elements in the UPtrList.
Mesh data needed to do the Finite Volume discretisation.
label start() const
Return start label of this patch in the polyMesh face list.
A patch is a list of labels that address the faces in the global face list.
void reorder(const labelUList &, const bool validBoundary)
Reorders patches. Ordering does not have to be done in.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.