31 template<
class GeoField>
38 const GeoField& field =
fields[i];
40 Pout<<
"Field:" << field.
name() <<
" internal size:" << field.size()
46 <<
' ' << field.boundaryField()[
patchi].patch().name()
47 <<
' ' << field.boundaryField()[
patchi].type()
48 <<
' ' << field.boundaryField()[
patchi].size()
55 template<
class Type,
class Mesh>
56 void Foam::fvMeshDistribute::saveBoundaryFields
68 bfields.setSize(
fields.size());
79 template<
class Type,
class Mesh>
80 void Foam::fvMeshDistribute::mapBoundaryFields
82 const polyTopoChangeMap& map,
83 const PtrList<FieldField<fvsPatchField, Type>>& oldBfields
88 const labelList& oldPatchStarts = map.oldPatchStarts();
91 UPtrList<SurfaceField<Type>>
fields
93 mesh_.fields<SurfaceField<Type>>()
98 SurfaceField<Type>& field =
fields[i];
100 field.boundaryFieldRef();
102 const FieldField<fvsPatchField, Type>& oldBfield = oldBfields[i];
108 fvsPatchField<Type>& patchField = bfield[
patchi];
109 label facei = patchField.patch().start();
116 forAll(oldPatchStarts, oldPatchi)
118 label oldLocalI = oldFacei - oldPatchStarts[oldPatchi];
123 && oldLocalI < oldBfield[oldPatchi].size()
126 patchField[i] = oldBfield[oldPatchi][oldLocalI];
136 void Foam::fvMeshDistribute::initMapExposedFaces
138 PtrList<Field<Type>>& ifields
141 const UPtrList<SurfaceField<Type>>
fields
143 mesh_.fields<SurfaceField<Type>>()
146 ifields.setSize(
fields.size());
150 ifields.set(i, Field<Type>(mesh_.nFaces()));
152 const SurfaceField<Type>& field =
fields[i];
154 SubList<Type>(ifields[i], field.primitiveField().size()) =
155 field.primitiveField();
159 const fvsPatchField<Type>& pfield = field.boundaryField()[
patchi];
161 SubList<Type>(ifields[i], pfield.size(), pfield.patch().start()) =
169 void Foam::fvMeshDistribute::mapExposedFaces
171 const polyTopoChangeMap& map,
172 const PtrList<Field<Type>>& oldFields
175 UPtrList<SurfaceField<Type>>
fields
177 mesh_.fields<SurfaceField<Type>>()
182 SurfaceField<Type>& field =
fields[i];
184 const Field<Type>& oldField = oldFields[i];
186 const bool negateIfFlipped =
isFlux(field);
190 fvsPatchField<Type>& patchField = field.boundaryFieldRef()[
patchi];
194 const label facei = patchField.patch().start()+i;
195 const label oldFacei = map.faceMap()[facei];
197 if (oldFacei < map.nOldInternalFaces())
199 if (negateIfFlipped && map.flipFaceFlux().found(facei))
201 patchField[i] = flipOp()(oldField[oldFacei]);
205 patchField[i] = oldField[oldFacei];
210 patchField[i] = oldField[oldFacei];
218 template<
class GeoField>
219 void Foam::fvMeshDistribute::correctCoupledPatchFields()
221 UPtrList<GeoField>
fields(mesh_.fields<GeoField>());
228 GeoField& field =
fields[i];
230 typename GeoField::Boundary& bfield = field.boundaryFieldRef();
242 if (bfield[
patchi].coupled())
260 if (bfield[
patchi].coupled())
269 mesh_.globalData().patchSchedule();
271 forAll(patchSchedule, patchEvali)
273 if (bfield[patchEvali].coupled())
275 if (patchSchedule[patchEvali].init)
277 bfield[patchSchedule[patchEvali].patch]
282 bfield[patchSchedule[patchEvali].patch]
292 template<
class GeoField>
293 void Foam::fvMeshDistribute::sendFields
297 const fvMeshSubset& subsetter,
326 <<
" for domain:" << domain <<
endl;
331 const GeoField& field =
332 subsetter.baseMesh().lookupObject<GeoField>(
fieldNames[i]);
334 tmp<GeoField> tsubfield = subsetter.interpolate(field);
345 template<
class GeoField>
346 void Foam::fvMeshDistribute::receiveFields
350 typename GeoField::Mesh& mesh,
351 PtrList<GeoField>&
fields,
352 const dictionary& fieldDicts
358 <<
" from domain:" << domain <<
endl;
368 <<
" from domain:" << domain <<
endl;
379 mesh.thisDb().time().name(),
#define forAll(list, i)
Loop across all elements in list.
tmp< FieldField< Field, Type > > clone() const
Clone.
Generic GeometricField class.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of the boundary field.
const Boundary & boundaryField() const
Return const-reference to 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...
static void printFieldInfo(const fvMesh &)
Print some field info.
Mesh data needed to do the Finite Volume discretisation.
UPtrList< GeoField > fields(const bool strict=false) const
Return the list of fields of type GeoField.
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")