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.
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.
const labelHashSet & flipFaceFlux() const
Map of flipped face flux faces.
#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.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const labelList & oldPatchStarts() const
Return list of the old patch start labels.
Generic GeometricField class.
label size() const
Return number of elements in table.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
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 Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
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 set(const label) const
Is element set.
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.
bool found(const Key &) const
Return true if hashedEntry is found in table.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
prefixOSstream Pout(cout,"Pout")
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 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...
Mesh data needed to do the Finite Volume discretisation.
const fvMesh & baseMesh() const
Original mesh.
const labelList & faceMap() const
Old face map.
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 Time & time() const
Return the top-level database.