MeshObject: extended to support movePoints and updateMesh as an alternative to call-backs

All MeshObjects are now handled generically in polyMesh and fvMesh
See MeshObject.H for details
This commit is contained in:
Henry
2013-02-26 22:19:28 +00:00
parent 0a5508e813
commit 0afb3ab1ac
49 changed files with 567 additions and 351 deletions

View File

@ -159,6 +159,10 @@ public:
template<class Type>
HashTable<const Type*> lookupClass(const bool strict = false) const;
//- Lookup and return all objects of the given Type
template<class Type>
HashTable<Type*> lookupClass(const bool strict = false);
//- Is the named Type found?
template<class Type>
bool foundObject(const word& name) const;

View File

@ -76,6 +76,34 @@ Foam::HashTable<const Type*> Foam::objectRegistry::lookupClass
}
template<class Type>
Foam::HashTable<Type*> Foam::objectRegistry::lookupClass
(
const bool strict
)
{
HashTable<Type*> objectsOfClass(size());
forAllIter(HashTable<regIOobject*>, *this, iter)
{
if
(
(strict && isType<Type>(*iter()))
|| (!strict && isA<Type>(*iter()))
)
{
objectsOfClass.insert
(
iter()->name(),
dynamic_cast<Type*>(iter())
);
}
}
return objectsOfClass;
}
template<class Type>
bool Foam::objectRegistry::foundObject(const word& name) const
{

View File

@ -70,7 +70,7 @@ Foam::GAMGAgglomeration::GAMGAgglomeration
const dictionary& controlDict
)
:
MeshObject<lduMesh, GAMGAgglomeration>(mesh),
MeshObject<lduMesh, Foam::TopologicalMeshObject, GAMGAgglomeration>(mesh),
maxLevels_(50),

View File

