40 const Field<Type>& field,
44 tmp<Field<Type>> tfld(
new Field<Type>(addressing.size()));
45 Field<Type>& fld = tfld.ref();
53 ? neighbour[addressing[i] - 1]
54 : owner[- addressing[i] + 1]
65 const Field<Type>& field,
70 tmp<Field<Type>> tfld(
new Field<Type>(addressing.size()));
71 Field<Type>& fld = tfld.ref();
76 (isFlux && addressing[i] < 0 ? -1 : +1)
77 *field[
mag(addressing[i]) - 1];
88 const GeometricField<Type, fvPatchField, volMesh>& field,
89 const bool allowUnknownPatchFields
93 PtrList<fvPatchField<Type>> patchFields(procMesh_.
boundary().
size());
109 tmp<GeometricField<Type, fvPatchField, volMesh>> tresF
111 new GeometricField<Type, fvPatchField, volMesh>
124 Field<Type>(field.primitiveField(), cellAddressing_),
128 GeometricField<Type, fvPatchField, volMesh>& resF = tresF.ref();
132 typename GeometricField<Type, fvPatchField, volMesh>::
133 Boundary& bf = resF.boundaryFieldRef();
136 const fvPatch& procPatch = procMesh_.
boundary()[procPatchi];
138 const label completePatchi = completePatchID(procPatchi);
140 if (completePatchi == procPatchi)
147 field.boundaryField()[completePatchi],
150 patchFieldDecomposers_[procPatchi]
154 else if (isA<processorCyclicFvPatch>(procPatch))
156 if (field.boundaryField()[completePatchi].overridesConstraint())
159 <<
"\nThe field \"" << field.name()
160 <<
"\" on cyclic patch \"" 161 << field.boundaryField()[completePatchi].patch().name()
162 <<
"\" cannot be decomposed as it is not a cyclic " 163 <<
"patch field. A \"patchType cyclic;\" setting has " 164 <<
"been used to override the cyclic patch type.\n\n" 165 <<
"Cyclic patches like this with non-cyclic boundary " 166 <<
"conditions should be confined to a single " 167 <<
"processor using decomposition constraints." 171 const label nbrCompletePatchi =
172 refCast<const processorCyclicFvPatch>(procPatch)
173 .referPatch().nbrPatchID();
178 new processorCyclicFvPatchField<Type>
186 field.primitiveField(),
187 faceAddressingBf_[procPatchi]
192 else if (isA<processorFvPatch>(procPatch))
197 new processorFvPatchField<Type>
203 completeMesh_.
owner(),
205 field.primitiveField(),
206 faceAddressingBf_[procPatchi]
211 else if (allowUnknownPatchFields)
216 new emptyFvPatchField<Type>
238 const GeometricField<Type, fvsPatchField, surfaceMesh>& field
241 const SubList<label> faceAddressingIf
248 PtrList<fvsPatchField<Type>> patchFields(procMesh_.
boundary().
size());
264 tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> tresF
266 new GeometricField<Type, fvsPatchField, surfaceMesh>
288 GeometricField<Type, fvsPatchField, surfaceMesh>& resF = tresF.ref();
292 typename GeometricField<Type, fvsPatchField, surfaceMesh>::
293 Boundary& bf = resF.boundaryFieldRef();
296 const fvPatch& procPatch = procMesh_.
boundary()[procPatchi];
298 const label completePatchi = completePatchID(procPatchi);
300 if (completePatchi == procPatchi)
307 field.boundaryField()[procPatchi],
310 patchFieldDecomposers_[procPatchi]
314 else if (isA<processorCyclicFvPatch>(procPatch))
319 new processorCyclicFvsPatchField<Type>
325 field.boundaryField()[completePatchi],
326 faceAddressingBf_[procPatchi],
332 else if (isA<processorFvPatch>(procPatch))
337 new processorFvsPatchField<Type>
343 field.primitiveField(),
344 faceAddressingBf_[procPatchi],
361 template<
class GeoField>
364 const PtrList<GeoField>& fields
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label nInternalFaces() const
static const char *const typeName
const Time & time() const
Return the top-level database.
UList< label > labelUList
tmp< GeometricField< Type, fvPatchField, volMesh > > decomposeField(const GeometricField< Type, fvPatchField, volMesh > &field, const bool allowUnknownPatchFields=false) const
Decompose volume field.
const labelUList & neighbour() const
Internal face neighbour.
static tmp< fvsPatchField< Type > > New(const word &, const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Return a pointer to a new patchField created on freestore given.
static const DimensionedField< Type, GeoMesh > & null()
Return a null DimensionedField.
static word timeName(const scalar, const int precision=curPrecision_)
Return time name of given scalar time.
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
virtual const labelUList & patchAddr(const label patchNo) const =0
Return patch to internal addressing given patch number.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
static tmp< fvPatchField< Type > > New(const word &, const fvPatch &, const DimensionedField< Type, volMesh > &)
Return a pointer to a new patchField created on freestore given.
errorManip< error > abort(error &err)
const labelUList & owner() const
Internal face owner.
label size() const
Return the number of elements in the UPtrList.
bool isFlux(const DimensionedField< Type, surfaceMesh > &df)
Check if surfaceField is a flux.
dimensioned< scalar > mag(const dimensioned< Type > &)
A class for managing temporary objects.
void decomposeFields(const PtrList< GeoField > &fields) const
Decompose a list of fields.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.