30 template<
class GeoField>
35 mesh.objectRegistry::lookupClass<GeoField>()
40 const GeoField&
fld = *iter();
42 Pout<<
"Field:" << iter.key() <<
" internalsize:" << fld.size()
49 <<
' ' << fld.boundaryField()[
patchi].patch().name()
50 <<
' ' << fld.boundaryField()[
patchi].type()
51 <<
' ' << fld.boundaryField()[
patchi].size()
58 template<
class T,
class Mesh>
59 void Foam::fvMeshDistribute::saveBoundaryFields
70 static_cast<const fvMesh&>(mesh_).objectRegistry::lookupClass<fldType>()
73 bflds.setSize(flds.
size());
79 const fldType&
fld = *iter();
81 bflds.set(i, fld.boundaryField().clone().ptr());
88 template<
class T,
class Mesh>
89 void Foam::fvMeshDistribute::mapBoundaryFields
104 mesh_.objectRegistry::lookupClass<fldType>()
107 if (flds.
size() != oldBflds.size())
117 fldType&
fld = *iter();
118 typename fldType::Boundary& bfld =
119 fld.boundaryFieldRef();
132 label oldFacei = faceMap[facei++];
135 forAll(oldPatchStarts, oldPatchi)
137 label oldLocalI = oldFacei - oldPatchStarts[oldPatchi];
139 if (oldLocalI >= 0 && oldLocalI < oldBfld[oldPatchi].size())
141 patchFld[i] = oldBfld[oldPatchi][oldLocalI];
151 void Foam::fvMeshDistribute::saveInternalFields
160 static_cast<const fvMesh&>(mesh_).objectRegistry::lookupClass<fldType>()
163 iflds.setSize(flds.
size());
169 const fldType&
fld = *iter();
171 iflds.set(i, fld.primitiveField().clone());
179 void Foam::fvMeshDistribute::mapExposedFaces
193 mesh_.objectRegistry::lookupClass<fldType>()
196 if (flds.
size() != oldFlds.size())
198 FatalErrorIn(
"fvMeshDistribute::mapExposedFaces(..)") <<
"problem" 207 fldType&
fld = *iter();
208 typename fldType::Boundary& bfld = fld.boundaryFieldRef();
210 const Field<T>& oldInternal = oldFlds[fieldI++];
220 const label faceI = patchFld.
patch().start()+i;
222 label oldFaceI = faceMap[faceI];
224 if (oldFaceI < oldInternal.
size())
226 patchFld[i] = oldInternal[oldFaceI];
230 patchFld[i] =
flipOp()(patchFld[i]);
239 template<
class GeoField,
class PatchFieldType>
240 void Foam::fvMeshDistribute::initPatchFields
242 const typename GeoField::value_type& initVal
249 mesh_.objectRegistry::lookupClass<GeoField>()
254 GeoField&
fld = *iter();
256 typename GeoField::Boundary& bfld = fld.boundaryFieldRef();
260 if (isA<PatchFieldType>(bfld[
patchi]))
269 template<
class GeoField>
270 void Foam::fvMeshDistribute::correctBoundaryConditions()
276 mesh_.objectRegistry::lookupClass<GeoField>()
281 const GeoField&
fld = *iter();
282 fld.correctBoundaryConditions();
287 template<
class GeoField>
288 void Foam::fvMeshDistribute::sendFields
320 Pout<<
"Subsetting field " << fieldNames[i]
321 <<
" for domain:" << domain <<
endl;
326 const GeoField&
fld =
340 template<
class GeoField>
341 void Foam::fvMeshDistribute::receiveFields
352 Pout<<
"Receiving fields " << fieldNames
353 <<
" from domain:" << domain <<
endl;
362 Pout<<
"Constructing field " << fieldNames[i]
363 <<
" from domain:" << domain <<
endl;
380 fieldDicts.
subDict(fieldNames[i])
Class containing functor to negate primitives. Dummy for all other types.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool set(const label) const
Is element set.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Generic GeometricField class.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const Time & time() const
Return the top-level database.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
label size() const
Return number of elements in table.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
const labelHashSet & flipFaceFlux() const
Map of flipped face flux faces.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
bool found(const Key &) const
Return true if hashedEntry is found in table.
An STL-conforming hash table.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
errorManip< error > abort(error &err)
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
static void printFieldInfo(const fvMesh &)
Print some field info.
Post-processing mesh subset tool. Given the original mesh and the list of selected cells...
const labelList & faceMap() const
Old face map.
const labelList & oldPatchStarts() const
Return list of the old patch start labels.
const fvPatch & patch() const
Return patch.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
prefixOSstream Pout(cout, "Pout")
Mesh data needed to do the Finite Volume discretisation.
A class for managing temporary objects.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &, const fvMesh &sMesh, const labelList &patchMap, const labelList &cellMap, const labelList &faceMap)
Map volume field.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
const fvMesh & baseMesh() const
Original mesh.