40 void Foam::fvFieldReconstructor::rmapFaceToFace
43 const Field<Type>& fromField,
50 toField[
mag(addressing[i]) - 1] =
51 (
isFlux && addressing[i] < 0 ? -1 : +1)*fromField[i];
62 const IOobject& fieldIoObject,
63 const PtrList<DimensionedField<Type, volMesh>>& procFields
67 Field<Type> internalField(completeMesh_.nCells());
71 const DimensionedField<Type, volMesh>& procField = procFields[proci];
77 cellProcAddressing_[proci]
81 return tmp<DimensionedField<Type, volMesh>>
83 new DimensionedField<Type, volMesh>
87 procFields[0].dimensions(),
98 const IOobject& fieldIoObject
101 PtrList<DimensionedField<Type, volMesh>>
102 procFields(procMeshes_.size());
104 forAll(procMeshes_, proci)
109 new DimensionedField<Type, volMesh>
113 fieldIoObject.name(),
114 procMeshes_[proci].time().name(),
125 return reconstructFvVolumeInternalField
129 fieldIoObject.name(),
130 completeMesh_.time().name(),
145 const IOobject& fieldIoObject,
146 const PtrList<VolField<Type>>& procFields
150 Field<Type> internalField(completeMesh_.nCells());
153 PtrList<fvPatchField<Type>> patchFields(completeMesh_.boundary().size());
157 const VolField<Type>& procField =
163 procField.primitiveField(),
164 cellProcAddressing_[proci]
168 forAll(procField.boundaryField(), procPatchi)
170 const fvPatch& procPatch =
171 procMeshes_[proci].boundary()[procPatchi];
173 const label completePatchi = completePatchID(proci, procPatchi);
175 if (completePatchi == procPatchi)
177 if (!patchFields(completePatchi))
184 procField.boundaryField()[procPatchi],
185 completeMesh_.boundary()[completePatchi],
187 setSizeFvPatchFieldMapper
189 completeMesh_.boundary()[completePatchi].size()
195 patchFields[completePatchi].map
197 procField.boundaryField()[procPatchi],
198 reverseFvPatchFieldMapper
200 faceProcAddressingBf_[proci][procPatchi] - 1
204 else if (isA<processorCyclicFvPatch>(procPatch))
206 if (!patchFields(completePatchi))
213 completeMesh_.boundary()[completePatchi].type(),
214 completeMesh_.boundary()[completePatchi],
220 if (patchFields[completePatchi].overridesConstraint())
223 str <<
"\nThe field \"" << procFields[0].name()
224 <<
"\" on cyclic patch \""
225 << patchFields[completePatchi].patch().name()
226 <<
"\" cannot be reconstructed as it is not a cyclic "
227 <<
"patch field. A \"patchType cyclic;\" setting has "
228 <<
"been used to override the cyclic patch type.\n\n"
229 <<
"Cyclic patches like this with non-cyclic boundary "
230 <<
"conditions should be confined to a single "
231 <<
"processor using decomposition constraints.";
237 patchFields[completePatchi].map
239 procField.boundaryField()[procPatchi],
240 reverseFvPatchFieldMapper
242 faceProcAddressingBf_[proci][procPatchi] - 1
250 return tmp<VolField<Type>>
256 procFields[0].dimensions(),
268 const IOobject& fieldIoObject
271 PtrList<VolField<Type>>
272 procFields(procMeshes_.size());
274 forAll(procMeshes_, proci)
283 fieldIoObject.name(),
284 procMeshes_[proci].time().name(),
295 return reconstructFvVolumeField
299 fieldIoObject.name(),
300 completeMesh_.time().name(),
315 const IOobject& fieldIoObject,
316 const PtrList<SurfaceField<Type>>& procFields
320 Field<Type> internalField(completeMesh_.nInternalFaces());
323 PtrList<fvsPatchField<Type>> patchFields(completeMesh_.boundary().size());
325 forAll(procMeshes_, proci)
327 const SurfaceField<Type>& procField =
334 procField.primitiveField(),
337 faceProcAddressing_[proci],
338 procMeshes_[proci].nInternalFaces()
344 forAll(procField.boundaryField(), procPatchi)
346 const fvPatch& procPatch =
347 procMeshes_[proci].boundary()[procPatchi];
349 const label completePatchi = completePatchID(proci, procPatchi);
351 if (completePatchi == procPatchi)
353 if (!patchFields(completePatchi))
360 procField.boundaryField()[procPatchi],
361 completeMesh_.boundary()[completePatchi],
363 setSizeFvPatchFieldMapper
365 completeMesh_.boundary()[completePatchi].size()
371 patchFields[completePatchi].map
373 procField.boundaryField()[procPatchi],
374 reverseFvPatchFieldMapper
376 faceProcAddressingBf_[proci][procPatchi] - 1
380 else if (isA<processorCyclicFvPatch>(procPatch))
382 if (!patchFields(completePatchi))
389 completeMesh_.boundary()[completePatchi].type(),
390 completeMesh_.boundary()[completePatchi],
396 patchFields[completePatchi].map
398 procField.boundaryField()[procPatchi],
399 reverseFvPatchFieldMapper
401 faceProcAddressingBf_[proci][procPatchi] - 1
405 else if (isA<processorFvPatch>(procPatch))
410 procField.boundaryField()[procPatchi],
411 faceProcAddressingBf_[proci][procPatchi],
419 return tmp<SurfaceField<Type>>
421 new SurfaceField<Type>
425 procFields[0].dimensions(),
437 const IOobject& fieldIoObject
440 PtrList<SurfaceField<Type>>
441 procFields(procMeshes_.size());
443 forAll(procMeshes_, proci)
448 new SurfaceField<Type>
452 fieldIoObject.name(),
453 procMeshes_[proci].time().name(),
464 return reconstructFvSurfaceField
468 fieldIoObject.name(),
469 completeMesh_.time().name(),
484 const HashSet<word>& selectedFields
493 Info<<
" Reconstructing " << fieldClassName <<
"s\n" <<
endl;
499 selectedFields.empty()
500 || selectedFields.found(fieldIter()->
name())
503 Info<<
" " << fieldIter()->name() <<
endl;
505 reconstructFvVolumeInternalField<Type>(*fieldIter())().
write();
519 const HashSet<word>& selectedFields
522 const word& fieldClassName =
529 Info<<
" Reconstructing " << fieldClassName <<
"s\n" <<
endl;
535 selectedFields.empty()
536 || selectedFields.found(fieldIter()->
name())
539 Info<<
" " << fieldIter()->name() <<
endl;
541 reconstructFvVolumeField<Type>(*fieldIter())().
write();
555 const HashSet<word>& selectedFields
558 const word& fieldClassName =
565 Info<<
" Reconstructing " << fieldClassName <<
"s\n" <<
endl;
571 selectedFields.empty()
572 || selectedFields.found(fieldIter()->
name())
575 Info<<
" " << fieldIter()->name() <<
endl;
577 reconstructFvSurfaceField<Type>(*fieldIter())().
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
tmp< SurfaceField< Type > > reconstructFvSurfaceField(const IOobject &fieldIoObject, const PtrList< SurfaceField< Type >> &) const
Reconstruct surface field.
void reconstructFvVolumeInternalFields(const IOobjectList &objects, const HashSet< word > &selectedFields)
Read, reconstruct and write all/selected volume internal fields.
void reconstructFvVolumeFields(const IOobjectList &objects, const HashSet< word > &selectedFields)
Read, reconstruct and write all/selected volume fields.
tmp< DimensionedField< Type, volMesh > > reconstructFvVolumeInternalField(const IOobject &fieldIoObject, const PtrList< DimensionedField< Type, volMesh >> &procFields) const
Reconstruct volume internal field.
tmp< VolField< Type > > reconstructFvVolumeField(const IOobject &fieldIoObject, const PtrList< VolField< Type >> &) const
Reconstruct volume field.
void reconstructFvSurfaceFields(const IOobjectList &objects, const HashSet< word > &selectedFields)
Read, reconstruct and write all/selected surface 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.
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.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
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.
bool isFlux(const DimensionedField< Type, surfaceMesh > &df)
Check if surfaceField is a flux.
dimensioned< scalar > mag(const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
UList< label > labelUList