38 void Foam::fvFieldReconstructor::rmapFaceToFace
41 const Field<Type>& fromField,
48 toField[
mag(addressing[i]) - 1] =
49 (isFlux && addressing[i] < 0 ? -1 : +1)*fromField[i];
60 const IOobject& fieldIoObject,
61 const PtrList<DimensionedField<Type, volMesh>>& procFields
65 Field<Type> internalField(completeMesh_.
nCells());
69 const DimensionedField<Type, volMesh>& procField = procFields[proci];
75 cellProcAddressing_[proci]
79 return tmp<DimensionedField<Type, volMesh>>
81 new DimensionedField<Type, volMesh>
85 procFields[0].dimensions(),
96 const IOobject& fieldIoObject
99 PtrList<DimensionedField<Type, volMesh>>
100 procFields(procMeshes_.size());
102 forAll(procMeshes_, proci)
107 new DimensionedField<Type, volMesh>
111 fieldIoObject.name(),
112 procMeshes_[proci].time().timeName(),
127 fieldIoObject.name(),
143 const IOobject& fieldIoObject,
144 const PtrList<GeometricField<Type, fvPatchField, volMesh>>& procFields
148 Field<Type> internalField(completeMesh_.
nCells());
151 PtrList<fvPatchField<Type>> patchFields(completeMesh_.
boundary().
size());
155 const GeometricField<Type, fvPatchField, volMesh>& procField =
161 procField.primitiveField(),
162 cellProcAddressing_[proci]
166 forAll(procField.boundaryField(), procPatchi)
168 const fvPatch& procPatch =
169 procMeshes_[proci].boundary()[procPatchi];
171 const label completePatchi = completePatchID(proci, procPatchi);
173 if (completePatchi == procPatchi)
175 if (!patchFields(completePatchi))
182 procField.boundaryField()[procPatchi],
183 completeMesh_.
boundary()[completePatchi],
185 fvPatchFieldReconstructor
193 patchFields[completePatchi].rmap
195 procField.boundaryField()[procPatchi],
196 faceProcAddressingBf_[proci][procPatchi] - 1
199 else if (isA<processorCyclicFvPatch>(procPatch))
201 if (!patchFields(completePatchi))
208 completeMesh_.
boundary()[completePatchi].type(),
209 completeMesh_.
boundary()[completePatchi],
215 if (patchFields[completePatchi].overridesConstraint())
218 <<
"\nThe field \"" << procFields[0].name()
219 <<
"\" on cyclic patch \"" 220 << patchFields[completePatchi].patch().name()
221 <<
"\" cannot be reconstructed as it is not a cyclic " 222 <<
"patch field. A \"patchType cyclic;\" setting has " 223 <<
"been used to override the cyclic patch type.\n\n" 224 <<
"Cyclic patches like this with non-cyclic boundary " 225 <<
"conditions should be confined to a single " 226 <<
"processor using decomposition constraints." 230 patchFields[completePatchi].rmap
232 procField.boundaryField()[procPatchi],
233 faceProcAddressingBf_[proci][procPatchi] - 1
240 return tmp<GeometricField<Type, fvPatchField, volMesh>>
242 new GeometricField<Type, fvPatchField, volMesh>
246 procFields[0].dimensions(),
258 const IOobject& fieldIoObject
261 PtrList<GeometricField<Type, fvPatchField, volMesh>>
262 procFields(procMeshes_.size());
264 forAll(procMeshes_, proci)
269 new GeometricField<Type, fvPatchField, volMesh>
273 fieldIoObject.name(),
274 procMeshes_[proci].time().timeName(),
289 fieldIoObject.name(),
305 const IOobject& fieldIoObject,
306 const PtrList<GeometricField<Type, fvsPatchField, surfaceMesh>>& procFields
313 PtrList<fvsPatchField<Type>> patchFields(completeMesh_.
boundary().
size());
315 forAll(procMeshes_, proci)
317 const GeometricField<Type, fvsPatchField, surfaceMesh>& procField =
324 procField.primitiveField(),
327 faceProcAddressing_[proci],
328 procMeshes_[proci].nInternalFaces()
334 forAll(procField.boundaryField(), procPatchi)
336 const fvPatch& procPatch =
337 procMeshes_[proci].boundary()[procPatchi];
339 const label completePatchi = completePatchID(proci, procPatchi);
341 if (completePatchi == procPatchi)
343 if (!patchFields(completePatchi))
350 procField.boundaryField()[procPatchi],
351 completeMesh_.
boundary()[completePatchi],
353 fvPatchFieldReconstructor
361 patchFields[completePatchi].rmap
363 procField.boundaryField()[procPatchi],
364 faceProcAddressingBf_[proci][procPatchi] - 1
367 else if (isA<processorCyclicFvPatch>(procPatch))
369 if (!patchFields(completePatchi))
376 completeMesh_.
boundary()[completePatchi].type(),
377 completeMesh_.
boundary()[completePatchi],
383 patchFields[completePatchi].rmap
385 procField.boundaryField()[procPatchi],
386 faceProcAddressingBf_[proci][procPatchi] - 1
389 else if (isA<processorFvPatch>(procPatch))
394 procField.boundaryField()[procPatchi],
395 faceProcAddressingBf_[proci][procPatchi],
403 return tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
405 new GeometricField<Type, fvsPatchField, surfaceMesh>
409 procFields[0].dimensions(),
421 const IOobject& fieldIoObject
424 PtrList<GeometricField<Type, fvsPatchField, surfaceMesh>>
425 procFields(procMeshes_.size());
427 forAll(procMeshes_, proci)
432 new GeometricField<Type, fvsPatchField, surfaceMesh>
436 fieldIoObject.name(),
437 procMeshes_[proci].time().timeName(),
452 fieldIoObject.name(),
467 const IOobjectList& objects,
468 const HashSet<word>& selectedFields
473 IOobjectList fields = objects.lookupClass(fieldClassName);
477 Info<<
" Reconstructing " << fieldClassName <<
"s\n" <<
endl;
483 selectedFields.empty()
484 || selectedFields.found(fieldIter()->
name())
487 Info<<
" " << fieldIter()->name() <<
endl;
489 reconstructFvVolumeInternalField<Type>(*fieldIter())().
write();
502 const IOobjectList& objects,
503 const HashSet<word>& selectedFields
506 const word& fieldClassName =
509 IOobjectList fields = objects.lookupClass(fieldClassName);
513 Info<<
" Reconstructing " << fieldClassName <<
"s\n" <<
endl;
519 selectedFields.empty()
520 || selectedFields.found(fieldIter()->
name())
523 Info<<
" " << fieldIter()->name() <<
endl;
525 reconstructFvVolumeField<Type>(*fieldIter())().
write();
538 const IOobjectList& objects,
539 const HashSet<word>& selectedFields
542 const word& fieldClassName =
545 IOobjectList fields = objects.lookupClass(fieldClassName);
549 Info<<
" Reconstructing " << fieldClassName <<
"s\n" <<
endl;
555 selectedFields.empty()
556 || selectedFields.found(fieldIter()->
name())
559 Info<<
" " << fieldIter()->name() <<
endl;
561 reconstructFvSurfaceField<Type>(*fieldIter())().
write();
#define forAll(list, i)
Loop across all elements in list.
virtual Ostream & write(const char)=0
Write character.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
tmp< GeometricField< Type, fvPatchField, volMesh > > reconstructFvVolumeField(const IOobject &fieldIoObject, const PtrList< GeometricField< Type, fvPatchField, volMesh >> &) const
Reconstruct volume field.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
label nInternalFaces() const
static const char *const typeName
void reconstructFvSurfaceFields(const IOobjectList &objects, const HashSet< word > &selectedFields)
Read, reconstruct and write all/selected surface fields.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Time & time() const
Return the top-level database.
UList< label > labelUList
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.
static tmp< fvPatchField< Type > > New(const word &, const fvPatch &, const DimensionedField< Type, volMesh > &)
Return a pointer to a new patchField created on freestore given.
word name(const complex &)
Return a string representation of a complex.
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 > &)
tmp< DimensionedField< Type, volMesh > > reconstructFvVolumeInternalField(const IOobject &fieldIoObject, const PtrList< DimensionedField< Type, volMesh >> &procFields) const
Reconstruct volume internal field.
void reconstructFvVolumeFields(const IOobjectList &objects, const HashSet< word > &selectedFields)
Read, reconstruct and write all/selected volume fields.
A class for managing temporary objects.
void reconstructFvVolumeInternalFields(const IOobjectList &objects, const HashSet< word > &selectedFields)
Read, reconstruct and write all/selected volume internal fields.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > reconstructFvSurfaceField(const IOobject &fieldIoObject, const PtrList< GeometricField< Type, fvsPatchField, surfaceMesh >> &) const
Reconstruct surface field.