26 #include "parFvFieldReconstructor.H"
38 #include "distributedUnallocatedDirectFieldMapper.H"
39 #include "distributedUnallocatedDirectFvPatchFieldMapper.H"
47 const DimensionedField<Type, volMesh>&
fld
50 distributedUnallocatedDirectFieldMapper mapper
69 return tmp<DimensionedField<Type, volMesh> >
71 new DimensionedField<Type, volMesh>
86 const IOobject& fieldIoObject
90 DimensionedField<Type, volMesh>
fld
97 return reconstructFvVolumeInternalField(
fld);
106 const GeometricField<Type, fvPatchField, volMesh>&
fld
112 distributedUnallocatedDirectFieldMapper mapper
126 PtrList<fvPatchField<Type> > patchFields(
fld.mesh().boundary().size());
128 const typename GeometricField
133 >::GeometricBoundaryField& bfld =
fld.boundaryField();
137 if (patchFaceMaps_.set(patchI))
140 patchFields.set(patchI, bfld[patchI].clone());
142 distributedUnallocatedDirectFvPatchFieldMapper mapper
145 patchFaceMaps_[patchI]
149 patchFields[patchI].autoMap(mapper);
154 PtrList<fvPatchField<Type> > basePatchFields
156 baseMesh_.boundary().size()
161 forAll(patchFields, patchI)
163 if (patchFields.set(patchI))
165 const fvPatch& basePatch = baseMesh_.boundary()[patchI];
167 const fvPatchField<Type>& pfld = patchFields[patchI];
170 directFvPatchFieldMapper dummyMapper(dummyMap);
188 forAll(basePatchFields, patchI)
190 if (patchI >= patchFields.size() || !patchFields.set(patchI))
197 emptyFvPatchField<Type>::typeName,
198 baseMesh_.boundary()[patchI],
209 baseMesh_.time().timeName(),
216 return tmp<GeometricField<Type, fvPatchField, volMesh> >
218 new GeometricField<Type, fvPatchField, volMesh>
234 const IOobject& fieldIoObject
238 GeometricField<Type, fvPatchField, volMesh>
fld
245 return reconstructFvVolumeField(
fld);
253 const GeometricField<Type, fvsPatchField, surfaceMesh>&
fld
259 distributedUnallocatedDirectFieldMapper mapper
266 Field<Type> flatFld(
fld.mesh().nFaces(), pTraits<Type>::zero);
267 SubList<Type>(flatFld,
fld.internalField().size()).assign
273 const fvsPatchField<Type>& fvp =
fld.boundaryField()[patchI];
275 SubList<Type>(flatFld, fvp.size(), fvp.patch().start()).assign(fvp);
287 baseMesh_.nInternalFaces()
296 PtrList<fvsPatchField<Type> > patchFields(
fld.mesh().boundary().size());
298 const typename GeometricField
303 >::GeometricBoundaryField& bfld =
fld.boundaryField();
307 if (patchFaceMaps_.set(patchI))
310 patchFields.set(patchI, bfld[patchI].clone());
312 distributedUnallocatedDirectFvPatchFieldMapper mapper
315 patchFaceMaps_[patchI]
319 patchFields[patchI].autoMap(mapper);
324 PtrList<fvsPatchField<Type> > basePatchFields
326 baseMesh_.boundary().size()
331 forAll(patchFields, patchI)
333 if (patchFields.set(patchI))
335 const fvPatch& basePatch = baseMesh_.boundary()[patchI];
337 const fvsPatchField<Type>& pfld = patchFields[patchI];
340 directFvPatchFieldMapper dummyMapper(dummyMap);
358 forAll(basePatchFields, patchI)
360 if (patchI >= patchFields.size() || !patchFields.set(patchI))
367 emptyFvsPatchField<Type>::typeName,
368 baseMesh_.boundary()[patchI],
379 baseMesh_.time().timeName(),
386 return tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
388 new GeometricField<Type, fvsPatchField, surfaceMesh>
404 const IOobject& fieldIoObject
408 GeometricField<Type, fvsPatchField, surfaceMesh>
fld
414 return reconstructFvSurfaceField(
fld);
421 const IOobjectList& objects,
422 const HashSet<word>& selectedFields
425 const word& fieldClassName = DimensionedField<Type, volMesh>::typeName;
427 IOobjectList
fields = objects.lookupClass(fieldClassName);
431 Info<<
" Reconstructing " << fieldClassName <<
"s\n" <<
endl;
437 selectedFields.empty()
438 || selectedFields.found(fieldIter()->
name())
441 Info<<
" " << fieldIter()->name() <<
endl;
443 tmp<DimensionedField<Type, volMesh> > tfld
445 reconstructFvVolumeInternalField<Type>(*fieldIter())
462 const IOobjectList& objects,
463 const HashSet<word>& selectedFields
466 const word& fieldClassName =
467 GeometricField<Type, fvPatchField, volMesh>::typeName;
469 IOobjectList
fields = objects.lookupClass(fieldClassName);
473 Info<<
" Reconstructing " << fieldClassName <<
"s\n" <<
endl;
477 const word&
name = fieldIter()->name();
481 (selectedFields.empty() || selectedFields.found(
name))
482 &&
name !=
"cellDist"
487 tmp<GeometricField<Type, fvPatchField, volMesh> > tfld
489 reconstructFvVolumeField<Type>(*fieldIter())
505 const IOobjectList& objects,
506 const HashSet<word>& selectedFields
509 const word& fieldClassName =
510 GeometricField<Type, fvsPatchField, surfaceMesh>::typeName;
512 IOobjectList
fields = objects.lookupClass(fieldClassName);
516 Info<<
" Reconstructing " << fieldClassName <<
"s\n" <<
endl;
522 selectedFields.empty()
523 || selectedFields.found(fieldIter()->
name())
526 Info<<
" " << fieldIter()->name() <<
endl;
528 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tfld
530 reconstructFvSurfaceField<Type>(*fieldIter())