41 const Field<Type>& field,
45 tmp<Field<Type>> tfld(
new Field<Type>(addressing.size()));
46 Field<Type>&
fld = tfld.ref();
54 ? neighbour[addressing[i] - 1]
55 : owner[- addressing[i] - 1]
66 const Field<Type>& field,
71 tmp<Field<Type>> tfld(
new Field<Type>(addressing.size()));
72 Field<Type>&
fld = tfld.ref();
77 (
isFlux && addressing[i] < 0 ? -1 : +1)
78 *field[
mag(addressing[i]) - 1];
87 Foam::fvFieldDecomposer::decomposeVolInternalField
89 const IOobject& fieldIoObject
98 completeMesh_.time().name(),
108 PtrList<typename VolField<Type>::Internal> procFields(procMeshes_.size());
109 forAll(procMeshes_, proci)
119 fieldIoObject.name(),
120 procMeshes_[proci].time().name(),
128 Field<Type>(field.primitiveField(), cellProcAddressing_[proci])
139 Foam::fvFieldDecomposer::decomposeVolField
141 const IOobject& fieldIoObject
145 const VolField<Type> field
149 fieldIoObject.name(),
150 completeMesh_.time().name(),
160 PtrList<VolField<Type>> procFields(procMeshes_.size());
161 forAll(procMeshes_, proci)
164 PtrList<fvPatchField<Type>> patchFields
166 procMeshes_[proci].
boundary().size()
176 procMeshes_[proci].
boundary()[procPatchi],
190 fieldIoObject.name(),
191 procMeshes_[proci].time().name(),
199 Field<Type>(field.primitiveField(), cellProcAddressing_[proci]),
201 field.sources().table()
206 VolField<Type>& vf = procFields[proci];
213 const fvPatch& procPatch =
214 procMeshes_[proci].boundary()[procPatchi];
216 const label completePatchi = completePatchID(proci, procPatchi);
218 if (completePatchi == procPatchi)
225 field.boundaryField()[completePatchi],
228 patchFieldDecomposers_[proci][procPatchi]
232 else if (isA<processorCyclicFvPatch>(procPatch))
234 if (field.boundaryField()[completePatchi].overridesConstraint())
237 str <<
"\nThe field \"" << field.name()
238 <<
"\" on cyclic patch \""
239 << field.boundaryField()[completePatchi].patch().name()
240 <<
"\" cannot be decomposed as it is not a cyclic "
241 <<
"patch field. A \"patchType cyclic;\" setting has "
242 <<
"been used to override the cyclic patch type.\n\n"
243 <<
"Cyclic patches like this with non-cyclic boundary "
244 <<
"conditions should be confined to a single "
245 <<
"processor using decomposition constraints.";
251 const label nbrCompletePatchi =
252 refCast<const processorCyclicFvPatch>(procPatch)
253 .referPatch().nbrPatchIndex();
273 completeMesh_.lduAddr().patchAddr(nbrCompletePatchi),
274 field.primitiveField(),
275 faceProcAddressingBf_[proci][procPatchi]
278 else if (isA<processorFvPatch>(procPatch))
294 completeMesh_.owner(),
295 completeMesh_.neighbour(),
296 field.primitiveField(),
297 faceProcAddressingBf_[proci][procPatchi]
314 Foam::fvFieldDecomposer::decomposeFvSurfaceField
316 const IOobject& fieldIoObject
320 const SurfaceField<Type> field
324 fieldIoObject.name(),
325 completeMesh_.time().name(),
335 PtrList<SurfaceField<Type>> procFields(procMeshes_.size());
336 forAll(procMeshes_, proci)
338 const SubList<label> faceAddressingIf
340 faceProcAddressing_[proci],
341 procMeshes_[proci].nInternalFaces()
345 PtrList<fvsPatchField<Type>> patchFields
347 procMeshes_[proci].
boundary().size()
357 procMeshes_[proci].
boundary()[procPatchi],
367 new SurfaceField<Type>
372 procMeshes_[proci].time().name(),
391 SurfaceField<Type>&
sf = procFields[proci];
398 const fvPatch& procPatch =
399 procMeshes_[proci].boundary()[procPatchi];
401 const label completePatchi = completePatchID(proci, procPatchi);
403 if (completePatchi == procPatchi)
410 field.boundaryField()[procPatchi],
413 patchFieldDecomposers_[proci][procPatchi]
417 else if (isA<processorCyclicFvPatch>(procPatch))
422 new processorCyclicFvsPatchField<Type>
428 field.boundaryField()[completePatchi],
429 faceProcAddressingBf_[proci][procPatchi],
435 else if (isA<processorFvPatch>(procPatch))
440 new processorFvsPatchField<Type>
446 field.primitiveField(),
447 faceProcAddressingBf_[proci][procPatchi],
479 Info<<
nl <<
" Decomposing " << fieldClassName <<
"s" <<
nl <<
endl;
483 Info<<
" " << fieldIter()->name() <<
endl;
485 PtrList<typename VolField<Type>::Internal> procFields =
486 decomposeVolInternalField<Type>(*fieldIter());
490 procFields[proci].write();
509 Info<<
nl <<
" Decomposing " << fieldClassName <<
"s" <<
nl <<
endl;
513 Info<<
" " << fieldIter()->name() <<
endl;
515 PtrList<VolField<Type>> procFields =
516 decomposeVolField<Type>(*fieldIter());
520 procFields[proci].write();
539 Info<<
nl <<
" Decomposing " << fieldClassName <<
"s" <<
nl <<
endl;
543 Info<<
" " << fieldIter()->name() <<
endl;
545 PtrList<SurfaceField<Type>> procFields =
546 decomposeFvSurfaceField<Type>(*fieldIter());
550 procFields[proci].write();
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
static const DimensionedField< Type, GeoMesh > & null()
Return a null DimensionedField.
static const char *const typeName
DimensionedField< Type, GeoMesh > Internal
Type of the internal field from which this GeometricField is derived.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of the boundary field.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
void decomposeVolFields(const IOobjectList &objects)
Read, decompose and write all volume fields.
void decomposeFvSurfaceFields(const IOobjectList &objects)
Read, decompose and write all surface fields.
void decomposeVolInternalFields(const IOobjectList &objects)
Read, decompose and write all volume internal fields.
static tmp< fvPatchField< Type > > New(const word &, const fvPatch &, const DimensionedField< Type, volMesh > &)
Return a pointer to a new patchField created on freestore given.
static tmp< fvsPatchField< Type > > New(const word &, const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Return a pointer to a new patchField created on freestore given.
A class for managing temporary objects.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
volScalarField sf(fieldObject, mesh)
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Info<< "Calculating turbulent flame speed field St\n"<< endl;volScalarField St(IOobject("St", runTime.name(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), flameWrinkling->Xi() *Su);multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
string breakIntoIndentedLines(const string &str, const string::size_type nLength=80, const string::size_type nIndent=0)
Break a string up into indented lines.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
bool isFlux(const DimensionedField< Type, surfaceMesh > &df)
Check if surfaceField is a flux.
dimensioned< scalar > mag(const dimensioned< Type > &)
UList< label > labelUList
faceListList boundary(nPatches)