34 #ifndef MapGeometricFields_H 35 #define MapGeometricFields_H 44 template<
class Type,
class MeshMapper,
class GeoMesh>
55 const MeshMapper& mapper
66 template<
class>
class PatchField,
72 const MeshMapper& mapper
77 mapper.thisDb().objectRegistry::template
78 lookupClass<GeometricField<Type, PatchField, GeoMesh>>()
89 iterator fieldIter = fields.
begin();
90 fieldIter != fields.
end();
100 if (&field.
mesh() == &mapper.mesh())
109 iterator fieldIter = fields.
begin();
110 fieldIter != fields.
end();
118 if (&field.
mesh() == &mapper.mesh())
148 else if (polyMesh::debug)
151 <<
" since originating mesh differs from that of mapper." 158 template<
class GeoField>
162 const label insertPatchi,
164 const word& defaultPatchFieldType,
165 const typename GeoField::value_type& defaultPatchValue
174 GeoField&
fld = *flds[fldNames[i]];
176 typename GeoField::Boundary& bfld = fld.boundaryFieldRef();
178 if (bfld.size() != fld.mesh().boundary().size())
181 <<
" mesh size:" << fld.mesh().boundary().size()
185 if (patchFieldDict.
found(fld.name()))
192 fld.mesh().boundary()[insertPatchi],
194 patchFieldDict.
subDict(fld.name())
205 defaultPatchFieldType,
206 fld.mesh().boundary()[insertPatchi],
210 bfld[insertPatchi] == defaultPatchValue;
216 template<
class GeoField>
227 GeoField&
fld = *flds[fldNames[i]];
228 typename GeoField::Boundary& bfld = fld.boundaryFieldRef();
230 bfld.shuffle(newToOld);
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
const word & name() const
Return name.
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
errorManipArg< error, int > exit(error &err, const int errNo=1)
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
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.
static const char *const typeName
Ostream & endl(Ostream &os)
Add newline and flush stream.
Generic GeometricField class.
void MapGeometricFields(const MeshMapper &mapper)
Generic Geometric field mapper.
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))
void storeOldTimes() const
Store the old-time fields.
A class for handling words, derived from string.
void AddPatchFields(objectRegistry &obr, const label insertPatchi, const dictionary &patchFieldDict, const word &defaultPatchFieldType, const typename GeoField::value_type &defaultPatchValue)
iterator begin()
Iterator set to the beginning of the HashTable.
An STL-conforming hash table.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const Mesh & mesh() const
Return mesh.
Internal & ref()
Return a reference to the dimensioned internal field.
Generic internal field mapper. For "real" mapping, add template specialisations for mapping of intern...
Info<< "Reading field p_rgh\"<< endl;volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);pressureReference pressureReference(p, p_rgh, pimple.dict(), thermo.incompressible());mesh.schemes().setFluxRequired(p_rgh.name());hydrostaticInitialisation(p_rgh, p, rho, U, gh, ghf, pRef, thermo, pimple.dict());Info<< "Creating field dpdt\"<< endl;volScalarField dpdt(IOobject("dpdt", runTime.timeName(), mesh), mesh, dimensionedScalar(p.dimensions()/dimTime, 0));Info<< "Creating field kinetic energy K\"<< endl;volScalarField K("K", 0.5 *magSqr(U));dimensionedScalar initialMass=fvc::domainIntegrate(rho);multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
const Time & time() const
Return time.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
void ReorderPatchFields(objectRegistry &obr, const labelUList &newToOld)
fileName & instance() const
Return the instance directory, constant, system, <time> etc.
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Registry of regIOobjects.
HashTable< const Type * > lookupClass(const bool strict=false) const
Lookup and return all objects of the given Type.