@ -58,7 +58,7 @@ class lduMatrix;
class GAMGAgglomeration
:
public MeshObject<lduMesh, GAMGAgglomeration>
public MeshObject<lduMesh, TopologicalMeshObject, GAMGAgglomeration>
{
protected:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,26 +28,18 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Mesh, class Type>
Foam::MeshObject<Mesh, Type>::MeshObject(const Mesh& mesh)
template<class Mesh, template<class> class MeshObjectType, class Type>
Foam::MeshObject<Mesh, MeshObjectType, Type>::MeshObject(const Mesh& mesh)
:
regIOobject
(
IOobject
(
Type::typeName,
mesh.thisDb().instance(),
mesh.thisDb()
)
),
MeshObjectType<Mesh>(Type::typeName, mesh.thisDb()),
mesh_(mesh)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
template<class Mesh, class Type>
const Type& Foam::MeshObject<Mesh, Type>::New
template<class Mesh, template<class> class MeshObjectType, class Type>
const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
(
const Mesh& mesh
)
@ -67,14 +59,14 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return store(new Type(mesh));
return regIOobject::store(new Type(mesh));
}
}
template<class Mesh, class Type>
template<class Mesh, template<class> class MeshObjectType, class Type>
template<class Data1>
const Type& Foam::MeshObject<Mesh, Type>::New
const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
(
const Mesh& mesh,
const Data1& d
@ -95,14 +87,14 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return store(new Type(mesh, d));
return regIOobject::store(new Type(mesh, d));
}
}
template<class Mesh, class Type>
template<class Mesh, template<class> class MeshObjectType, class Type>
template<class Data1, class Data2>
const Type& Foam::MeshObject<Mesh, Type>::New
const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
(
const Mesh& mesh,
const Data1& d1,
@ -124,14 +116,14 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return store(new Type(mesh, d1, d2));
return regIOobject::store(new Type(mesh, d1, d2));
}
}
template<class Mesh, class Type>
template<class Mesh, template<class> class MeshObjectType, class Type>
template<class Data1, class Data2, class Data3>
const Type& Foam::MeshObject<Mesh, Type>::New
const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
(
const Mesh& mesh,
const Data1& d1,
@ -154,14 +146,14 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return store(new Type(mesh, d1, d2, d3));
return regIOobject::store(new Type(mesh, d1, d2, d3));
}
}
template<class Mesh, class Type>
template<class Mesh, template<class> class MeshObjectType, class Type>
template<class Data1, class Data2, class Data3, class Data4>
const Type& Foam::MeshObject<Mesh, Type>::New
const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
(
const Mesh& mesh,
const Data1& d1,
@ -185,15 +177,15 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return store(new Type(mesh, d1, d2, d3, d4));
return regIOobject::store(new Type(mesh, d1, d2, d3, d4));
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
template<class Mesh, class Type>
bool Foam::MeshObject<Mesh, Type>::Delete(const Mesh& mesh)
template<class Mesh, template<class> class MeshObjectType, class Type>
bool Foam::MeshObject<Mesh, MeshObjectType, Type>::Delete(const Mesh& mesh)
{
if
(
@ -221,10 +213,79 @@ bool Foam::MeshObject<Mesh, Type>::Delete(const Mesh& mesh)
}
template<class Mesh, class Type>
Foam::MeshObject<Mesh, Type>::~MeshObject()
template<class Mesh, template<class> class MeshObjectType, class Type>
Foam::MeshObject<Mesh, MeshObjectType, Type>::~MeshObject()
{
release();
MeshObjectType<Mesh>::release();
}
template<class Mesh>
void Foam::meshObject::movePoints(objectRegistry& obr)
{
HashTable<GeometricMeshObject<Mesh>*> meshObjects
(
obr.lookupClass<GeometricMeshObject<Mesh> >()
);
forAllIter
(
typename HashTable<GeometricMeshObject<Mesh>*>,
meshObjects,
iter
)
{
if (isA<MoveableMeshObject<Mesh> >(*iter()))
{
dynamic_cast<MoveableMeshObject<Mesh>*>(iter())->movePoints();
}
else
{
obr.checkOut(*iter());
}
}
}
template<class Mesh>
void Foam::meshObject::updateMesh(objectRegistry& obr, const mapPolyMesh& mpm)
{
HashTable<GeometricMeshObject<Mesh>*> meshObjects
(
obr.lookupClass<GeometricMeshObject<Mesh> >()
);
forAllIter
(
typename HashTable<GeometricMeshObject<Mesh>*>,
meshObjects,
iter
)
{
if (isA<UpdateableMeshObject<Mesh> >(*iter()))
{
dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->updateMesh(mpm);
}
else
{
obr.checkOut(*iter());
}
}
}
template<class Mesh, template<class> class MeshObjectType>
void Foam::meshObject::clear(objectRegistry& obr)
{
HashTable<MeshObjectType<Mesh>*> meshObjects
(
obr.lookupClass<MeshObjectType<Mesh> >()
);
forAllIter(typename HashTable<MeshObjectType<Mesh>*>, meshObjects, iter)
{
obr.checkOut(*iter());
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,9 +25,36 @@ Class
Foam::MeshObject
Description
Templated abstract base-class for dynamic mesh objects used to automate
Templated abstract base-class for optional mesh objects used to automate
their allocation to the mesh database and the mesh-modifier event-loop.
MeshObject is templated on the type of mesh it is allocated to, the type of
the mesh object (TopologicalMeshObject, GeometricMeshObject,
MoveableMeshObject, UpdateableMeshObject) and the type of the actual object
it is created for example:
class leastSquaresVectors
:
public MeshObject<fvMesh, MoveableMeshObject, leastSquaresVectors>
{
.
.
.
//- Delete the least square vectors when the mesh moves
virtual bool movePoints();
};
MeshObject types:
TopologicalMeshObject: mesh object to be deleted on topology change
GeometricMeshObject: mesh object to be deleted on geometry change
MoveableMeshObject: mesh object to be updated in movePoints
UpdateableMeshObject: mesh object to be updated in updateMesh or movePoints
Note that movePoints must be provided for MeshObjects of type
MoveableMeshObject and both movePoints and updateMesh functions must exist
provided for MeshObjects of type UpdateableMeshObject.
SourceFiles
MeshObject.C
@ -37,21 +64,24 @@ SourceFiles
#define MeshObject_H
#include "regIOobject.H"
#include "objectRegistry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declarations
class mapPolyMesh;
/*---------------------------------------------------------------------------*\
Class MeshObject Declaration
Class MeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh, class Type>
template<class Mesh, template<class> class MeshObjectType, class Type>
class MeshObject
:
public regIOobject
public MeshObjectType<Mesh>
{
protected:
@ -124,6 +154,121 @@ public:
};
/*---------------------------------------------------------------------------*\
Class meshObject Declaration
\*---------------------------------------------------------------------------*/
class meshObject
:
public regIOobject
{
public:
// Constructors
meshObject(const word& typeName, const objectRegistry& obr)
:
regIOobject
(
IOobject
(
typeName,
obr.instance(),
obr
)
)
{}
// Static member functions
template<class Mesh>
static void movePoints(objectRegistry&);
template<class Mesh>
static void updateMesh(objectRegistry&, const mapPolyMesh&);
template<class Mesh, template<class> class MeshObjectType>
static void clear(objectRegistry&);
};
/*---------------------------------------------------------------------------*\
Class TopologicalMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class TopologicalMeshObject
:
public meshObject
{
public:
TopologicalMeshObject(const word& typeName, const objectRegistry& obr)
:
meshObject(typeName, obr)
{}
};
/*---------------------------------------------------------------------------*\
Class GeometricMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class GeometricMeshObject
:
public TopologicalMeshObject<Mesh>
{
public:
GeometricMeshObject(const word& typeName, const objectRegistry& obr)
:
TopologicalMeshObject<Mesh>(typeName, obr)
{}
};
/*---------------------------------------------------------------------------*\
Class MoveableMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class MoveableMeshObject
:
public GeometricMeshObject<Mesh>
{
public:
MoveableMeshObject(const word& typeName, const objectRegistry& obr)
:
GeometricMeshObject<Mesh>(typeName, obr)
{}
virtual bool movePoints() = 0;
};
/*---------------------------------------------------------------------------*\
Class UpdateableMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class UpdateableMeshObject
:
public MoveableMeshObject<Mesh>
{
public:
UpdateableMeshObject(const word& typeName, const objectRegistry& obr)
:
MoveableMeshObject<Mesh>(typeName, obr)
{}
virtual void updateMesh(const mapPolyMesh& mpm) = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -72,7 +72,7 @@ void Foam::pointMesh::mapFields(const mapPolyMesh& mpm)
Foam::pointMesh::pointMesh(const polyMesh& pMesh)
:
MeshObject<polyMesh, pointMesh>(pMesh),
MeshObject<polyMesh, Foam::UpdateableMeshObject, pointMesh>(pMesh),
GeoMesh<polyMesh>(pMesh),
boundary_(*this, pMesh.boundaryMesh())
{
@ -88,7 +88,7 @@ Foam::pointMesh::pointMesh(const polyMesh& pMesh)
}
void Foam::pointMesh::movePoints(const pointField& newPoints)
bool Foam::pointMesh::movePoints()
{
if (debug)
{
@ -96,7 +96,9 @@ void Foam::pointMesh::movePoints(const pointField& newPoints)
<< "Moving points." << endl;
}
boundary_.movePoints(newPoints);
boundary_.movePoints(GeoMesh<polyMesh>::mesh_.points());
return true;
}

View File

@ -48,7 +48,7 @@ namespace Foam
class pointMesh
:
public MeshObject<polyMesh, pointMesh>,
public MeshObject<polyMesh, UpdateableMeshObject, pointMesh>,
public GeoMesh<polyMesh>
{
// Permanent data
@ -121,7 +121,7 @@ public:
// Mesh motion
//- Move points, returns volumes swept by faces in motion
void movePoints(const pointField&);
bool movePoints();
//- Update the mesh corresponding to given map
void updateMesh(const mapPolyMesh& mpm);

View File

@ -26,30 +26,24 @@ License
#include "polyMesh.H"
#include "Time.H"
#include "cellIOList.H"
#include "SubList.H"
#include "wedgePolyPatch.H"
#include "emptyPolyPatch.H"
#include "globalMeshData.H"
#include "processorPolyPatch.H"
#include "OSspecific.H"
#include "polyMeshTetDecomposition.H"
#include "indexedOctree.H"
#include "treeDataCell.H"
#include "SubField.H"
#include "MeshObject.H"
#include "pointMesh.H"
#include "Istream.H"
#include "Ostream.H"
#include "simpleRegIOobject.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(polyMesh, 0);
defineTypeNameAndDebug(polyMesh, 0);
word polyMesh::defaultRegion = "region0";
word polyMesh::meshSubDir = "polyMesh";
word polyMesh::defaultRegion = "region0";
word polyMesh::meshSubDir = "polyMesh";
}
@ -1162,21 +1156,7 @@ Foam::tmp<Foam::scalarField> Foam::polyMesh::movePoints
geometricD_ = Vector<label>::zero;
solutionD_ = Vector<label>::zero;
// Hack until proper callbacks. Below are all the polyMeh MeshObjects with a
// movePoints function.
// pointMesh
if (thisDb().foundObject<pointMesh>(pointMesh::typeName))
{
const_cast<pointMesh&>
(
thisDb().lookupObject<pointMesh>
(
pointMesh::typeName
)
).movePoints(points_);
}
meshObject::movePoints<polyMesh>(*this);
const_cast<Time&>(time()).functionObjects().movePoints(*this);

View File

@ -26,8 +26,7 @@ License
#include "polyMesh.H"
#include "primitiveMesh.H"
#include "globalMeshData.H"
#include "pointMesh.H"
#include "Time.H"
#include "MeshObject.H"
#include "indexedOctree.H"
#include "treeDataCell.H"
@ -61,6 +60,8 @@ void Foam::polyMesh::clearGeom()
<< endl;
}
meshObject::clear<polyMesh, GeometricMeshObject>(*this);
primitiveMesh::clearGeom();
boundary_.clearGeom();
@ -101,6 +102,8 @@ void Foam::polyMesh::clearAddressing()
<< endl;
}
meshObject::clear<polyMesh, TopologicalMeshObject>(*this);
primitiveMesh::clearAddressing();
// parallelData depends on the processorPatch ordering so force
@ -118,6 +121,7 @@ void Foam::polyMesh::clearAddressing()
// Remove the stored tet base points
tetBasePtIsPtr_.clear();
// Remove the cell tree
cellTreePtr_.clear();
}
@ -132,8 +136,6 @@ void Foam::polyMesh::clearPrimitives()
owner_.setSize(0);
neighbour_.setSize(0);
pointMesh::Delete(*this);
clearedPrimitives_ = true;
}
@ -142,8 +144,6 @@ void Foam::polyMesh::clearOut()
{
clearGeom();
clearAddressing();
pointMesh::Delete(*this);
}

View File

@ -91,25 +91,12 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
}
}
meshObject::updateMesh<polyMesh>(*this, mpm);
// Reset valid directions (could change by faces put into empty patches)
geometricD_ = Vector<label>::zero;
solutionD_ = Vector<label>::zero;
// Hack until proper callbacks. Below are all the polyMesh-MeshObjects.
// pointMesh
if (thisDb().foundObject<pointMesh>(pointMesh::typeName))
{
const_cast<pointMesh&>
(
thisDb().lookupObject<pointMesh>
(
pointMesh::typeName
)
).updateMesh(mpm);
}
const_cast<Time&>(time()).functionObjects().updateMesh(mpm);
}

View File

@ -302,11 +302,11 @@ Foam::dynamicRefineFvMesh::refine
Pout<< "Found " << masterFaces.size() << " split faces " << endl;
}
HashTable<const surfaceScalarField*> fluxes
HashTable<surfaceScalarField*> fluxes
(
lookupClass<surfaceScalarField>()
);
forAllConstIter(HashTable<const surfaceScalarField*>, fluxes, iter)
forAllIter(HashTable<surfaceScalarField*>, fluxes, iter)
{
if (!correctFluxes_.found(iter.key()))
{
@ -336,7 +336,7 @@ Foam::dynamicRefineFvMesh::refine
<< endl;
}
surfaceScalarField& phi = const_cast<surfaceScalarField&>(*iter());
surfaceScalarField& phi = *iter();
const surfaceScalarField phiU
(
fvc::interpolate
@ -519,11 +519,11 @@ Foam::dynamicRefineFvMesh::unrefine
const labelList& reversePointMap = map().reversePointMap();
const labelList& reverseFaceMap = map().reverseFaceMap();
HashTable<const surfaceScalarField*> fluxes
HashTable<surfaceScalarField*> fluxes
(
lookupClass<surfaceScalarField>()
);
forAllConstIter(HashTable<const surfaceScalarField*>, fluxes, iter)
forAllIter(HashTable<surfaceScalarField*>, fluxes, iter)
{
if (!correctFluxes_.found(iter.key()))
{
@ -553,7 +553,7 @@ Foam::dynamicRefineFvMesh::unrefine
<< endl;
}
surfaceScalarField& phi = const_cast<surfaceScalarField&>(*iter());
surfaceScalarField& phi = *iter();
surfaceScalarField::GeometricBoundaryField& bphi =
phi.boundaryField();

View File

@ -66,7 +66,7 @@ void Foam::fvMeshDistribute::saveBoundaryFields
HashTable<const fldType*> flds
(
mesh_.objectRegistry::lookupClass<fldType>()
static_cast<const fvMesh&>(mesh_).objectRegistry::lookupClass<fldType>()
);
bflds.setSize(flds.size());
@ -97,7 +97,7 @@ void Foam::fvMeshDistribute::mapBoundaryFields
typedef GeometricField<T, fvsPatchField, Mesh> fldType;
HashTable<const fldType*> flds
HashTable<fldType*> flds
(
mesh_.objectRegistry::lookupClass<fldType>()
);
@ -110,15 +110,11 @@ void Foam::fvMeshDistribute::mapBoundaryFields
label fieldI = 0;
forAllConstIter(typename HashTable<const fldType*>, flds, iter)
forAllIter(typename HashTable<fldType*>, flds, iter)
{
const fldType& fld = *iter();
fldType& fld = *iter();
typename fldType::GeometricBoundaryField& bfld =
const_cast<typename fldType::GeometricBoundaryField&>
(
fld.boundaryField()
);
fld.boundaryField();
const FieldField<fvsPatchField, T>& oldBfld = oldBflds[fieldI++];
@ -156,20 +152,17 @@ void Foam::fvMeshDistribute::initPatchFields
const typename GeoField::value_type& initVal
)
{
HashTable<const GeoField*> flds
HashTable<GeoField*> flds
(
mesh_.objectRegistry::lookupClass<GeoField>()
);
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
forAllIter(typename HashTable<GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
const_cast<typename GeoField::GeometricBoundaryField&>
(
fld.boundaryField()
);
fld.boundaryField();
forAll(bfld, patchI)
{
@ -186,16 +179,15 @@ void Foam::fvMeshDistribute::initPatchFields
template<class GeoField>
void Foam::fvMeshDistribute::correctBoundaryConditions()
{
HashTable<const GeoField*> flds
HashTable<GeoField*> flds
(
mesh_.objectRegistry::lookupClass<GeoField>()
);
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
forAllIter(typename HashTable<GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
const_cast<GeoField&>(fld).correctBoundaryConditions();
fld.correctBoundaryConditions();
}
}

View File

@ -38,20 +38,17 @@ void Foam::fvMeshTools::addPatchFields
const typename GeoField::value_type& defaultPatchValue
)
{
HashTable<const GeoField*> flds
HashTable<GeoField*> flds
(
mesh.objectRegistry::lookupClass<GeoField>()
);
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
forAllIter(typename HashTable<GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
const_cast<typename GeoField::GeometricBoundaryField&>
(
fld.boundaryField()
);
fld.boundaryField();
label sz = bfld.size();
bfld.setSize(sz+1);
@ -95,20 +92,17 @@ void Foam::fvMeshTools::setPatchFields
const dictionary& patchFieldDict
)
{
HashTable<const GeoField*> flds
HashTable<GeoField*> flds
(
mesh.objectRegistry::lookupClass<GeoField>()
);
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
forAllIter(typename HashTable<GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
const_cast<typename GeoField::GeometricBoundaryField&>
(
fld.boundaryField()
);
fld.boundaryField();
if (patchFieldDict.found(fld.name()))
{
@ -137,20 +131,17 @@ void Foam::fvMeshTools::setPatchFields
const typename GeoField::value_type& value
)
{
HashTable<const GeoField*> flds
HashTable<GeoField*> flds
(
mesh.objectRegistry::lookupClass<GeoField>()
);
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
forAllIter(typename HashTable<GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
const_cast<typename GeoField::GeometricBoundaryField&>
(
fld.boundaryField()
);
fld.boundaryField();
bfld[patchI] == value;
}
@ -161,19 +152,15 @@ void Foam::fvMeshTools::setPatchFields
template<class GeoField>
void Foam::fvMeshTools::trimPatchFields(fvMesh& mesh, const label nPatches)
{
HashTable<const GeoField*> flds
HashTable<GeoField*> flds
(
mesh.objectRegistry::lookupClass<GeoField>()
);
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
forAllIter(typename HashTable<GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
const_cast<typename GeoField::GeometricBoundaryField&>
(
fld.boundaryField()
).setSize(nPatches);
GeoField& fld = *iter();
fld.boundaryField().setSize(nPatches);
}
}
@ -186,20 +173,18 @@ void Foam::fvMeshTools::reorderPatchFields
const labelList& oldToNew
)
{
HashTable<const GeoField*> flds
HashTable<GeoField*> flds
(
mesh.objectRegistry::lookupClass<GeoField>()
);
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
forAllIter(typename HashTable<GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
const_cast<typename GeoField::GeometricBoundaryField&>
(
fld.boundaryField()
);
fld.boundaryField();
bfld.reorder(oldToNew);
}
}

View File

@ -34,12 +34,12 @@ void Foam::solutionControl::storePrevIter() const
{
typedef GeometricField<Type, fvPatchField, volMesh> GeoField;
HashTable<const GeoField*>
HashTable<GeoField*>
flds(mesh_.objectRegistry::lookupClass<GeoField>());
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
forAllIter(typename HashTable<GeoField*>, flds, iter)
{
GeoField& fld = const_cast<GeoField&>(*iter());
GeoField& fld = *iter();
const word& fName = fld.name();

View File

@ -33,7 +33,7 @@ Foam::fv::LeastSquaresVectors<Stencil>::LeastSquaresVectors
const fvMesh& mesh
)
:
MeshObject<fvMesh, LeastSquaresVectors>(mesh),
MeshObject<fvMesh, Foam::MoveableMeshObject, LeastSquaresVectors>(mesh),
vectors_(mesh.nCells())
{
calcLeastSquaresVectors();

View File

@ -58,7 +58,7 @@ namespace fv
template<class Stencil>
class LeastSquaresVectors
:
public MeshObject<fvMesh, LeastSquaresVectors<Stencil> >
public MeshObject<fvMesh, MoveableMeshObject, LeastSquaresVectors<Stencil> >
{
// Private data
@ -105,7 +105,7 @@ public:
return vectors_;
}
//- Delete the least square vectors when the mesh moves
//- Update the least square vectors when the mesh moves
virtual bool movePoints();
};

View File

@ -38,7 +38,7 @@ namespace Foam
Foam::leastSquaresVectors::leastSquaresVectors(const fvMesh& mesh)
:
MeshObject<fvMesh, leastSquaresVectors>(mesh),
MeshObject<fvMesh, Foam::MoveableMeshObject, leastSquaresVectors>(mesh),
pVectors_
(
IOobject

View File

@ -50,7 +50,7 @@ namespace Foam
class leastSquaresVectors
:
public MeshObject<fvMesh, leastSquaresVectors>
public MeshObject<fvMesh, MoveableMeshObject, leastSquaresVectors>
{
// Private data

View File

@ -48,7 +48,12 @@ namespace Foam
class centredCECCellToCellStencilObject
:
public MeshObject<fvMesh, centredCECCellToCellStencilObject>,
public MeshObject
<
fvMesh,
TopologicalMeshObject,
centredCECCellToCellStencilObject
>,
public extendedCentredCellToCellStencil
{
@ -64,7 +69,12 @@ public:
const fvMesh& mesh
)
:
MeshObject<fvMesh, centredCECCellToCellStencilObject>(mesh),
MeshObject
<
fvMesh,
Foam::TopologicalMeshObject,
centredCECCellToCellStencilObject
>(mesh),
extendedCentredCellToCellStencil(CECCellToCellStencil(mesh))
{}

View File

@ -48,7 +48,12 @@ namespace Foam
class centredCFCCellToCellStencilObject
:
public MeshObject<fvMesh, centredCFCCellToCellStencilObject>,
public MeshObject
<
fvMesh,
TopologicalMeshObject,
centredCFCCellToCellStencilObject
>,
public extendedCentredCellToCellStencil
{
@ -64,7 +69,12 @@ public:
const fvMesh& mesh
)
:
MeshObject<fvMesh, centredCFCCellToCellStencilObject>(mesh),
MeshObject
<
fvMesh,
Foam::TopologicalMeshObject,
centredCFCCellToCellStencilObject
>(mesh),
extendedCentredCellToCellStencil(CFCCellToCellStencil(mesh))
{}

View File

@ -48,7 +48,12 @@ namespace Foam
class centredCPCCellToCellStencilObject
:
public MeshObject<fvMesh, centredCPCCellToCellStencilObject>,
public MeshObject
<
fvMesh,
TopologicalMeshObject,
centredCPCCellToCellStencilObject
>,
public extendedCentredCellToCellStencil
{
@ -64,7 +69,12 @@ public:
const fvMesh& mesh
)
:
MeshObject<fvMesh, centredCPCCellToCellStencilObject>(mesh),
MeshObject
<
fvMesh,
Foam::TopologicalMeshObject,
centredCPCCellToCellStencilObject
>(mesh),
extendedCentredCellToCellStencil(CPCCellToCellStencil(mesh))
{}

View File

@ -48,7 +48,12 @@ namespace Foam
class centredCECCellToFaceStencilObject
:
public MeshObject<fvMesh, centredCECCellToFaceStencilObject>,
public MeshObject
<
fvMesh,
TopologicalMeshObject,
centredCECCellToFaceStencilObject
>,
public extendedCentredCellToFaceStencil
{
@ -64,7 +69,12 @@ public:
const fvMesh& mesh
)
:
MeshObject<fvMesh, centredCECCellToFaceStencilObject>(mesh),
MeshObject
<
fvMesh,
Foam::TopologicalMeshObject,
centredCECCellToFaceStencilObject
>(mesh),
extendedCentredCellToFaceStencil(CECCellToFaceStencil(mesh))
{
if (extendedCellToFaceStencil::debug)

View File

@ -48,7 +48,12 @@ namespace Foam
class centredCFCCellToFaceStencilObject
:
public MeshObject<fvMesh, centredCFCCellToFaceStencilObject>,
public MeshObject
<
fvMesh,
TopologicalMeshObject,
centredCFCCellToFaceStencilObject
>,
public extendedCentredCellToFaceStencil
{
@ -64,7 +69,12 @@ public:
const fvMesh& mesh
)
:
MeshObject<fvMesh, centredCFCCellToFaceStencilObject>(mesh),
MeshObject
<
fvMesh,
Foam::TopologicalMeshObject,
centredCFCCellToFaceStencilObject
>(mesh),
extendedCentredCellToFaceStencil(CFCCellToFaceStencil(mesh))
{
if (extendedCellToFaceStencil::debug)

View File

@ -48,7 +48,12 @@ namespace Foam
class centredCPCCellToFaceStencilObject
:
public MeshObject<fvMesh, centredCPCCellToFaceStencilObject>,
public MeshObject
<
fvMesh,
TopologicalMeshObject,
centredCPCCellToFaceStencilObject
>,
public extendedCentredCellToFaceStencil
{
@ -64,7 +69,12 @@ public:
const fvMesh& mesh
)
:
MeshObject<fvMesh, centredCPCCellToFaceStencilObject>(mesh),
MeshObject
<
fvMesh,
Foam::TopologicalMeshObject,
centredCPCCellToFaceStencilObject
>(mesh),
extendedCentredCellToFaceStencil(CPCCellToFaceStencil(mesh))
{
if (extendedCellToFaceStencil::debug)

View File

@ -48,7 +48,12 @@ namespace Foam
class centredFECCellToFaceStencilObject
:
public MeshObject<fvMesh, centredFECCellToFaceStencilObject>,
public MeshObject
<
fvMesh,
TopologicalMeshObject,
centredFECCellToFaceStencilObject
>,
public extendedCentredCellToFaceStencil
{
@ -64,7 +69,12 @@ public:
const fvMesh& mesh
)
:
MeshObject<fvMesh, centredFECCellToFaceStencilObject>(mesh),
MeshObject
<
fvMesh,
Foam::TopologicalMeshObject,
centredFECCellToFaceStencilObject
>(mesh),
extendedCentredCellToFaceStencil(FECCellToFaceStencil(mesh))
{
if (extendedCellToFaceStencil::debug)

View File

@ -48,7 +48,12 @@ namespace Foam
class pureUpwindCFCCellToFaceStencilObject
:
public MeshObject<fvMesh, pureUpwindCFCCellToFaceStencilObject>,
public MeshObject
<
fvMesh,
TopologicalMeshObject,
pureUpwindCFCCellToFaceStencilObject
>,
public extendedUpwindCellToFaceStencil
{
@ -64,7 +69,12 @@ public:
const fvMesh& mesh
)
:
MeshObject<fvMesh, pureUpwindCFCCellToFaceStencilObject>(mesh),
MeshObject
<
fvMesh,
Foam::TopologicalMeshObject,
pureUpwindCFCCellToFaceStencilObject
>(mesh),
extendedUpwindCellToFaceStencil(CFCCellToFaceStencil(mesh))
{
if (extendedCellToFaceStencil::debug)

View File

@ -48,7 +48,12 @@ namespace Foam
class upwindCECCellToFaceStencilObject
:
public MeshObject<fvMesh, upwindCECCellToFaceStencilObject>,
public MeshObject
<
fvMesh,
TopologicalMeshObject,
upwindCECCellToFaceStencilObject
>,
public extendedUpwindCellToFaceStencil
{
@ -66,7 +71,12 @@ public:
const scalar minOpposedness
)
:
MeshObject<fvMesh, upwindCECCellToFaceStencilObject>(mesh),
MeshObject
<
fvMesh,
Foam::TopologicalMeshObject,
upwindCECCellToFaceStencilObject
>(mesh),
extendedUpwindCellToFaceStencil
(
CECCellToFaceStencil(mesh),

View File

@ -48,7 +48,12 @@ namespace Foam
class upwindCFCCellToFaceStencilObject
:
public MeshObject<fvMesh, upwindCFCCellToFaceStencilObject>,
public MeshObject
<
fvMesh,
TopologicalMeshObject,
upwindCFCCellToFaceStencilObject
>,
public extendedUpwindCellToFaceStencil
{
@ -66,7 +71,12 @@ public:
const scalar minOpposedness
)
:
MeshObject<fvMesh, upwindCFCCellToFaceStencilObject>(mesh),
MeshObject
<
fvMesh,
Foam::TopologicalMeshObject,
upwindCFCCellToFaceStencilObject
>(mesh),
extendedUpwindCellToFaceStencil
(
CFCCellToFaceStencil(mesh),

View File

@ -48,7 +48,12 @@ namespace Foam
class upwindCPCCellToFaceStencilObject
:
public MeshObject<fvMesh, upwindCPCCellToFaceStencilObject>,
public MeshObject
<
fvMesh,
TopologicalMeshObject,
upwindCPCCellToFaceStencilObject
>,
public extendedUpwindCellToFaceStencil
{
@ -66,7 +71,12 @@ public:
const scalar minOpposedness
)
:
MeshObject<fvMesh, upwindCPCCellToFaceStencilObject>(mesh),
MeshObject
<
fvMesh,
Foam::TopologicalMeshObject,
upwindCPCCellToFaceStencilObject
>(mesh),
extendedUpwindCellToFaceStencil
(
CPCCellToFaceStencil(mesh),

View File

@ -48,7 +48,12 @@ namespace Foam
class upwindFECCellToFaceStencilObject
:
public MeshObject<fvMesh, upwindFECCellToFaceStencilObject>,
public MeshObject
<
fvMesh,
TopologicalMeshObject,
upwindFECCellToFaceStencilObject
>,
public extendedUpwindCellToFaceStencil
{
@ -66,7 +71,12 @@ public:
const scalar minOpposedness
)
:
MeshObject<fvMesh, upwindFECCellToFaceStencilObject>(mesh),
MeshObject
<
fvMesh,
Foam::TopologicalMeshObject,
upwindFECCellToFaceStencilObject
>(mesh),
extendedUpwindCellToFaceStencil
(
FECCellToFaceStencil(mesh),

View File

@ -48,7 +48,12 @@ namespace Foam
class centredCFCFaceToCellStencilObject
:
public MeshObject<fvMesh, centredCFCFaceToCellStencilObject>,
public MeshObject
<
fvMesh,
TopologicalMeshObject,
centredCFCFaceToCellStencilObject
>,
public extendedCentredFaceToCellStencil
{
@ -64,7 +69,12 @@ public:
const fvMesh& mesh
)
:
MeshObject<fvMesh, centredCFCFaceToCellStencilObject>(mesh),
MeshObject
<
fvMesh,
Foam::TopologicalMeshObject,
centredCFCFaceToCellStencilObject
>(mesh),
extendedCentredFaceToCellStencil(CFCFaceToCellStencil(mesh))
{}

View File

@ -31,39 +31,17 @@ License
#include "SubField.H"
#include "demandDrivenData.H"
#include "fvMeshLduAddressing.H"
#include "emptyPolyPatch.H"
#include "mapPolyMesh.H"
#include "MapFvFields.H"
#include "fvMeshMapper.H"
#include "mapClouds.H"
#include "volPointInterpolation.H"
#include "leastSquaresVectors.H"
#include "CentredFitData.H"
#include "linearFitPolynomial.H"
#include "quadraticFitPolynomial.H"
#include "quadraticLinearFitPolynomial.H"
#include "skewCorrectionVectors.H"
#include "centredCECCellToFaceStencilObject.H"
#include "centredCFCCellToFaceStencilObject.H"
#include "centredCPCCellToFaceStencilObject.H"
#include "centredFECCellToFaceStencilObject.H"
#include "upwindCECCellToFaceStencilObject.H"
#include "upwindCFCCellToFaceStencilObject.H"
#include "upwindCPCCellToFaceStencilObject.H"
#include "upwindFECCellToFaceStencilObject.H"
#include "centredCFCFaceToCellStencilObject.H"
#include "meshSearchMeshObject.H"
#include "meshSearchFACECENTRETETSMeshObject.H"
#include "MeshObject.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(fvMesh, 0);
defineTypeNameAndDebug(fvMesh, 0);
}
@ -71,6 +49,8 @@ defineTypeNameAndDebug(fvMesh, 0);
void Foam::fvMesh::clearGeomNotOldVol()
{
meshObject::clear<fvMesh, GeometricMeshObject>(*this);
slicedVolScalarField::DimensionedInternalField* VPtr =
static_cast<slicedVolScalarField::DimensionedInternalField*>(VPtr_);
deleteDemandDrivenData(VPtr);
@ -126,51 +106,13 @@ void Foam::fvMesh::clearGeom()
// Mesh motion flux cannot be deleted here because the old-time flux
// needs to be saved.
// Things geometry dependent that are not updated.
volPointInterpolation::Delete(*this);
leastSquaresVectors::Delete(*this);
CentredFitData<linearFitPolynomial>::Delete(*this);
CentredFitData<quadraticFitPolynomial>::Delete(*this);
CentredFitData<quadraticLinearFitPolynomial>::Delete(*this);
skewCorrectionVectors::Delete(*this);
// Note: should be in polyMesh::clearGeom but meshSearch not in OpenFOAM
// library
meshSearchMeshObject::Delete(*this);
meshSearchFACECENTRETETSMeshObject::Delete(*this);
}
void Foam::fvMesh::clearAddressing()
{
meshObject::clear<fvMesh, TopologicalMeshObject>(*this);
deleteDemandDrivenData(lduPtr_);
// Hack until proper callbacks. Below are all the fvMesh-MeshObjects.
volPointInterpolation::Delete(*this);
leastSquaresVectors::Delete(*this);
CentredFitData<linearFitPolynomial>::Delete(*this);
CentredFitData<quadraticFitPolynomial>::Delete(*this);
CentredFitData<quadraticLinearFitPolynomial>::Delete(*this);
skewCorrectionVectors::Delete(*this);
centredCECCellToFaceStencilObject::Delete(*this);
centredCFCCellToFaceStencilObject::Delete(*this);
centredCPCCellToFaceStencilObject::Delete(*this);
centredFECCellToFaceStencilObject::Delete(*this);
// Is this geometry related - cells distorting to upwind direction?
upwindCECCellToFaceStencilObject::Delete(*this);
upwindCFCCellToFaceStencilObject::Delete(*this);
upwindCPCCellToFaceStencilObject::Delete(*this);
upwindFECCellToFaceStencilObject::Delete(*this);
centredCFCFaceToCellStencilObject::Delete(*this);
// Note: should be in polyMesh::clearGeom but meshSearch not in OpenFOAM
// library
meshSearchMeshObject::Delete(*this);
meshSearchFACECENTRETETSMeshObject::Delete(*this);
}
@ -596,24 +538,6 @@ void Foam::fvMesh::mapFields(const mapPolyMesh& meshMap)
}
// Temporary helper function to call move points on
// MeshObjects
template<class Type>
void MeshObjectMovePoints(const Foam::fvMesh& mesh)
{
if (mesh.thisDb().foundObject<Type>(Type::typeName))
{
const_cast<Type&>
(
mesh.thisDb().lookupObject<Type>
(
Type::typeName
)
).movePoints();
}
}
Foam::tmp<Foam::scalarField> Foam::fvMesh::movePoints(const pointField& p)
{
// Grab old time volumes if the time has been incremented
@ -707,15 +631,7 @@ Foam::tmp<Foam::scalarField> Foam::fvMesh::movePoints(const pointField& p)
boundary_.movePoints();
surfaceInterpolation::movePoints();
// Hack until proper callbacks. Below are all the fvMesh MeshObjects with a
// movePoints function.
MeshObjectMovePoints<volPointInterpolation>(*this);
MeshObjectMovePoints<leastSquaresVectors>(*this);
MeshObjectMovePoints<CentredFitData<linearFitPolynomial> >(*this);
MeshObjectMovePoints<CentredFitData<quadraticFitPolynomial> >(*this);
MeshObjectMovePoints<CentredFitData<quadraticLinearFitPolynomial> >(*this);
MeshObjectMovePoints<skewCorrectionVectors>(*this);
meshObject::movePoints<fvMesh>(*this);
return tsweptVols;
}
@ -737,9 +653,7 @@ void Foam::fvMesh::updateMesh(const mapPolyMesh& mpm)
clearAddressing();
// handleMorph() should also clear out the surfaceInterpolation.
// This is a temporary solution
surfaceInterpolation::movePoints();
meshObject::updateMesh<fvMesh>(*this, mpm);
}

View File

@ -40,7 +40,7 @@ Foam::FitData<Form, ExtendedStencil, Polynomial>::FitData
const scalar centralWeight
)
:
MeshObject<fvMesh, Form>(mesh),
MeshObject<fvMesh, Foam::MoveableMeshObject, Form>(mesh),
stencil_(stencil),
linearCorrection_(linearCorrection),
linearLimitFactor_(linearLimitFactor),

View File

@ -54,7 +54,7 @@ namespace Foam
template<class FitDataType, class ExtendedStencil, class Polynomial>
class FitData
:
public MeshObject<fvMesh, FitDataType>
public MeshObject<fvMesh, MoveableMeshObject, FitDataType>
{
// Private data

View File

@ -38,7 +38,7 @@ namespace Foam
Foam::skewCorrectionVectors::skewCorrectionVectors(const fvMesh& mesh)
:
MeshObject<fvMesh, skewCorrectionVectors>(mesh),
MeshObject<fvMesh, Foam::MoveableMeshObject, skewCorrectionVectors>(mesh),
skew_(false),
skewCorrectionVectors_
(

View File

@ -52,7 +52,7 @@ class fvMesh;
class skewCorrectionVectors
:
public MeshObject<fvMesh, skewCorrectionVectors>
public MeshObject<fvMesh, MoveableMeshObject, skewCorrectionVectors>
{
// Private data

View File

@ -612,9 +612,10 @@ void volPointInterpolation::makePatchPatchAddressing()
volPointInterpolation::volPointInterpolation(const fvMesh& vm)
:
MeshObject<fvMesh, volPointInterpolation>(vm)
MeshObject<fvMesh, Foam::UpdateableMeshObject, volPointInterpolation>(vm)
{
updateMesh();
makeWeights();
makePatchPatchAddressing();
}
@ -626,7 +627,7 @@ volPointInterpolation::~volPointInterpolation()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void volPointInterpolation::updateMesh()
void volPointInterpolation::updateMesh(const mapPolyMesh&)
{
makeWeights();
makePatchPatchAddressing();

View File

@ -56,7 +56,7 @@ class pointMesh;
class volPointInterpolation
:
public MeshObject<fvMesh, volPointInterpolation>
public MeshObject<fvMesh, UpdateableMeshObject, volPointInterpolation>
{
// Private data
@ -174,7 +174,7 @@ public:
// Edit
//- Update mesh topology using the morph engine
void updateMesh();
void updateMesh(const mapPolyMesh&);
//- Correct weighting factors for moving mesh.
bool movePoints();

View File

@ -120,20 +120,15 @@ void meshRefinement::testSyncBoundaryFaceList
template<class GeoField>
void meshRefinement::addPatchFields(fvMesh& mesh, const word& patchFieldType)
{
HashTable<const GeoField*> flds
HashTable<GeoField*> flds
(
mesh.objectRegistry::lookupClass<GeoField>()
);
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
forAllIter(typename HashTable<GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
const_cast<typename GeoField::GeometricBoundaryField&>
(
fld.boundaryField()
);
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld = fld.boundaryField();
label sz = bfld.size();
bfld.setSize(sz+1);
@ -155,28 +150,21 @@ void meshRefinement::addPatchFields(fvMesh& mesh, const word& patchFieldType)
template<class GeoField>
void meshRefinement::reorderPatchFields(fvMesh& mesh, const labelList& oldToNew)
{
HashTable<const GeoField*> flds
HashTable<GeoField*> flds
(
mesh.objectRegistry::lookupClass<GeoField>()
);
forAllConstIter(typename HashTable<const GeoField*>, flds, iter)
forAllIter(typename HashTable<GeoField*>, flds, iter)
{
const GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
const_cast<typename GeoField::GeometricBoundaryField&>
(
fld.boundaryField()
);
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld = fld.boundaryField();
bfld.reorder(oldToNew);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -40,7 +40,12 @@ Foam::meshSearchFACECENTRETETSMeshObject::meshSearchFACECENTRETETSMeshObject
const polyMesh& mesh
)
:
MeshObject<polyMesh, meshSearchFACECENTRETETSMeshObject>(mesh),
MeshObject
<
polyMesh,
Foam::GeometricMeshObject,
meshSearchFACECENTRETETSMeshObject
>(mesh),
meshSearch(mesh, polyMesh::FACECENTRETETS)
{}

View File

@ -48,7 +48,12 @@ namespace Foam
class meshSearchFACECENTRETETSMeshObject
:
public MeshObject<polyMesh, meshSearchFACECENTRETETSMeshObject>,
public MeshObject
<
polyMesh,
GeometricMeshObject,
meshSearchFACECENTRETETSMeshObject
>,
public meshSearch
{
@ -66,18 +71,6 @@ public:
//- Destructor
virtual ~meshSearchFACECENTRETETSMeshObject()
{}
//
// // Member functions
//
// // Edit
//
// //- Update mesh topology using the morph engine
// void updateMesh();
//
// //- Correct weighting factors for moving mesh.
// bool movePoints();
//
};

View File

@ -37,7 +37,7 @@ namespace Foam
Foam::meshSearchMeshObject::meshSearchMeshObject(const polyMesh& mesh)
:
MeshObject<polyMesh, meshSearchMeshObject>(mesh),
MeshObject<polyMesh, Foam::GeometricMeshObject, meshSearchMeshObject>(mesh),
meshSearch(mesh)
{}

View File

@ -48,7 +48,7 @@ namespace Foam
class meshSearchMeshObject
:
public MeshObject<polyMesh, meshSearchMeshObject>,
public MeshObject<polyMesh, GeometricMeshObject, meshSearchMeshObject>,
public meshSearch
{
@ -66,18 +66,6 @@ public:
//- Destructor
virtual ~meshSearchMeshObject()
{}
//
// // Member functions
//
// // Edit
//
// //- Update mesh topology using the morph engine
// void updateMesh();
//
// //- Correct weighting factors for moving mesh.
// bool movePoints();
//
};

View File

@ -692,7 +692,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::calcRegionSplit
Foam::regionSplit::regionSplit(const polyMesh& mesh)
:
MeshObject<polyMesh, regionSplit>(mesh),
MeshObject<polyMesh, Foam::TopologicalMeshObject, regionSplit>(mesh),
labelList(mesh.nCells(), -1)
{
globalNumberingPtr_ = calcRegionSplit
@ -710,7 +710,7 @@ Foam::regionSplit::regionSplit
const boolList& blockedFace
)
:
MeshObject<polyMesh, regionSplit>(mesh),
MeshObject<polyMesh, Foam::TopologicalMeshObject, regionSplit>(mesh),
labelList(mesh.nCells(), -1)
{
globalNumberingPtr_ = calcRegionSplit
@ -729,7 +729,7 @@ Foam::regionSplit::regionSplit
const List<labelPair>& explicitConnections
)
:
MeshObject<polyMesh, regionSplit>(mesh),
MeshObject<polyMesh, Foam::TopologicalMeshObject, regionSplit>(mesh),
labelList(mesh.nCells(), -1)
{
globalNumberingPtr_ = calcRegionSplit

View File

@ -113,7 +113,7 @@ class polyMesh;
class regionSplit
:
public MeshObject<polyMesh, regionSplit>,
public MeshObject<polyMesh, TopologicalMeshObject, regionSplit>,
public labelList
{
// Private data

View File

@ -88,22 +88,20 @@ void Foam::distributedTriSurfaceMesh::distributeFields
{
typedef DimensionedField<Type, triSurfaceGeoMesh> DimensionedSurfField;
HashTable<const DimensionedSurfField*> fields
HashTable<DimensionedSurfField*> fields
(
objectRegistry::lookupClass
<DimensionedSurfField >()
objectRegistry::lookupClass<DimensionedSurfField>()
);
for
(
typename HashTable<const DimensionedSurfField*>::iterator fieldIter =
typename HashTable<DimensionedSurfField*>::iterator fieldIter =
fields.begin();
fieldIter != fields.end();
++fieldIter
)
{
DimensionedSurfField& field =
const_cast<DimensionedSurfField&>(*fieldIter());
DimensionedSurfField& field = *fieldIter();
label oldSize = field.size();

View File

@ -37,7 +37,15 @@ namespace Foam
Foam::SLGThermo::SLGThermo(const fvMesh& mesh, fluidThermo& thermo)
:
MeshObject<fvMesh, SLGThermo>(mesh),
regIOobject
(
IOobject
(
SLGThermo::typeName,
mesh.polyMesh::instance(),
mesh
)
),
thermo_(thermo),
carrier_(NULL),
liquids_(NULL),
@ -246,4 +254,3 @@ bool Foam::SLGThermo::hasSolids() const
// ************************************************************************* //

View File

@ -45,7 +45,7 @@ SourceFiles
#ifndef SLGThermo_H
#define SLGThermo_H
#include "MeshObject.H"
#include "regIOobject.H"
#include "fluidThermo.H"
#include "basicMultiComponentMixture.H"
#include "liquidMixtureProperties.H"
@ -62,7 +62,7 @@ namespace Foam
class SLGThermo
:
public MeshObject<fvMesh, SLGThermo>
public regIOobject
{
// Private data
@ -145,6 +145,14 @@ public:
//- Thermo database has solid components flag
bool hasSolids() const;
// IO
bool writeData(Foam::Ostream&) const
{
return true;
}
};