31 template<
class GeoField>
41 const GeoField& field =
fields[i];
43 Pout<<
"Field:" << field.
name() <<
" internal size:" << field.size()
49 <<
' ' << field.boundaryField()[
patchi].patch().name()
50 <<
' ' << field.boundaryField()[
patchi].type()
51 <<
' ' << field.boundaryField()[
patchi].size()
58 template<
class Type,
class Mesh>
59 void Foam::fvMeshDistribute::saveBoundaryFields
71 bfields.setSize(
fields.size());
82 template<
class Type,
class Mesh>
83 void Foam::fvMeshDistribute::mapBoundaryFields
85 const polyTopoChangeMap& map,
86 const PtrList<FieldField<surfaceMesh::PatchField, Type>>& oldBfields
91 const labelList& oldPatchStarts = map.oldPatchStarts();
94 UPtrList<SurfaceField<Type>>
fields
101 SurfaceField<Type>& field =
fields[i];
104 field.boundaryFieldRef();
106 const FieldField<surfaceMesh::PatchField, Type>& oldBfield =
113 fvsPatchField<Type>& patchField = bfield[
patchi];
114 label facei = patchField.patch().start();
121 forAll(oldPatchStarts, oldPatchi)
123 label oldLocalI = oldFacei - oldPatchStarts[oldPatchi];
128 && oldLocalI < oldBfield[oldPatchi].size()
131 patchField[i] = oldBfield[oldPatchi][oldLocalI];
141 void Foam::fvMeshDistribute::initMapExposedFaces
143 PtrList<Field<Type>>& ifields
146 const UPtrList<SurfaceField<Type>>
fields
151 ifields.setSize(
fields.size());
155 ifields.set(i, Field<Type>(mesh_.nFaces()));
157 const SurfaceField<Type>& field =
fields[i];
159 SubList<Type>(ifields[i], field.primitiveField().size()) =
160 field.primitiveField();
164 const fvsPatchField<Type>& pfield = field.boundaryField()[
patchi];
166 SubList<Type>(ifields[i], pfield.size(), pfield.patch().start()) =
174 void Foam::fvMeshDistribute::mapExposedFaces
176 const polyTopoChangeMap& map,
177 const PtrList<Field<Type>>& oldFields
180 UPtrList<SurfaceField<Type>>
fields
187 SurfaceField<Type>& field =
fields[i];
189 const Field<Type>& oldField = oldFields[i];
191 const bool negateIfFlipped =
isFlux(field);
195 fvsPatchField<Type>& patchField = field.boundaryFieldRef()[
patchi];
199 const label facei = patchField.patch().start()+i;
200 const label oldFacei = map.faceMap()[facei];
202 if (oldFacei < map.nOldInternalFaces())
204 if (negateIfFlipped && map.flipFaceFlux().found(facei))
206 patchField[i] = flipOp()(oldField[oldFacei]);
210 patchField[i] = oldField[oldFacei];
215 patchField[i] = oldField[oldFacei];
223 template<
class GeoField>
224 void Foam::fvMeshDistribute::correctCoupledPatchFields()
236 GeoField& field =
fields[i];
238 typename GeoField::Boundary& bfield = field.boundaryFieldRef();
250 if (bfield[
patchi].coupled())
268 if (bfield[
patchi].coupled())
277 mesh_.globalData().patchSchedule();
279 forAll(patchSchedule, patchEvali)
281 if (bfield[patchEvali].coupled())
283 if (patchSchedule[patchEvali].init)
285 bfield[patchSchedule[patchEvali].patch]
290 bfield[patchSchedule[patchEvali].patch]
300 template<
class GeoField>
301 void Foam::fvMeshDistribute::sendFields
305 const fvMeshSubset& subsetter,
334 <<
" for domain:" << domain <<
endl;
339 const GeoField& field =
340 subsetter.baseMesh().lookupObject<GeoField>(
fieldNames[i]);
342 tmp<GeoField> tsubfield = subsetter.interpolate(field);
353 template<
class GeoField>
354 void Foam::fvMeshDistribute::receiveFields
358 typename GeoField::Mesh&
mesh,
359 PtrList<GeoField>&
fields,
360 const dictionary& fieldDicts
366 <<
" from domain:" << domain <<
endl;
376 <<
" from domain:" << domain <<
endl;
#define forAll(list, i)
Loop across all elements in list.
tmp< FieldField< Field, Type > > clone() const
Clone.
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
GeometricBoundaryField< Type, GeoMesh, PrimitiveField > Boundary
Type of the boundary field.
void size(const label)
Override size to be inconsistent with allocated storage.
virtual const fileName & name() const
Return the name of the stream.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
static label nRequests()
Get number of outstanding requests.
static void waitRequests(const label start=0)
Wait until all requests (from start onwards) have finished.
static bool & parRun()
Is this a parallel run?
static commsTypes defaultCommsType
Default commsType.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
const word & name() const
Return const reference to name.
static void printFieldInfo(const fvMesh &)
Print some field info.
Mesh data needed to do the Finite Volume discretisation.
static const HashSet< word > curGeometryFields
Set of names of registered current-time geometric fields.
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
UPtrList< GeoField > fields(bool strict=false, const HashSet< word > &geometryFields=fvMesh::geometryFields) const
Return the list of fields of type GeoField.
const Time & time() const
Return time.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
static List< word > fieldNames
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
List< word > wordList
A List of words.
List< label > labelList
A List of labels.
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.
List< lduScheduleEntry > lduSchedule
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
prefixOSstream Pout(cout, "Pout")