30 template<
class GeoField>
35 mesh.objectRegistry::lookupClass<GeoField>()
40 const GeoField&
fld = *iter();
42 Pout<<
"Field:" << iter.key() <<
" internalsize:" << fld.size()
46 forAll(fld.boundaryField(), patchI)
49 <<
' ' << fld.boundaryField()[patchI].patch().
name()
50 <<
' ' << fld.boundaryField()[patchI].
type()
51 <<
' ' << fld.boundaryField()[patchI].size()
59 template<
class T,
class Mesh>
60 void Foam::fvMeshDistribute::saveBoundaryFields
69 static_cast<const fvMesh&>(mesh_).objectRegistry::lookupClass<fldType>()
72 bflds.setSize(flds.
size());
78 const fldType&
fld = *iter();
80 bflds.set(i, fld.boundaryField().clone().ptr());
88 template<
class T,
class Mesh>
89 void Foam::fvMeshDistribute::mapBoundaryFields
102 mesh_.objectRegistry::lookupClass<fldType>()
105 if (flds.
size() != oldBflds.size())
107 FatalErrorIn(
"fvMeshDistribute::mapBoundaryFields(..)") <<
"problem" 115 fldType&
fld = *iter();
116 typename fldType::GeometricBoundaryField& bfld =
130 label oldFaceI = faceMap[faceI++];
133 forAll(oldPatchStarts, oldPatchI)
135 label oldLocalI = oldFaceI - oldPatchStarts[oldPatchI];
137 if (oldLocalI >= 0 && oldLocalI < oldBfld[oldPatchI].size())
139 patchFld[i] = oldBfld[oldPatchI][oldLocalI];
149 template<
class GeoField,
class PatchFieldType>
150 void Foam::fvMeshDistribute::initPatchFields
152 const typename GeoField::value_type& initVal
157 mesh_.objectRegistry::lookupClass<GeoField>()
162 GeoField&
fld = *iter();
164 typename GeoField::GeometricBoundaryField& bfld =
169 if (isA<PatchFieldType>(bfld[patchI]))
171 bfld[patchI] == initVal;
179 template<
class GeoField>
180 void Foam::fvMeshDistribute::correctBoundaryConditions()
184 mesh_.objectRegistry::lookupClass<GeoField>()
189 const GeoField&
fld = *iter();
190 fld.correctBoundaryConditions();
213 template<
class GeoField>
214 void Foam::fvMeshDistribute::sendFields
227 Pout<<
"Subsetting field " << fieldNames[i]
228 <<
" for domain:" << domain <<
endl;
233 const GeoField&
fld =
248 template<
class GeoField>
249 void Foam::fvMeshDistribute::receiveFields
260 Pout<<
"Receiving fields " << fieldNames
261 <<
" from domain:" << domain <<
endl;
270 Pout<<
"Constructing field " << fieldNames[i]
271 <<
" from domain:" << domain <<
endl;
288 fieldDicts.
subDict(fieldNames[i])
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.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
Mesh data needed to do the Finite Volume discretisation.
bool set(const label) const
Is element set.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
const fvPatch & patch() const
Return patch.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
An STL-conforming hash table.
#define forAllIter(Container, container, iter)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
void size(const label)
Override size to be inconsistent with allocated storage.
static void printFieldInfo(const fvMesh &)
Print some field info.
A list of keyword definitions, which are a keyword followed by any number of values (e...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
const Time & time() const
Return the top-level database.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
const fvMesh & baseMesh() const
Original mesh.
Type type() const
Return the file type: FILE, DIRECTORY or UNDEFINED.
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
const labelList & faceMap() const
Old face map.
label size() const
Return number of elements in table.
errorManip< error > abort(error &err)
virtual const fileName & name() const
Return the name of the stream.
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 ))
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Generic GeometricField class.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const labelList & oldPatchStarts() const
Return list of the old patch start labels.
A class for managing temporary objects.
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Post-processing mesh subset tool. Given the original mesh and the list of selected cells...
prefixOSstream Pout(cout,"Pout")