resolving conflict
This commit is contained in:
commit
755e884878
@ -46,9 +46,6 @@
|
||||
)
|
||||
);
|
||||
|
||||
pointMesh pMesh(mesh);
|
||||
volPointInterpolation vpi(mesh, pMesh);
|
||||
|
||||
word kinematicCloudName("kinematicCloud");
|
||||
|
||||
if (args.options().found("cloudName"))
|
||||
@ -60,7 +57,6 @@
|
||||
basicKinematicCloud kinematicCloud
|
||||
(
|
||||
kinematicCloudName,
|
||||
vpi,
|
||||
rho,
|
||||
U,
|
||||
thermo().mu(),
|
||||
|
@ -1,8 +1,5 @@
|
||||
Info << "Constructing Spray" << endl;
|
||||
|
||||
pointMesh pMesh(mesh);
|
||||
volPointInterpolation vpi(mesh, pMesh);
|
||||
|
||||
PtrList<specieProperties> gasProperties(Y.size());
|
||||
forAll(gasProperties, i)
|
||||
{
|
||||
@ -18,7 +15,6 @@ forAll(gasProperties, i)
|
||||
|
||||
spray dieselSpray
|
||||
(
|
||||
vpi,
|
||||
U,
|
||||
rho,
|
||||
p,
|
||||
|
@ -41,6 +41,7 @@ Description
|
||||
#include "multivariateScheme.H"
|
||||
#include "Switch.H"
|
||||
#include "OFstream.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -75,7 +76,10 @@ int main(int argc, char *argv[])
|
||||
Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
|
||||
|
||||
mesh.move();
|
||||
vpi.updateMesh();
|
||||
const_cast<volPointInterpolation&>
|
||||
(
|
||||
volPointInterpolation::New(mesh)
|
||||
).updateMesh();
|
||||
|
||||
dieselSpray.evolve();
|
||||
|
||||
|
@ -52,8 +52,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
pointMesh pMesh(mesh);
|
||||
volPointInterpolation pInterp(mesh, pMesh);
|
||||
volPointInterpolation pInterp(mesh);
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
@ -642,8 +642,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
//Info<< "Writing variables data ..." << endl;
|
||||
|
||||
pointMesh pMesh(mesh);
|
||||
volPointInterpolation pInterp(mesh, pMesh);
|
||||
volPointInterpolation pInterp(mesh);
|
||||
|
||||
writeInt(fvFile, FV_VARIABLES);
|
||||
|
||||
|
@ -489,7 +489,7 @@ int main(int argc, char *argv[])
|
||||
readFields
|
||||
(
|
||||
vMesh,
|
||||
vMesh.basePointMesh(),
|
||||
pointMesh::New(vMesh.baseMesh()),
|
||||
objects,
|
||||
selectedFields,
|
||||
psf
|
||||
@ -499,7 +499,7 @@ int main(int argc, char *argv[])
|
||||
readFields
|
||||
(
|
||||
vMesh,
|
||||
vMesh.basePointMesh(),
|
||||
pointMesh::New(vMesh.baseMesh()),
|
||||
objects,
|
||||
selectedFields,
|
||||
pvf
|
||||
@ -509,7 +509,7 @@ int main(int argc, char *argv[])
|
||||
readFields
|
||||
(
|
||||
vMesh,
|
||||
vMesh.basePointMesh(),
|
||||
pointMesh::New(vMesh.baseMesh()),
|
||||
objects,
|
||||
selectedFields,
|
||||
pSpheretf
|
||||
@ -519,7 +519,7 @@ int main(int argc, char *argv[])
|
||||
readFields
|
||||
(
|
||||
vMesh,
|
||||
vMesh.basePointMesh(),
|
||||
pointMesh::New(vMesh.baseMesh()),
|
||||
objects,
|
||||
selectedFields,
|
||||
pSymmtf
|
||||
@ -529,7 +529,7 @@ int main(int argc, char *argv[])
|
||||
readFields
|
||||
(
|
||||
vMesh,
|
||||
vMesh.basePointMesh(),
|
||||
pointMesh::New(vMesh.baseMesh()),
|
||||
objects,
|
||||
selectedFields,
|
||||
ptf
|
||||
@ -598,7 +598,7 @@ int main(int argc, char *argv[])
|
||||
writer.write(ptf);
|
||||
|
||||
// Interpolated volFields
|
||||
volPointInterpolation pInterp(mesh, vMesh.pMesh());
|
||||
volPointInterpolation pInterp(mesh);
|
||||
writer.write(pInterp, vsf);
|
||||
writer.write(pInterp, vvf);
|
||||
writer.write(pInterp, vSpheretf);
|
||||
|
@ -70,7 +70,6 @@ Foam::polyMesh::readUpdateState Foam::vtkMesh::readUpdate()
|
||||
// the subset even if only movement.
|
||||
|
||||
topoPtr_.clear();
|
||||
pointMeshPtr_.clear();
|
||||
|
||||
if (setName_.size() > 0)
|
||||
{
|
||||
|
@ -39,7 +39,6 @@ SourceFiles
|
||||
|
||||
#include "vtkTopo.H"
|
||||
#include "fvMeshSubset.H"
|
||||
#include "pointMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -60,9 +59,6 @@ class vtkMesh
|
||||
//- Reference to mesh
|
||||
fvMesh& baseMesh_;
|
||||
|
||||
//- Demand driven pointMesh
|
||||
mutable autoPtr<pointMesh> pointMeshPtr_;
|
||||
|
||||
//- Subsetting engine + sub-fvMesh
|
||||
fvMeshSubset subsetter_;
|
||||
|
||||
@ -101,15 +97,6 @@ public:
|
||||
return baseMesh_;
|
||||
}
|
||||
|
||||
const pointMesh& basePointMesh() const
|
||||
{
|
||||
if (!pointMeshPtr_.valid())
|
||||
{
|
||||
pointMeshPtr_.reset(new pointMesh(baseMesh_));
|
||||
}
|
||||
return pointMeshPtr_();
|
||||
}
|
||||
|
||||
const fvMeshSubset& subsetter() const
|
||||
{
|
||||
return subsetter_;
|
||||
@ -144,19 +131,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
//- Access either pointMesh of base or pointMesh of subset
|
||||
const pointMesh& pMesh() const
|
||||
{
|
||||
if (useSubMesh())
|
||||
{
|
||||
return subsetter_.subPointMesh();
|
||||
}
|
||||
else
|
||||
{
|
||||
return basePointMesh();
|
||||
}
|
||||
}
|
||||
|
||||
//- Number of field cells
|
||||
label nFieldCells() const
|
||||
{
|
||||
@ -166,7 +140,7 @@ public:
|
||||
//- Number of field points
|
||||
label nFieldPoints() const
|
||||
{
|
||||
return pMesh().size() + topo().addPointCellLabels().size();
|
||||
return mesh().nPoints() + topo().addPointCellLabels().size();
|
||||
}
|
||||
|
||||
|
||||
|
@ -107,8 +107,7 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
}
|
||||
|
||||
// Construct interpolation on the raw mesh
|
||||
pointMesh pMesh(mesh);
|
||||
volPointInterpolation pInterp(mesh, pMesh);
|
||||
volPointInterpolation pInterp(mesh);
|
||||
|
||||
PtrList<PrimitivePatchInterpolation<primitivePatch> >
|
||||
ppInterpList(mesh.boundaryMesh().size());
|
||||
|
@ -78,11 +78,6 @@ _foamMkDir $FOAM_USER_LIBBIN
|
||||
_foamMkDir $FOAM_USER_APPBIN
|
||||
|
||||
|
||||
# Compiler settings
|
||||
# ~~~~~~~~~~~~~~~~~
|
||||
set compilerBin=
|
||||
set compilerLib=
|
||||
|
||||
# Select compiler installation
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# compilerInstall = OpenFOAM | System
|
||||
@ -111,19 +106,13 @@ case OpenFOAM:
|
||||
echo
|
||||
endif
|
||||
|
||||
set compilerBin=$WM_COMPILER_DIR/bin
|
||||
set compilerLib=$WM_COMPILER_DIR/lib${WM_COMPILER_LIB_ARCH}:$WM_COMPILER_DIR/lib
|
||||
_foamAddPath ${WM_COMPILER_DIR}/bin
|
||||
_foamAddLib ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH}
|
||||
_foamAddLib ${WM_COMPILER_DIR}/lib
|
||||
|
||||
breaksw
|
||||
endsw
|
||||
|
||||
if ($?compilerBin) then
|
||||
_foamAddPath $compilerBin
|
||||
_foamAddLib $compilerLib
|
||||
endif
|
||||
|
||||
unset compilerBin
|
||||
unset compilerLib
|
||||
|
||||
|
||||
# Communications library
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -177,12 +177,16 @@ bool Foam::objectRegistry::checkOut(regIOobject& io) const
|
||||
}
|
||||
else
|
||||
{
|
||||
regIOobject* object = iter();
|
||||
|
||||
bool hasErased = const_cast<objectRegistry&>(*this).erase(iter);
|
||||
|
||||
if (io.ownedByRegistry())
|
||||
{
|
||||
delete iter();
|
||||
delete object;
|
||||
}
|
||||
|
||||
return const_cast<objectRegistry&>(*this).erase(iter);
|
||||
return hasErased;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -148,6 +148,29 @@ const Type& Foam::MeshObject<Mesh, Type>::New
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Mesh, class Type>
|
||||
bool Foam::MeshObject<Mesh, Type>::Delete(const Mesh& mesh)
|
||||
{
|
||||
if (mesh.db().objectRegistry::foundObject<Type>(Type::typeName))
|
||||
{
|
||||
return mesh.db().objectRegistry::checkOut
|
||||
(
|
||||
const_cast<Type&>
|
||||
(
|
||||
mesh.db().objectRegistry::lookupObject<Type>
|
||||
(
|
||||
Type::typeName
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Mesh, class Type>
|
||||
Foam::MeshObject<Mesh, Type>::~MeshObject()
|
||||
{
|
||||
|
@ -106,6 +106,8 @@ public:
|
||||
|
||||
// Destructor
|
||||
|
||||
static bool Delete(const Mesh& mesh);
|
||||
|
||||
virtual ~MeshObject();
|
||||
|
||||
|
||||
|
@ -62,11 +62,16 @@ Foam::pointMesh::pointMesh
|
||||
bool alwaysConstructGlobalPatch
|
||||
)
|
||||
:
|
||||
MeshObject<polyMesh, pointMesh>(pMesh),
|
||||
GeoMesh<polyMesh>(pMesh),
|
||||
boundary_(*this, pMesh.boundaryMesh())
|
||||
{
|
||||
// Add the globalPointPatch if there are global points
|
||||
if (alwaysConstructGlobalPatch || mesh_.globalData().nGlobalPoints())
|
||||
if
|
||||
(
|
||||
alwaysConstructGlobalPatch
|
||||
|| GeoMesh<polyMesh>::mesh_.globalData().nGlobalPoints()
|
||||
)
|
||||
{
|
||||
boundary_.setSize(boundary_.size() + 1);
|
||||
|
||||
|
@ -34,6 +34,7 @@ Description
|
||||
#define pointMesh_H
|
||||
|
||||
#include "GeoMesh.H"
|
||||
#include "MeshObject.H"
|
||||
#include "polyMesh.H"
|
||||
#include "pointBoundaryMesh.H"
|
||||
|
||||
@ -48,6 +49,7 @@ namespace Foam
|
||||
|
||||
class pointMesh
|
||||
:
|
||||
public MeshObject<polyMesh, pointMesh>,
|
||||
public GeoMesh<polyMesh>
|
||||
{
|
||||
// Permanent data
|
||||
@ -95,7 +97,7 @@ public:
|
||||
//- Return number of points
|
||||
static label size(const Mesh& mesh)
|
||||
{
|
||||
return mesh.mesh_.nPoints();
|
||||
return mesh.GeoMesh<polyMesh>::mesh_.nPoints();
|
||||
}
|
||||
|
||||
//- Return reference to boundary mesh
|
||||
@ -107,7 +109,13 @@ public:
|
||||
//- Return parallel info
|
||||
const globalMeshData& globalData() const
|
||||
{
|
||||
return mesh_.globalData();
|
||||
return GeoMesh<polyMesh>::mesh_.globalData();
|
||||
}
|
||||
|
||||
//- Return database (only needed for compilation purposes)
|
||||
const objectRegistry& db() const
|
||||
{
|
||||
return GeoMesh<polyMesh>::mesh_.db();
|
||||
}
|
||||
|
||||
|
||||
|
@ -35,6 +35,8 @@ License
|
||||
#include "OSspecific.H"
|
||||
#include "demandDrivenData.H"
|
||||
|
||||
#include "pointMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
@ -1477,6 +1479,28 @@ Foam::tmp<Foam::scalarField> Foam::polyMesh::movePoints
|
||||
faceZones_.movePoints(points_);
|
||||
cellZones_.movePoints(points_);
|
||||
|
||||
|
||||
// Hack until proper callbacks. Below are all the polyMeh MeshObjects with a
|
||||
// movePoints function.
|
||||
|
||||
// pointMesh
|
||||
if
|
||||
(
|
||||
db().objectRegistry::foundObject<pointMesh>
|
||||
(
|
||||
pointMesh::typeName
|
||||
)
|
||||
)
|
||||
{
|
||||
const_cast<pointMesh&>
|
||||
(
|
||||
db().objectRegistry::lookupObject<pointMesh>
|
||||
(
|
||||
pointMesh::typeName
|
||||
)
|
||||
).movePoints(points_);
|
||||
}
|
||||
|
||||
return sweptVols;
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,8 @@ License
|
||||
#include "primitiveMesh.H"
|
||||
#include "globalMeshData.H"
|
||||
#include "demandDrivenData.H"
|
||||
#include "pointMesh.H"
|
||||
#include "Time.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -65,6 +67,8 @@ void Foam::polyMesh::clearGeom()
|
||||
{
|
||||
boundary_[patchI].clearGeom();
|
||||
}
|
||||
|
||||
pointMesh::Delete(*this);
|
||||
}
|
||||
|
||||
|
||||
@ -82,6 +86,8 @@ void Foam::polyMesh::clearAddressing()
|
||||
// parallelData depends on the processorPatch ordering so force
|
||||
// recalculation
|
||||
deleteDemandDrivenData(globalMeshDataPtr_);
|
||||
|
||||
pointMesh::Delete(*this);
|
||||
}
|
||||
|
||||
|
||||
|
@ -31,6 +31,7 @@ Description
|
||||
#include "mapPolyMesh.H"
|
||||
#include "Time.H"
|
||||
#include "globalMeshData.H"
|
||||
#include "pointMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -66,6 +67,26 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
|
||||
// Map the list
|
||||
newMotionPoints.map(oldMotionPoints, mpm.pointMap());
|
||||
}
|
||||
|
||||
// Hack until proper callbacks. Below are all the polyMesh-MeshObjects.
|
||||
|
||||
// pointMesh
|
||||
if
|
||||
(
|
||||
db().objectRegistry::foundObject<pointMesh>
|
||||
(
|
||||
pointMesh::typeName
|
||||
)
|
||||
)
|
||||
{
|
||||
const_cast<pointMesh&>
|
||||
(
|
||||
db().objectRegistry::lookupObject<pointMesh>
|
||||
(
|
||||
pointMesh::typeName
|
||||
)
|
||||
).updateMesh(mpm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,6 @@ License
|
||||
#include "cellSet.H"
|
||||
#include "syncTools.H"
|
||||
#include "motionSmoother.H"
|
||||
#include "pointMesh.H"
|
||||
#include "refinementParameters.H"
|
||||
#include "snapParameters.H"
|
||||
#include "layerParameters.H"
|
||||
|
@ -3082,7 +3082,7 @@ void Foam::autoLayerDriver::doLayers
|
||||
Info<< "Constructing mesh displacer ..." << endl;
|
||||
|
||||
{
|
||||
pointMesh pMesh(mesh);
|
||||
const pointMesh& pMesh = pointMesh::New(mesh);
|
||||
|
||||
motionSmoother meshMover
|
||||
(
|
||||
|
@ -675,7 +675,6 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
|
||||
|
||||
const polyMesh& mesh = meshMover.mesh();
|
||||
const pointField& points = mesh.points();
|
||||
const pointMesh& pMesh = meshMover.pMesh();
|
||||
|
||||
const indirectPrimitivePatch& pp = meshMover.patch();
|
||||
const vectorField& faceNormals = pp.faceNormals();
|
||||
@ -788,7 +787,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
|
||||
List<pointData> edgeWallDist(mesh.nEdges());
|
||||
PointEdgeWave<pointData> wallDistCalc
|
||||
(
|
||||
pMesh,
|
||||
mesh,
|
||||
meshPoints,
|
||||
wallInfo,
|
||||
pointWallDist,
|
||||
@ -892,7 +891,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
|
||||
// Do all calculations
|
||||
PointEdgeWave<pointData> medialDistCalc
|
||||
(
|
||||
pMesh,
|
||||
mesh,
|
||||
maxPoints,
|
||||
maxInfo,
|
||||
|
||||
@ -975,7 +974,6 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance
|
||||
Info<< "shrinkMeshMedialDistance : Smoothing using Medial Axis ..." << endl;
|
||||
|
||||
const polyMesh& mesh = meshMover.mesh();
|
||||
const pointMesh& pMesh = meshMover.pMesh();
|
||||
|
||||
const indirectPrimitivePatch& pp = meshMover.patch();
|
||||
const labelList& meshPoints = pp.meshPoints();
|
||||
@ -1100,7 +1098,7 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance
|
||||
// Do all calculations
|
||||
PointEdgeWave<pointData> wallDistCalc
|
||||
(
|
||||
pMesh,
|
||||
mesh,
|
||||
wallPoints,
|
||||
wallInfo,
|
||||
pointWallDist,
|
||||
|
@ -527,7 +527,7 @@ Foam::tmp<Foam::scalarField> Foam::autoSnapDriver::edgePatchDist
|
||||
|
||||
PointEdgeWave<pointEdgePoint> wallCalc
|
||||
(
|
||||
pMesh,
|
||||
mesh,
|
||||
pp.meshPoints(),
|
||||
wallInfo,
|
||||
|
||||
@ -1504,7 +1504,7 @@ void Foam::autoSnapDriver::doSnap
|
||||
Info<< "Constructing mesh displacer ..." << endl;
|
||||
Info<< "Using mesh parameters " << motionDict << nl << endl;
|
||||
|
||||
pointMesh pMesh(mesh);
|
||||
const pointMesh& pMesh = pointMesh::New(mesh);
|
||||
|
||||
motionSmoother meshMover
|
||||
(
|
||||
|
@ -1992,7 +1992,7 @@ void Foam::meshRefinement::dumpRefinementLevel() const
|
||||
volRefLevel.write();
|
||||
|
||||
|
||||
pointMesh pMesh(mesh_);
|
||||
const pointMesh& pMesh = pointMesh::New(mesh_);
|
||||
|
||||
pointScalarField pointRefLevel
|
||||
(
|
||||
|
@ -38,7 +38,23 @@ License
|
||||
#include "fvMeshMapper.H"
|
||||
#include "mapClouds.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
#include "volPointInterpolation.H"
|
||||
#include "extendedLeastSquaresVectors.H"
|
||||
#include "extendedLeastSquaresVectors.H"
|
||||
#include "leastSquaresVectors.H"
|
||||
//#include "linearFitData.H"
|
||||
#include "quadraticFitData.H"
|
||||
//#include "quadraticFitSnGradData.H"
|
||||
#include "skewCorrectionVectors.H"
|
||||
|
||||
#include "centredCECStencilObject.H"
|
||||
#include "centredCFCStencilObject.H"
|
||||
#include "centredCPCStencilObject.H"
|
||||
#include "centredFECStencilObject.H"
|
||||
#include "upwindCECStencilObject.H"
|
||||
#include "upwindCFCStencilObject.H"
|
||||
#include "upwindCPCStencilObject.H"
|
||||
#include "upwindFECStencilObject.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -72,12 +88,43 @@ 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);
|
||||
extendedLeastSquaresVectors::Delete(*this);
|
||||
extendedLeastSquaresVectors::Delete(*this);
|
||||
leastSquaresVectors::Delete(*this);
|
||||
//linearFitData::Delete(*this);
|
||||
quadraticFitData::Delete(*this);
|
||||
//quadraticFitSnGradData::Delete(*this);
|
||||
skewCorrectionVectors::Delete(*this);
|
||||
}
|
||||
|
||||
|
||||
void Foam::fvMesh::clearAddressing()
|
||||
{
|
||||
deleteDemandDrivenData(lduPtr_);
|
||||
|
||||
// Hack until proper callbacks. Below are all the fvMesh-MeshObjects.
|
||||
|
||||
volPointInterpolation::Delete(*this);
|
||||
extendedLeastSquaresVectors::Delete(*this);
|
||||
extendedLeastSquaresVectors::Delete(*this);
|
||||
leastSquaresVectors::Delete(*this);
|
||||
//linearFitData::Delete(*this);
|
||||
quadraticFitData::Delete(*this);
|
||||
//quadraticFitSnGradData::Delete(*this);
|
||||
skewCorrectionVectors::Delete(*this);
|
||||
|
||||
centredCECStencilObject::Delete(*this);
|
||||
centredCFCStencilObject::Delete(*this);
|
||||
centredCPCStencilObject::Delete(*this);
|
||||
centredFECStencilObject::Delete(*this);
|
||||
upwindCECStencilObject::Delete(*this);
|
||||
upwindCFCStencilObject::Delete(*this);
|
||||
upwindCPCStencilObject::Delete(*this);
|
||||
upwindFECStencilObject::Delete(*this);
|
||||
}
|
||||
|
||||
|
||||
@ -592,6 +639,137 @@ 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.
|
||||
|
||||
// volPointInterpolation
|
||||
if
|
||||
(
|
||||
db().objectRegistry::foundObject<volPointInterpolation>
|
||||
(
|
||||
volPointInterpolation::typeName
|
||||
)
|
||||
)
|
||||
{
|
||||
const_cast<volPointInterpolation&>
|
||||
(
|
||||
db().objectRegistry::lookupObject<volPointInterpolation>
|
||||
(
|
||||
volPointInterpolation::typeName
|
||||
)
|
||||
).movePoints();
|
||||
}
|
||||
|
||||
// extendedLeastSquaresVectors
|
||||
if
|
||||
(
|
||||
db().objectRegistry::foundObject<extendedLeastSquaresVectors>
|
||||
(
|
||||
extendedLeastSquaresVectors::typeName
|
||||
)
|
||||
)
|
||||
{
|
||||
const_cast<extendedLeastSquaresVectors&>
|
||||
(
|
||||
db().objectRegistry::lookupObject<extendedLeastSquaresVectors>
|
||||
(
|
||||
extendedLeastSquaresVectors::typeName
|
||||
)
|
||||
).movePoints();
|
||||
}
|
||||
|
||||
// leastSquaresVectors
|
||||
if
|
||||
(
|
||||
db().objectRegistry::foundObject<leastSquaresVectors>
|
||||
(
|
||||
leastSquaresVectors::typeName
|
||||
)
|
||||
)
|
||||
{
|
||||
const_cast<leastSquaresVectors&>
|
||||
(
|
||||
db().objectRegistry::lookupObject<leastSquaresVectors>
|
||||
(
|
||||
leastSquaresVectors::typeName
|
||||
)
|
||||
).movePoints();
|
||||
}
|
||||
|
||||
//// linearFitData
|
||||
//if
|
||||
//(
|
||||
// db().objectRegistry::foundObject<linearFitData>
|
||||
// (
|
||||
// linearFitData::typeName
|
||||
// )
|
||||
//)
|
||||
//{
|
||||
// const_cast<linearFitData&>
|
||||
// (
|
||||
// db().objectRegistry::lookupObject<linearFitData>
|
||||
// (
|
||||
// linearFitData::typeName
|
||||
// )
|
||||
// ).movePoints();
|
||||
//}
|
||||
|
||||
// quadraticFitData
|
||||
if
|
||||
(
|
||||
db().objectRegistry::foundObject<quadraticFitData>
|
||||
(
|
||||
quadraticFitData::typeName
|
||||
)
|
||||
)
|
||||
{
|
||||
const_cast<quadraticFitData&>
|
||||
(
|
||||
db().objectRegistry::lookupObject<quadraticFitData>
|
||||
(
|
||||
quadraticFitData::typeName
|
||||
)
|
||||
).movePoints();
|
||||
}
|
||||
|
||||
//// quadraticFitSnGradData
|
||||
//if
|
||||
//(
|
||||
// db().objectRegistry::foundObject<quadraticFitSnGradData>
|
||||
// (
|
||||
// quadraticFitSnGradData::typeName
|
||||
// )
|
||||
//)
|
||||
//{
|
||||
// const_cast<quadraticFitSnGradData&>
|
||||
// (
|
||||
// db().objectRegistry::lookupObject<quadraticFitSnGradData>
|
||||
// (
|
||||
// quadraticFitSnGradData::typeName
|
||||
// )
|
||||
// ).movePoints();
|
||||
//}
|
||||
|
||||
// skewCorrectionVectors
|
||||
if
|
||||
(
|
||||
db().objectRegistry::foundObject<skewCorrectionVectors>
|
||||
(
|
||||
skewCorrectionVectors::typeName
|
||||
)
|
||||
)
|
||||
{
|
||||
const_cast<skewCorrectionVectors&>
|
||||
(
|
||||
db().objectRegistry::lookupObject<skewCorrectionVectors>
|
||||
(
|
||||
skewCorrectionVectors::typeName
|
||||
)
|
||||
).movePoints();
|
||||
}
|
||||
|
||||
|
||||
return tsweptVols;
|
||||
}
|
||||
|
||||
|
@ -680,7 +680,6 @@ void Foam::fvMeshSubset::setCellSubset
|
||||
newCells
|
||||
)
|
||||
);
|
||||
pointMeshSubsetPtr_.clear();
|
||||
|
||||
|
||||
// Add old patches
|
||||
@ -1180,7 +1179,6 @@ void Foam::fvMeshSubset::setLargeCellSubset
|
||||
syncPar // parallel synchronisation
|
||||
)
|
||||
);
|
||||
pointMeshSubsetPtr_.clear();
|
||||
|
||||
// Add old patches
|
||||
List<polyPatch*> newBoundary(nbSize);
|
||||
@ -1370,26 +1368,6 @@ fvMesh& Foam::fvMeshSubset::subMesh()
|
||||
}
|
||||
|
||||
|
||||
const pointMesh& Foam::fvMeshSubset::subPointMesh() const
|
||||
{
|
||||
if (!pointMeshSubsetPtr_.valid())
|
||||
{
|
||||
pointMeshSubsetPtr_.reset(new pointMesh(subMesh()));
|
||||
}
|
||||
return pointMeshSubsetPtr_();
|
||||
}
|
||||
|
||||
|
||||
pointMesh& Foam::fvMeshSubset::subPointMesh()
|
||||
{
|
||||
if (!pointMeshSubsetPtr_.valid())
|
||||
{
|
||||
pointMeshSubsetPtr_.reset(new pointMesh(subMesh()));
|
||||
}
|
||||
return pointMeshSubsetPtr_();
|
||||
}
|
||||
|
||||
|
||||
const labelList& Foam::fvMeshSubset::pointMap() const
|
||||
{
|
||||
checkCellSubset();
|
||||
|
@ -171,8 +171,6 @@ private:
|
||||
//- Subset mesh pointer
|
||||
autoPtr<fvMesh> fvMeshSubsetPtr_;
|
||||
|
||||
mutable autoPtr<pointMesh> pointMeshSubsetPtr_;
|
||||
|
||||
//- Point mapping array
|
||||
labelList pointMap_;
|
||||
|
||||
@ -278,11 +276,6 @@ public:
|
||||
|
||||
fvMesh& subMesh();
|
||||
|
||||
//- Return reference to demand-driven subset pointMesh
|
||||
const pointMesh& subPointMesh() const;
|
||||
|
||||
pointMesh& subPointMesh();
|
||||
|
||||
//- Return point map
|
||||
const labelList& pointMap() const;
|
||||
|
||||
|
@ -409,7 +409,7 @@ tmp<GeometricField<Type, pointPatchField, pointMesh> > fvMeshSubset::interpolate
|
||||
return interpolate
|
||||
(
|
||||
sf,
|
||||
subPointMesh(), // subsetted point mesh
|
||||
pointMesh::New(subMesh()), // subsetted point mesh
|
||||
subMesh(), // registry (pointfields are stored on the polyMesh)
|
||||
patchMap(),
|
||||
pointMap()
|
||||
|
@ -46,7 +46,6 @@ namespace Foam
|
||||
{
|
||||
|
||||
class polyMesh;
|
||||
class volPointInterpolation;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class interpolation Declaration
|
||||
@ -83,10 +82,9 @@ public:
|
||||
interpolation,
|
||||
dictionary,
|
||||
(
|
||||
const volPointInterpolation& pInterp,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& psi
|
||||
),
|
||||
(pInterp, psi)
|
||||
(psi)
|
||||
);
|
||||
|
||||
|
||||
@ -96,7 +94,6 @@ public:
|
||||
static autoPtr<interpolation<Type> > New
|
||||
(
|
||||
const word& interpolationType,
|
||||
const volPointInterpolation& pInterp,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& psi
|
||||
);
|
||||
|
||||
@ -104,7 +101,6 @@ public:
|
||||
static autoPtr<interpolation<Type> > New
|
||||
(
|
||||
const dictionary& interpolationSchemes,
|
||||
const volPointInterpolation& pInterp,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& psi
|
||||
);
|
||||
|
||||
|
@ -34,7 +34,6 @@ Foam::autoPtr<Foam::interpolation<Type> >
|
||||
Foam::interpolation<Type>::New
|
||||
(
|
||||
const word& interpolationType,
|
||||
const volPointInterpolation& pInterp,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& psi
|
||||
)
|
||||
{
|
||||
@ -55,7 +54,7 @@ Foam::interpolation<Type>::New
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<interpolation<Type> >(cstrIter()(pInterp, psi));
|
||||
return autoPtr<interpolation<Type> >(cstrIter()(psi));
|
||||
}
|
||||
|
||||
|
||||
@ -64,11 +63,10 @@ Foam::autoPtr<Foam::interpolation<Type> >
|
||||
Foam::interpolation<Type>::New
|
||||
(
|
||||
const dictionary& interpolationSchemes,
|
||||
const volPointInterpolation& pInterp,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& psi
|
||||
)
|
||||
{
|
||||
return New(word(interpolationSchemes.lookup(psi.name())), pInterp, psi);
|
||||
return New(word(interpolationSchemes.lookup(psi.name())), psi);
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,7 +39,6 @@ namespace Foam
|
||||
template<class Type>
|
||||
interpolationCell<Type>::interpolationCell
|
||||
(
|
||||
const volPointInterpolation&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& psi
|
||||
)
|
||||
:
|
||||
|
@ -63,7 +63,6 @@ public:
|
||||
//- Construct from components
|
||||
interpolationCell
|
||||
(
|
||||
const volPointInterpolation& pInterp,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& psi
|
||||
);
|
||||
|
||||
|
@ -32,12 +32,11 @@ License
|
||||
template<class Type>
|
||||
Foam::interpolationCellPoint<Type>::interpolationCellPoint
|
||||
(
|
||||
const volPointInterpolation& pInterp,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& psi
|
||||
)
|
||||
:
|
||||
interpolation<Type>(psi),
|
||||
psip_(pInterp.interpolate(psi))
|
||||
psip_(volPointInterpolation::New(psi.mesh()).interpolate(psi))
|
||||
{}
|
||||
|
||||
|
||||
|
@ -52,7 +52,8 @@ class interpolationCellPoint
|
||||
{
|
||||
// Private data
|
||||
|
||||
GeometricField<Type, pointPatchField, pointMesh> psip_;
|
||||
//- Interpolated volfield
|
||||
const GeometricField<Type, pointPatchField, pointMesh> psip_;
|
||||
|
||||
|
||||
public:
|
||||
@ -66,7 +67,6 @@ public:
|
||||
//- Construct from components
|
||||
interpolationCellPoint
|
||||
(
|
||||
const volPointInterpolation& pInterp,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& psi
|
||||
);
|
||||
|
||||
|
@ -44,12 +44,11 @@ namespace Foam
|
||||
template<class Type>
|
||||
interpolationCellPointFace<Type>::interpolationCellPointFace
|
||||
(
|
||||
const volPointInterpolation& pInterp,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& psi
|
||||
)
|
||||
:
|
||||
interpolation<Type>(psi),
|
||||
psip_(pInterp.interpolate(psi)),
|
||||
psip_(volPointInterpolation::New(psi.mesh()).interpolate(psi)),
|
||||
psis_(linearInterpolate(psi))
|
||||
{}
|
||||
|
||||
|
@ -51,8 +51,11 @@ class interpolationCellPointFace
|
||||
{
|
||||
// Private data
|
||||
|
||||
GeometricField<Type, pointPatchField, pointMesh> psip_;
|
||||
GeometricField<Type, fvsPatchField, surfaceMesh> psis_;
|
||||
//- Interpolated volfield
|
||||
const GeometricField<Type, pointPatchField, pointMesh> psip_;
|
||||
|
||||
//- Linearly interpolated volfield
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh> psis_;
|
||||
|
||||
bool findTet
|
||||
(
|
||||
@ -87,7 +90,6 @@ public:
|
||||
//- Construct from components
|
||||
interpolationCellPointFace
|
||||
(
|
||||
const volPointInterpolation& pInterp,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& psi
|
||||
);
|
||||
|
||||
|
@ -62,7 +62,7 @@ void pointPatchInterpolation::interpolate
|
||||
// patch
|
||||
|
||||
const fvBoundaryMesh& bm = fvMesh_.boundary();
|
||||
const pointBoundaryMesh& pbm = pointMesh_.boundary();
|
||||
const pointBoundaryMesh& pbm = pointMesh::New(fvMesh_).boundary();
|
||||
|
||||
forAll(bm, patchi)
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ void pointPatchInterpolation::makePatchPatchAddressing()
|
||||
}
|
||||
|
||||
const fvBoundaryMesh& bm = fvMesh_.boundary();
|
||||
const pointBoundaryMesh& pbm = pointMesh_.boundary();
|
||||
const pointBoundaryMesh& pbm = pointMesh::New(fvMesh_).boundary();
|
||||
|
||||
// first count the total number of patch-patch points
|
||||
|
||||
@ -188,7 +188,7 @@ void pointPatchInterpolation::makePatchPatchWeights()
|
||||
fvMesh_.polyMesh::instance(),
|
||||
fvMesh_
|
||||
),
|
||||
pointMesh_,
|
||||
pointMesh::New(fvMesh_),
|
||||
dimensionedScalar("zero", dimless, 0)
|
||||
);
|
||||
|
||||
@ -285,14 +285,9 @@ void pointPatchInterpolation::makePatchPatchWeights()
|
||||
|
||||
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
||||
|
||||
pointPatchInterpolation::pointPatchInterpolation
|
||||
(
|
||||
const fvMesh& vm,
|
||||
const pointMesh& pm
|
||||
)
|
||||
pointPatchInterpolation::pointPatchInterpolation(const fvMesh& vm)
|
||||
:
|
||||
fvMesh_(vm),
|
||||
pointMesh_(pm)
|
||||
fvMesh_(vm)
|
||||
{
|
||||
updateMesh();
|
||||
}
|
||||
|
@ -61,7 +61,6 @@ class pointPatchInterpolation
|
||||
// Private data
|
||||
|
||||
const fvMesh& fvMesh_;
|
||||
const pointMesh& pointMesh_;
|
||||
|
||||
//- Primitive patch interpolators
|
||||
PtrList<primitivePatchInterpolation> patchInterpolators_;
|
||||
@ -101,7 +100,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Constructor given fvMesh and pointMesh.
|
||||
pointPatchInterpolation(const fvMesh&, const pointMesh&);
|
||||
pointPatchInterpolation(const fvMesh&);
|
||||
|
||||
|
||||
// Destructor
|
||||
@ -118,11 +117,6 @@ public:
|
||||
return fvMesh_;
|
||||
}
|
||||
|
||||
const pointMesh& pMesh() const
|
||||
{
|
||||
return pointMesh_;
|
||||
}
|
||||
|
||||
|
||||
// Edit
|
||||
|
||||
|
@ -103,18 +103,20 @@ volPointInterpolation::interpolate
|
||||
{
|
||||
wordList types(patchFieldTypes);
|
||||
|
||||
const pointMesh& pMesh = pointMesh::New(vf.mesh());
|
||||
|
||||
// If the last patch of the pointBoundaryMesh is the global patch
|
||||
// it must be added to the list of patchField types
|
||||
if
|
||||
(
|
||||
isType<globalPointPatch>
|
||||
(
|
||||
pMesh().boundary()[pMesh().boundary().size() - 1]
|
||||
pMesh.boundary()[pMesh.boundary().size() - 1]
|
||||
)
|
||||
)
|
||||
{
|
||||
types.setSize(types.size() + 1);
|
||||
types[types.size()-1] = pMesh().boundary()[types.size()-1].type();
|
||||
types[types.size()-1] = pMesh.boundary()[types.size()-1].type();
|
||||
}
|
||||
|
||||
// Construct tmp<pointField>
|
||||
@ -128,7 +130,7 @@ volPointInterpolation::interpolate
|
||||
vf.instance(),
|
||||
vf.db()
|
||||
),
|
||||
pMesh(),
|
||||
pMesh,
|
||||
vf.dimensions(),
|
||||
types
|
||||
)
|
||||
@ -176,7 +178,7 @@ volPointInterpolation::interpolate
|
||||
vf.instance(),
|
||||
vf.db()
|
||||
),
|
||||
pMesh(),
|
||||
pointMesh::New(vf.mesh()),
|
||||
vf.dimensions()
|
||||
)
|
||||
);
|
||||
|
@ -74,7 +74,7 @@ void volPointInterpolation::makeWeights()
|
||||
mesh().polyMesh::instance(),
|
||||
mesh()
|
||||
),
|
||||
pMesh(),
|
||||
pointMesh::New(mesh()),
|
||||
dimensionedScalar("zero", dimless, 0)
|
||||
);
|
||||
|
||||
@ -139,13 +139,10 @@ void volPointInterpolation::makeWeights()
|
||||
|
||||
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
||||
|
||||
volPointInterpolation::volPointInterpolation
|
||||
(
|
||||
const fvMesh& vm,
|
||||
const pointMesh& pm
|
||||
)
|
||||
volPointInterpolation::volPointInterpolation(const fvMesh& vm)
|
||||
:
|
||||
boundaryInterpolator_(vm, pm)
|
||||
MeshObject<fvMesh, volPointInterpolation>(vm),
|
||||
boundaryInterpolator_(vm)
|
||||
{
|
||||
updateMesh();
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ SourceFiles
|
||||
#ifndef volPointInterpolation_H
|
||||
#define volPointInterpolation_H
|
||||
|
||||
#include "MeshObject.H"
|
||||
#include "pointPatchInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -52,6 +53,8 @@ class pointMesh;
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class volPointInterpolation
|
||||
:
|
||||
public MeshObject<fvMesh, volPointInterpolation>
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -83,7 +86,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Constructor given fvMesh and pointMesh.
|
||||
volPointInterpolation(const fvMesh&, const pointMesh&);
|
||||
explicit volPointInterpolation(const fvMesh&);
|
||||
|
||||
|
||||
// Destructor
|
||||
@ -100,11 +103,6 @@ public:
|
||||
return boundaryInterpolator_.mesh();
|
||||
}
|
||||
|
||||
const pointMesh& pMesh() const
|
||||
{
|
||||
return boundaryInterpolator_.pMesh();
|
||||
}
|
||||
|
||||
|
||||
// Edit
|
||||
|
||||
|
@ -33,6 +33,7 @@ License
|
||||
#include "surfaceInterpolate.H"
|
||||
#include "fvcLaplacian.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -83,7 +84,7 @@ Foam::displacementSBRStressFvMotionSolver::displacementSBRStressFvMotionSolver
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
pointMesh_
|
||||
pointMesh::New(fvMesh_)
|
||||
),
|
||||
cellDisplacement_
|
||||
(
|
||||
@ -123,7 +124,11 @@ Foam::displacementSBRStressFvMotionSolver::
|
||||
Foam::tmp<Foam::pointField>
|
||||
Foam::displacementSBRStressFvMotionSolver::curPoints() const
|
||||
{
|
||||
vpi_.interpolate(cellDisplacement_, pointDisplacement_);
|
||||
volPointInterpolation::New(fvMesh_).interpolate
|
||||
(
|
||||
cellDisplacement_,
|
||||
pointDisplacement_
|
||||
);
|
||||
|
||||
tmp<pointField> tcurPoints
|
||||
(
|
||||
|
@ -29,6 +29,7 @@ License
|
||||
#include "fvmLaplacian.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -117,7 +118,7 @@ displacementComponentLaplacianFvMotionSolver
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
pointMesh_
|
||||
pointMesh::New(fvMesh_)
|
||||
),
|
||||
cellDisplacement_
|
||||
(
|
||||
@ -173,7 +174,7 @@ displacementComponentLaplacianFvMotionSolver
|
||||
new pointVectorField
|
||||
(
|
||||
io,
|
||||
pointMesh_
|
||||
pointMesh::New(fvMesh_)
|
||||
)
|
||||
);
|
||||
|
||||
@ -202,7 +203,11 @@ Foam::displacementComponentLaplacianFvMotionSolver::
|
||||
Foam::tmp<Foam::pointField>
|
||||
Foam::displacementComponentLaplacianFvMotionSolver::curPoints() const
|
||||
{
|
||||
vpi_.interpolate(cellDisplacement_, pointDisplacement_);
|
||||
volPointInterpolation::New(fvMesh_).interpolate
|
||||
(
|
||||
cellDisplacement_,
|
||||
pointDisplacement_
|
||||
);
|
||||
|
||||
if (pointLocation_.valid())
|
||||
{
|
||||
|
@ -334,7 +334,8 @@ displacementInterpolationFvMotionSolver
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::displacementInterpolationFvMotionSolver::~displacementInterpolationFvMotionSolver()
|
||||
Foam::displacementInterpolationFvMotionSolver::
|
||||
~displacementInterpolationFvMotionSolver()
|
||||
{}
|
||||
|
||||
|
||||
|
@ -31,6 +31,7 @@ License
|
||||
#include "OFstream.H"
|
||||
#include "meshTools.H"
|
||||
#include "mapPolyMesh.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -82,7 +83,7 @@ Foam::displacementLaplacianFvMotionSolver::displacementLaplacianFvMotionSolver
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
pointMesh_
|
||||
pointMesh::New(fvMesh_)
|
||||
),
|
||||
cellDisplacement_
|
||||
(
|
||||
@ -139,7 +140,7 @@ Foam::displacementLaplacianFvMotionSolver::displacementLaplacianFvMotionSolver
|
||||
new pointVectorField
|
||||
(
|
||||
io,
|
||||
pointMesh_
|
||||
pointMesh::New(fvMesh_)
|
||||
)
|
||||
);
|
||||
|
||||
@ -168,7 +169,11 @@ Foam::displacementLaplacianFvMotionSolver::
|
||||
Foam::tmp<Foam::pointField>
|
||||
Foam::displacementLaplacianFvMotionSolver::curPoints() const
|
||||
{
|
||||
vpi_.interpolate(cellDisplacement_, pointDisplacement_);
|
||||
volPointInterpolation::New(fvMesh_).interpolate
|
||||
(
|
||||
cellDisplacement_,
|
||||
pointDisplacement_
|
||||
);
|
||||
|
||||
if (pointLocation_.valid())
|
||||
{
|
||||
|
@ -25,6 +25,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvMotionSolver.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -39,9 +40,7 @@ namespace Foam
|
||||
Foam::fvMotionSolver::fvMotionSolver(const polyMesh& mesh)
|
||||
:
|
||||
motionSolver(mesh),
|
||||
fvMesh_(refCast<const fvMesh>(mesh)),
|
||||
pointMesh_(fvMesh_),
|
||||
vpi_(fvMesh_, pointMesh_)
|
||||
fvMesh_(refCast<const fvMesh>(mesh))
|
||||
{}
|
||||
|
||||
|
||||
@ -55,16 +54,14 @@ Foam::fvMotionSolver::~fvMotionSolver()
|
||||
|
||||
void Foam::fvMotionSolver::movePoints(const pointField& p)
|
||||
{
|
||||
pointMesh_.movePoints(p);
|
||||
vpi_.movePoints();
|
||||
// Movement of pointMesh and volPointInterpolation done by polyMesh,fvMesh
|
||||
}
|
||||
|
||||
|
||||
void Foam::fvMotionSolver::updateMesh(const mapPolyMesh& mpm)
|
||||
{
|
||||
motionSolver::updateMesh(mpm);
|
||||
pointMesh_.updateMesh(mpm);
|
||||
vpi_.updateMesh();
|
||||
// Update of pointMesh and volPointInterpolation done by polyMesh,fvMesh
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,13 +40,16 @@ SourceFiles
|
||||
#define fvMotionSolver_H
|
||||
|
||||
#include "motionSolver.H"
|
||||
#include "volPointInterpolation.H"
|
||||
#include "pointFieldsFwd.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class fvMesh;
|
||||
class mapPolyMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class fvMotionSolver Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -63,13 +66,6 @@ protected:
|
||||
//- The fvMesh to be moved
|
||||
const fvMesh& fvMesh_;
|
||||
|
||||
//- Point mesh needed by the volPointInterpolation
|
||||
mutable pointMesh pointMesh_;
|
||||
|
||||
//- Vol-point interpolator used to obtain the point motion from
|
||||
// the cell-centre motion
|
||||
mutable volPointInterpolation vpi_;
|
||||
|
||||
|
||||
// Protected member functions
|
||||
|
||||
|
@ -28,6 +28,7 @@ License
|
||||
#include "motionDiffusivity.H"
|
||||
#include "fvmLaplacian.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -66,7 +67,7 @@ velocityComponentLaplacianFvMotionSolver
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
pointMesh_
|
||||
pointMesh::New(fvMesh_)
|
||||
),
|
||||
cellMotionU_
|
||||
(
|
||||
@ -129,7 +130,11 @@ Foam::velocityComponentLaplacianFvMotionSolver::
|
||||
Foam::tmp<Foam::pointField>
|
||||
Foam::velocityComponentLaplacianFvMotionSolver::curPoints() const
|
||||
{
|
||||
vpi_.interpolate(cellMotionU_, pointMotionU_);
|
||||
volPointInterpolation::New(fvMesh_).interpolate
|
||||
(
|
||||
cellMotionU_,
|
||||
pointMotionU_
|
||||
);
|
||||
|
||||
tmp<pointField> tcurPoints(new pointField(fvMesh_.points()));
|
||||
|
||||
|
@ -28,6 +28,7 @@ License
|
||||
#include "motionDiffusivity.H"
|
||||
#include "fvmLaplacian.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -63,7 +64,7 @@ Foam::velocityLaplacianFvMotionSolver::velocityLaplacianFvMotionSolver
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
pointMesh_
|
||||
pointMesh::New(fvMesh_)
|
||||
),
|
||||
cellMotionU_
|
||||
(
|
||||
@ -102,7 +103,11 @@ Foam::velocityLaplacianFvMotionSolver::~velocityLaplacianFvMotionSolver()
|
||||
Foam::tmp<Foam::pointField>
|
||||
Foam::velocityLaplacianFvMotionSolver::curPoints() const
|
||||
{
|
||||
vpi_.interpolate(cellMotionU_, pointMotionU_);
|
||||
volPointInterpolation::New(fvMesh_).interpolate
|
||||
(
|
||||
cellMotionU_,
|
||||
pointMotionU_
|
||||
);
|
||||
|
||||
tmp<pointField> tcurPoints
|
||||
(
|
||||
|
@ -73,9 +73,6 @@ void Foam::inversePointDistanceDiffusivity::correct()
|
||||
const polyMesh& mesh = mSolver().mesh();
|
||||
const polyBoundaryMesh& bdry = mesh.boundaryMesh();
|
||||
|
||||
// Construct point mesh
|
||||
const pointMesh pMesh(mesh);
|
||||
|
||||
labelHashSet patchSet(bdry.size());
|
||||
|
||||
label nPatchEdges = 0;
|
||||
@ -133,7 +130,7 @@ void Foam::inversePointDistanceDiffusivity::correct()
|
||||
// Do calculations
|
||||
PointEdgeWave<pointEdgePoint> waveInfo
|
||||
(
|
||||
pMesh,
|
||||
mesh,
|
||||
seedPoints,
|
||||
seedInfo,
|
||||
|
||||
|
@ -37,7 +37,6 @@ SourceFiles
|
||||
#define Cloud_H
|
||||
|
||||
#include "cloud.H"
|
||||
#include "pointMesh.H"
|
||||
#include "IDLList.H"
|
||||
#include "IOField.H"
|
||||
|
||||
@ -231,8 +230,14 @@ public:
|
||||
|
||||
// Read
|
||||
|
||||
//- Read and return a lagrangian data field
|
||||
// Checks that data is valid
|
||||
//- Helper to construct IOobject for field and current time.
|
||||
IOobject fieldIOobject
|
||||
(
|
||||
const word& fieldName,
|
||||
const IOobject::readOption r
|
||||
) const;
|
||||
|
||||
//- Check lagrangian data field
|
||||
template<class DataType>
|
||||
void checkFieldIOobject
|
||||
(
|
||||
@ -240,13 +245,6 @@ public:
|
||||
const IOField<DataType>& data
|
||||
) const;
|
||||
|
||||
//- Read and return a lagrangian data field
|
||||
IOobject fieldIOobject(const word& fieldName) const;
|
||||
|
||||
//- Read and return a lagrangian data field
|
||||
template<class Type>
|
||||
tmp<IOField<Type> > readField(const word& fieldName) const;
|
||||
|
||||
//- Read the field data for the cloud of particles
|
||||
void readFields();
|
||||
|
||||
|
@ -103,6 +103,25 @@ Foam::Cloud<ParticleType>::Cloud
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::IOobject Foam::Cloud<ParticleType>::fieldIOobject
|
||||
(
|
||||
const word& fieldName,
|
||||
const IOobject::readOption r
|
||||
) const
|
||||
{
|
||||
return IOobject
|
||||
(
|
||||
fieldName,
|
||||
time().timeName(),
|
||||
*this,
|
||||
r,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
template<class DataType>
|
||||
void Foam::Cloud<ParticleType>::checkFieldIOobject
|
||||
@ -116,7 +135,7 @@ void Foam::Cloud<ParticleType>::checkFieldIOobject
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Cloud<ParticleType>::checkFieldIOobject"
|
||||
"(Cloud<ParticleType>, IOField<DataType>)"
|
||||
"(const Cloud<ParticleType>&, const IOField<DataType>&) const"
|
||||
) << "Size of " << data.name()
|
||||
<< " field " << data.size()
|
||||
<< " does not match the number of particles " << c.size()
|
||||
@ -125,35 +144,6 @@ void Foam::Cloud<ParticleType>::checkFieldIOobject
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::IOobject Foam::Cloud<ParticleType>::fieldIOobject
|
||||
(
|
||||
const word& fieldName
|
||||
) const
|
||||
{
|
||||
return IOobject
|
||||
(
|
||||
fieldName,
|
||||
time().timeName(),
|
||||
*this,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::IOField<Type> > Foam::Cloud<ParticleType>::readField
|
||||
(
|
||||
const word& fieldName
|
||||
) const
|
||||
{
|
||||
return tmp<IOField<Type> >(new IOField<Type>(fieldIOobject(fieldName)));
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
void Foam::Cloud<ParticleType>::readFields()
|
||||
{}
|
||||
|
@ -106,43 +106,46 @@ void Foam::parcel::readFields
|
||||
return;
|
||||
}
|
||||
|
||||
IOField<scalar> d(c.fieldIOobject("d"));
|
||||
IOField<scalar> d(c.fieldIOobject("d", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, d);
|
||||
|
||||
IOField<scalar> T(c.fieldIOobject("T"));
|
||||
IOField<scalar> T(c.fieldIOobject("T", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, T);
|
||||
|
||||
IOField<scalar> m(c.fieldIOobject("m"));
|
||||
IOField<scalar> m(c.fieldIOobject("m", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, m);
|
||||
|
||||
IOField<scalar> y(c.fieldIOobject("y"));
|
||||
IOField<scalar> y(c.fieldIOobject("y", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, y);
|
||||
|
||||
IOField<scalar> yDot(c.fieldIOobject("yDot"));
|
||||
IOField<scalar> yDot(c.fieldIOobject("yDot", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, yDot);
|
||||
|
||||
IOField<scalar> ct(c.fieldIOobject("ct"));
|
||||
IOField<scalar> ct(c.fieldIOobject("ct", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, ct);
|
||||
|
||||
IOField<scalar> ms(c.fieldIOobject("ms"));
|
||||
IOField<scalar> ms(c.fieldIOobject("ms", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, ms);
|
||||
|
||||
IOField<scalar> tTurb(c.fieldIOobject("tTurb"));
|
||||
IOField<scalar> tTurb(c.fieldIOobject("tTurb", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, tTurb);
|
||||
|
||||
IOField<scalar> liquidCore(c.fieldIOobject("liquidCore"));
|
||||
IOField<scalar> liquidCore
|
||||
(
|
||||
c.fieldIOobject("liquidCore", IOobject::MUST_READ)
|
||||
);
|
||||
c.checkFieldIOobject(c, liquidCore);
|
||||
|
||||
IOField<scalar> injector(c.fieldIOobject("injector"));
|
||||
IOField<scalar> injector(c.fieldIOobject("injector", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, injector);
|
||||
|
||||
IOField<vector> U(c.fieldIOobject("U"));
|
||||
IOField<vector> U(c.fieldIOobject("U", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, U);
|
||||
|
||||
IOField<vector> Uturb(c.fieldIOobject("Uturb"));
|
||||
IOField<vector> Uturb(c.fieldIOobject("Uturb", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, Uturb);
|
||||
|
||||
IOField<vector> n(c.fieldIOobject("n"));
|
||||
IOField<vector> n(c.fieldIOobject("n", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, n);
|
||||
|
||||
label i = 0;
|
||||
@ -179,7 +182,7 @@ void Foam::parcel::readFields
|
||||
|
||||
for (label j=0; j<nX; j++)
|
||||
{
|
||||
IOField<scalar> X(c.fieldIOobject(names[j]));
|
||||
IOField<scalar> X(c.fieldIOobject(names[j], IOobject::MUST_READ));
|
||||
|
||||
label i = 0;
|
||||
forAllIter(Cloud<parcel>, c, iter)
|
||||
@ -201,20 +204,27 @@ void Foam::parcel::writeFields
|
||||
|
||||
label np = c.size();
|
||||
|
||||
IOField<scalar> d(c.fieldIOobject("d"), np);
|
||||
IOField<scalar> T(c.fieldIOobject("T"), np);
|
||||
IOField<scalar> m(c.fieldIOobject("m"), np);
|
||||
IOField<scalar> y(c.fieldIOobject("y"), np);
|
||||
IOField<scalar> yDot(c.fieldIOobject("yDot"), np);
|
||||
IOField<scalar> ct(c.fieldIOobject("ct"), np);
|
||||
IOField<scalar> ms(c.fieldIOobject("ms"), np);
|
||||
IOField<scalar> tTurb(c.fieldIOobject("tTurb"), np);
|
||||
IOField<scalar> liquidCore(c.fieldIOobject("liquidCore"), np);
|
||||
IOField<scalar> injector(c.fieldIOobject("injector"), np);
|
||||
|
||||
IOField<vector> U(c.fieldIOobject("U"), np);
|
||||
IOField<vector> Uturb(c.fieldIOobject("Uturb"), np);
|
||||
IOField<vector> n(c.fieldIOobject("n"), np);
|
||||
IOField<scalar> d(c.fieldIOobject("d", IOobject::NO_READ), np);
|
||||
IOField<scalar> T(c.fieldIOobject("T", IOobject::NO_READ), np);
|
||||
IOField<scalar> m(c.fieldIOobject("m", IOobject::NO_READ), np);
|
||||
IOField<scalar> y(c.fieldIOobject("y", IOobject::NO_READ), np);
|
||||
IOField<scalar> yDot(c.fieldIOobject("yDot", IOobject::NO_READ), np);
|
||||
IOField<scalar> ct(c.fieldIOobject("ct", IOobject::NO_READ), np);
|
||||
IOField<scalar> ms(c.fieldIOobject("ms", IOobject::NO_READ), np);
|
||||
IOField<scalar> tTurb(c.fieldIOobject("tTurb", IOobject::NO_READ), np);
|
||||
IOField<scalar> liquidCore
|
||||
(
|
||||
c.fieldIOobject("liquidCore", IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
IOField<scalar> injector
|
||||
(
|
||||
c.fieldIOobject("injector", IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
IOField<vector> U(c.fieldIOobject("U", IOobject::NO_READ), np);
|
||||
IOField<vector> Uturb(c.fieldIOobject("Uturb", IOobject::NO_READ), np);
|
||||
IOField<vector> n(c.fieldIOobject("n", IOobject::NO_READ), np);
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(Cloud<parcel>, c, iter)
|
||||
@ -265,7 +275,7 @@ void Foam::parcel::writeFields
|
||||
|
||||
for (label j=0; j<nX; j++)
|
||||
{
|
||||
IOField<scalar> X(c.fieldIOobject(names[j]), np);
|
||||
IOField<scalar> X(c.fieldIOobject(names[j], IOobject::NO_READ), np);
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(Cloud<parcel>, c, iter)
|
||||
|
@ -52,7 +52,6 @@ defineTemplateTypeNameAndDebug(IOPtrList<injector>, 0);
|
||||
// Construct from components
|
||||
Foam::spray::spray
|
||||
(
|
||||
const volPointInterpolation& vpi,
|
||||
const volVectorField& U,
|
||||
const volScalarField& rho,
|
||||
const volScalarField& p,
|
||||
@ -67,7 +66,6 @@ Foam::spray::spray
|
||||
runTime_(U.time()),
|
||||
time0_(runTime_.value()),
|
||||
mesh_(U.mesh()),
|
||||
volPointInterpolation_(vpi),
|
||||
rndGen_(label(0)),
|
||||
|
||||
U_(U),
|
||||
@ -263,7 +261,7 @@ Foam::spray::spray
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"spray::spray(const pointMesh& pMesh, const volVectorField& U, "
|
||||
"spray::spray(const volVectorField& U, "
|
||||
"const volScalarField& rho, const volScalarField& p, "
|
||||
"const volScalarField& T, const combustionMixture& composition,"
|
||||
"const PtrList<specieProperties>& gaseousFuelProperties, "
|
||||
|
@ -36,7 +36,6 @@ Description
|
||||
#include "parcel.H"
|
||||
#include "injector.H"
|
||||
#include "IOPtrList.H"
|
||||
#include "volPointInterpolation.H"
|
||||
#include "interpolation.H"
|
||||
#include "liquid.H"
|
||||
#include "sprayThermoTypes.H"
|
||||
@ -76,7 +75,6 @@ class spray
|
||||
const Time& runTime_;
|
||||
scalar time0_;
|
||||
const fvMesh& mesh_;
|
||||
const volPointInterpolation& volPointInterpolation_;
|
||||
|
||||
//- Random number generator
|
||||
Random rndGen_;
|
||||
@ -189,7 +187,6 @@ public:
|
||||
//- Construct from components
|
||||
spray
|
||||
(
|
||||
const volPointInterpolation& vpi,
|
||||
const volVectorField& U,
|
||||
const volScalarField& rho,
|
||||
const volScalarField& p,
|
||||
|
@ -49,33 +49,13 @@ void spray::evolve()
|
||||
srhos_[i].setSize(rho_.size());
|
||||
}
|
||||
|
||||
UInterpolator_ = interpolation<vector>::New
|
||||
(
|
||||
interpolationSchemes_,
|
||||
volPointInterpolation_,
|
||||
U_
|
||||
);
|
||||
UInterpolator_ = interpolation<vector>::New(interpolationSchemes_, U_);
|
||||
|
||||
rhoInterpolator_ = interpolation<scalar>::New
|
||||
(
|
||||
interpolationSchemes_,
|
||||
volPointInterpolation_,
|
||||
rho_
|
||||
);
|
||||
rhoInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, rho_);
|
||||
|
||||
pInterpolator_ = interpolation<scalar>::New
|
||||
(
|
||||
interpolationSchemes_,
|
||||
volPointInterpolation_,
|
||||
p_
|
||||
);
|
||||
pInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, p_);
|
||||
|
||||
TInterpolator_ = interpolation<scalar>::New
|
||||
(
|
||||
interpolationSchemes_,
|
||||
volPointInterpolation_,
|
||||
T_
|
||||
);
|
||||
TInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, T_);
|
||||
|
||||
calculateAmbientPressure();
|
||||
calculateAmbientTemperature();
|
||||
|
@ -29,10 +29,9 @@ License
|
||||
#include "DragModel.H"
|
||||
#include "InjectionModel.H"
|
||||
#include "WallInteractionModel.H"
|
||||
|
||||
#include "IntegrationScheme.H"
|
||||
#include "interpolation.H"
|
||||
|
||||
#include "interpolationCellPoint.H"
|
||||
|
||||
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
|
||||
|
||||
@ -142,7 +141,6 @@ template<class ParcelType>
|
||||
Foam::KinematicCloud<ParcelType>::KinematicCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const volPointInterpolation& vpi,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const volScalarField& mu,
|
||||
@ -153,7 +151,6 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
|
||||
kinematicCloud(),
|
||||
cloudType_(cloudType),
|
||||
mesh_(rho.mesh()),
|
||||
vpi_(vpi),
|
||||
particleProperties_
|
||||
(
|
||||
IOobject
|
||||
@ -267,7 +264,7 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::KinematicCloud<ParcelType>::KinematicCloud"
|
||||
"(const word&, const volPointInterpolation&, const volScalarField&"
|
||||
"(const word&, const volScalarField&"
|
||||
", const volVectorField&, const volScalarField&, const "
|
||||
"dimensionedVector&)"
|
||||
)<< "parcelBasisType must be either 'number' or 'mass'" << nl
|
||||
@ -300,7 +297,6 @@ void Foam::KinematicCloud<ParcelType>::evolve()
|
||||
interpolation<scalar>::New
|
||||
(
|
||||
interpolationSchemes_,
|
||||
vpi_,
|
||||
rho_
|
||||
);
|
||||
|
||||
@ -308,7 +304,6 @@ void Foam::KinematicCloud<ParcelType>::evolve()
|
||||
interpolation<vector>::New
|
||||
(
|
||||
interpolationSchemes_,
|
||||
vpi_,
|
||||
U_
|
||||
);
|
||||
|
||||
@ -316,7 +311,6 @@ void Foam::KinematicCloud<ParcelType>::evolve()
|
||||
interpolation<scalar>::New
|
||||
(
|
||||
interpolationSchemes_,
|
||||
vpi_,
|
||||
mu_
|
||||
);
|
||||
|
||||
|
@ -50,7 +50,6 @@ SourceFiles
|
||||
#include "Random.H"
|
||||
#include "fvMesh.H"
|
||||
#include "volFields.H"
|
||||
#include "volPointInterpolation.H"
|
||||
#include "fvMatrices.H"
|
||||
#include "fvm.H"
|
||||
|
||||
@ -110,9 +109,6 @@ private:
|
||||
//- References to the mesh and time databases
|
||||
const fvMesh& mesh_;
|
||||
|
||||
//- Reference to the interpolation for the carrier phase to the parcels
|
||||
const volPointInterpolation& vpi_;
|
||||
|
||||
//- Dictionary of particle properties
|
||||
IOdictionary particleProperties_;
|
||||
|
||||
@ -268,7 +264,6 @@ public:
|
||||
KinematicCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const volPointInterpolation& vpi,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const volScalarField& mu,
|
||||
@ -295,9 +290,6 @@ public:
|
||||
//- Return refernce to the mesh
|
||||
inline const fvMesh& mesh() const;
|
||||
|
||||
//- Retuen reference to the interpolation
|
||||
inline const volPointInterpolation& vpi() const;
|
||||
|
||||
//- Return particle properties dictionary
|
||||
inline const IOdictionary& particleProperties() const;
|
||||
|
||||
|
@ -47,14 +47,6 @@ inline const Foam::fvMesh& Foam::KinematicCloud<ParcelType>::mesh() const
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
inline const Foam::volPointInterpolation&
|
||||
Foam::KinematicCloud<ParcelType>::vpi() const
|
||||
{
|
||||
return vpi_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
inline const Foam::IOdictionary&
|
||||
Foam::KinematicCloud<ParcelType>::particleProperties() const
|
||||
|
@ -29,15 +29,12 @@ License
|
||||
#include "MassTransferModel.H"
|
||||
#include "SurfaceReactionModel.H"
|
||||
|
||||
#include "interpolationCellPoint.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParcelType>
|
||||
Foam::ReactingCloud<ParcelType>::ReactingCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const volPointInterpolation& vpi,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const dimensionedVector& g,
|
||||
@ -45,7 +42,7 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud
|
||||
PtrList<specieReactingProperties>& gases
|
||||
)
|
||||
:
|
||||
ThermoCloud<ParcelType>(cloudType, vpi, rho, U, g, thermo),
|
||||
ThermoCloud<ParcelType>(cloudType, rho, U, g, thermo),
|
||||
reactingCloud(),
|
||||
constProps_(this->particleProperties()),
|
||||
carrierThermo_(thermo),
|
||||
@ -131,42 +128,36 @@ void Foam::ReactingCloud<ParcelType>::evolve()
|
||||
autoPtr<interpolation<scalar> > rhoInterpolator = interpolation<scalar>::New
|
||||
(
|
||||
this->interpolationSchemes(),
|
||||
this->vpi(),
|
||||
this->rho()
|
||||
);
|
||||
|
||||
autoPtr<interpolation<vector> > UInterpolator = interpolation<vector>::New
|
||||
(
|
||||
this->interpolationSchemes(),
|
||||
this->vpi(),
|
||||
this->U()
|
||||
);
|
||||
|
||||
autoPtr<interpolation<scalar> > muInterpolator = interpolation<scalar>::New
|
||||
(
|
||||
this->interpolationSchemes(),
|
||||
this->vpi(),
|
||||
this->mu()
|
||||
);
|
||||
|
||||
autoPtr<interpolation<scalar> > TInterpolator = interpolation<scalar>::New
|
||||
(
|
||||
this->interpolationSchemes(),
|
||||
this->vpi(),
|
||||
T
|
||||
);
|
||||
|
||||
autoPtr<interpolation<scalar> > cpInterpolator = interpolation<scalar>::New
|
||||
(
|
||||
this->interpolationSchemes(),
|
||||
this->vpi(),
|
||||
cp
|
||||
);
|
||||
|
||||
autoPtr<interpolation<scalar> > pInterpolator = interpolation<scalar>::New
|
||||
(
|
||||
this->interpolationSchemes(),
|
||||
this->vpi(),
|
||||
p
|
||||
);
|
||||
|
||||
|
@ -133,7 +133,6 @@ public:
|
||||
ReactingCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const volPointInterpolation& vpi,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const dimensionedVector& g,
|
||||
|
@ -36,7 +36,6 @@ template<class ParcelType>
|
||||
Foam::ThermoCloud<ParcelType>::ThermoCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const volPointInterpolation& vpi,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const dimensionedVector& g,
|
||||
@ -46,7 +45,6 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud
|
||||
KinematicCloud<ParcelType>
|
||||
(
|
||||
cloudType,
|
||||
vpi,
|
||||
rho,
|
||||
U,
|
||||
thermo.mu(),
|
||||
@ -130,35 +128,30 @@ void Foam::ThermoCloud<ParcelType>::evolve()
|
||||
autoPtr<interpolation<scalar> > rhoInterpolator = interpolation<scalar>::New
|
||||
(
|
||||
this->interpolationSchemes(),
|
||||
this->vpi(),
|
||||
this->rho()
|
||||
);
|
||||
|
||||
autoPtr<interpolation<vector> > UInterpolator = interpolation<vector>::New
|
||||
(
|
||||
this->interpolationSchemes(),
|
||||
this->vpi(),
|
||||
this->U()
|
||||
);
|
||||
|
||||
autoPtr<interpolation<scalar> > muInterpolator = interpolation<scalar>::New
|
||||
(
|
||||
this->interpolationSchemes(),
|
||||
this->vpi(),
|
||||
this->mu()
|
||||
);
|
||||
|
||||
autoPtr<interpolation<scalar> > TInterpolator = interpolation<scalar>::New
|
||||
(
|
||||
this->interpolationSchemes(),
|
||||
this->vpi(),
|
||||
T
|
||||
);
|
||||
|
||||
autoPtr<interpolation<scalar> > cpInterpolator = interpolation<scalar>::New
|
||||
(
|
||||
this->interpolationSchemes(),
|
||||
this->vpi(),
|
||||
cp
|
||||
);
|
||||
|
||||
|
@ -135,7 +135,6 @@ public:
|
||||
ThermoCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const volPointInterpolation& vpi,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const dimensionedVector& g,
|
||||
|
@ -39,14 +39,13 @@ namespace Foam
|
||||
Foam::basicKinematicCloud::basicKinematicCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const volPointInterpolation& vpi,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const volScalarField& mu,
|
||||
const dimensionedVector& g
|
||||
)
|
||||
:
|
||||
KinematicCloud<basicKinematicParcel>(cloudType, vpi, rho, U, mu, g)
|
||||
KinematicCloud<basicKinematicParcel>(cloudType, rho, U, mu, g)
|
||||
{
|
||||
basicKinematicParcel::readFields(*this);
|
||||
}
|
||||
|
@ -74,7 +74,6 @@ public:
|
||||
basicKinematicCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const volPointInterpolation& vpi,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const volScalarField& mu,
|
||||
|
@ -39,7 +39,6 @@ namespace Foam
|
||||
Foam::basicReactingCloud::basicReactingCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const volPointInterpolation& vpi,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const dimensionedVector& g,
|
||||
@ -50,7 +49,6 @@ Foam::basicReactingCloud::basicReactingCloud
|
||||
ReactingCloud<basicReactingParcel>
|
||||
(
|
||||
cloudType,
|
||||
vpi,
|
||||
rho,
|
||||
U,
|
||||
g,
|
||||
|
@ -73,7 +73,6 @@ public:
|
||||
basicReactingCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const volPointInterpolation& vpi,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const dimensionedVector& g,
|
||||
|
@ -39,14 +39,13 @@ namespace Foam
|
||||
Foam::basicThermoCloud::basicThermoCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const volPointInterpolation& vpi,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const dimensionedVector& g,
|
||||
basicThermo& thermo
|
||||
)
|
||||
:
|
||||
ThermoCloud<basicThermoParcel>(cloudType, vpi, rho, U, g, thermo)
|
||||
ThermoCloud<basicThermoParcel>(cloudType, rho, U, g, thermo)
|
||||
{
|
||||
basicThermoParcel::readFields(*this);
|
||||
}
|
||||
|
@ -76,7 +76,6 @@ public:
|
||||
basicThermoCloud
|
||||
(
|
||||
const word& cloudType,
|
||||
const volPointInterpolation& vpi,
|
||||
const volScalarField& rho,
|
||||
const volVectorField& U,
|
||||
const dimensionedVector& g,
|
||||
|
@ -26,6 +26,8 @@ License
|
||||
|
||||
#include "KinematicParcel.H"
|
||||
#include "IOstreams.H"
|
||||
#include "IOField.H"
|
||||
#include "Cloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -97,25 +99,25 @@ void Foam::KinematicParcel<ParcelType>::readFields
|
||||
return;
|
||||
}
|
||||
|
||||
IOField<label> typeId(c.fieldIOobject("typeId"));
|
||||
IOField<label> typeId(c.fieldIOobject("typeId", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, typeId);
|
||||
|
||||
IOField<scalar> d(c.fieldIOobject("d"));
|
||||
IOField<scalar> d(c.fieldIOobject("d", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, d);
|
||||
|
||||
IOField<vector> U(c.fieldIOobject("U"));
|
||||
IOField<vector> U(c.fieldIOobject("U", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, U);
|
||||
|
||||
IOField<scalar> nParticle(c.fieldIOobject("nParticle"));
|
||||
IOField<scalar> nParticle(c.fieldIOobject("nParticle", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, nParticle);
|
||||
|
||||
IOField<scalar> rho(c.fieldIOobject("rho"));
|
||||
IOField<scalar> rho(c.fieldIOobject("rho", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, rho);
|
||||
|
||||
IOField<scalar> tTurb(c.fieldIOobject("tTurb"));
|
||||
IOField<scalar> tTurb(c.fieldIOobject("tTurb", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, tTurb);
|
||||
|
||||
IOField<vector> UTurb(c.fieldIOobject("UTurb"));
|
||||
IOField<vector> UTurb(c.fieldIOobject("UTurb", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, UTurb);
|
||||
|
||||
label i = 0;
|
||||
@ -145,13 +147,17 @@ void Foam::KinematicParcel<ParcelType>::writeFields
|
||||
|
||||
label np = c.size();
|
||||
|
||||
IOField<label> typeId(c.fieldIOobject("typeId"), np);
|
||||
IOField<scalar> d(c.fieldIOobject("d"), np);
|
||||
IOField<vector> U(c.fieldIOobject("U"), np);
|
||||
IOField<scalar> nParticle(c.fieldIOobject("nParticle"), np);
|
||||
IOField<scalar> rho(c.fieldIOobject("rho"), np);
|
||||
IOField<scalar> tTurb(c.fieldIOobject("tTurb"), np);
|
||||
IOField<vector> UTurb(c.fieldIOobject("UTurb"), np);
|
||||
IOField<label> typeId(c.fieldIOobject("typeId", IOobject::NO_READ), np);
|
||||
IOField<scalar> d(c.fieldIOobject("d", IOobject::NO_READ), np);
|
||||
IOField<vector> U(c.fieldIOobject("U", IOobject::NO_READ), np);
|
||||
IOField<scalar> nParticle
|
||||
(
|
||||
c.fieldIOobject("nParticle", IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
IOField<scalar> rho(c.fieldIOobject("rho", IOobject::NO_READ), np);
|
||||
IOField<scalar> tTurb(c.fieldIOobject("tTurb", IOobject::NO_READ), np);
|
||||
IOField<vector> UTurb(c.fieldIOobject("UTurb", IOobject::NO_READ), np);
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(typename Cloud<ParcelType>, c, iter)
|
||||
|
@ -103,7 +103,7 @@ void Foam::ReactingParcel<ParcelType>::readFields
|
||||
|
||||
ThermoParcel<ParcelType>::readFields(c);
|
||||
|
||||
IOField<scalar> mass0(c.fieldIOobject("mass0"));
|
||||
IOField<scalar> mass0(c.fieldIOobject("mass0", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, mass0);
|
||||
|
||||
label i = 0;
|
||||
@ -136,7 +136,10 @@ void Foam::ReactingParcel<ParcelType>::readFields
|
||||
// Populate YMixture for each parcel
|
||||
forAll(compositionNames, j)
|
||||
{
|
||||
IOField<scalar> YMixture(c.fieldIOobject("Y" + compositionNames[j]));
|
||||
IOField<scalar> YMixture
|
||||
(
|
||||
c.fieldIOobject("Y" + compositionNames[j], IOobject::MUST_READ)
|
||||
);
|
||||
|
||||
label i = 0;
|
||||
forAllIter(typename Cloud<ParcelType>, c, iter)
|
||||
@ -148,7 +151,10 @@ void Foam::ReactingParcel<ParcelType>::readFields
|
||||
// Populate YGas for each parcel
|
||||
forAll(gasNames, j)
|
||||
{
|
||||
IOField<scalar> YGas(c.fieldIOobject("Y" + gasNames[j]));
|
||||
IOField<scalar> YGas
|
||||
(
|
||||
c.fieldIOobject("Y" + gasNames[j], IOobject::MUST_READ)
|
||||
);
|
||||
|
||||
label i = 0;
|
||||
forAllIter(typename Cloud<ParcelType>, c, iter)
|
||||
@ -160,7 +166,10 @@ void Foam::ReactingParcel<ParcelType>::readFields
|
||||
// Populate YLiquid for each parcel
|
||||
forAll(liquidNames, j)
|
||||
{
|
||||
IOField<scalar> YLiquid(c.fieldIOobject("Y" + liquidNames[j]));
|
||||
IOField<scalar> YLiquid
|
||||
(
|
||||
c.fieldIOobject("Y" + liquidNames[j], IOobject::MUST_READ)
|
||||
);
|
||||
|
||||
label i = 0;
|
||||
forAllIter(typename Cloud<ParcelType>, c, iter)
|
||||
@ -172,7 +181,10 @@ void Foam::ReactingParcel<ParcelType>::readFields
|
||||
// Populate YSolid for each parcel
|
||||
forAll(solidNames, j)
|
||||
{
|
||||
IOField<scalar> YSolid(c.fieldIOobject("Y" + solidNames[j]));
|
||||
IOField<scalar> YSolid
|
||||
(
|
||||
c.fieldIOobject("Y" + solidNames[j], IOobject::MUST_READ)
|
||||
);
|
||||
|
||||
label i = 0;
|
||||
forAllIter(typename Cloud<ParcelType>, c, iter)
|
||||
@ -194,7 +206,7 @@ void Foam::ReactingParcel<ParcelType>::writeFields
|
||||
|
||||
label np = c.size();
|
||||
|
||||
IOField<scalar> mass0(c.fieldIOobject("mass0"), np);
|
||||
IOField<scalar> mass0(c.fieldIOobject("mass0", IOobject::NO_READ), np);
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(typename Cloud<ParcelType>, c, iter)
|
||||
@ -213,7 +225,8 @@ void Foam::ReactingParcel<ParcelType>::writeFields
|
||||
{
|
||||
IOField<scalar> YMixture
|
||||
(
|
||||
c.fieldIOobject("Y" + compositionNames[j]), np
|
||||
c.fieldIOobject("Y" + compositionNames[j], IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
|
||||
label i = 0;
|
||||
@ -228,7 +241,11 @@ void Foam::ReactingParcel<ParcelType>::writeFields
|
||||
const wordList& gasNames = c.composition().gasNames();
|
||||
forAll(gasNames, j)
|
||||
{
|
||||
IOField<scalar> YGas(c.fieldIOobject("Y" + gasNames[j]), np);
|
||||
IOField<scalar> YGas
|
||||
(
|
||||
c.fieldIOobject("Y" + gasNames[j], IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(typename Cloud<ParcelType>, c, iter)
|
||||
@ -242,7 +259,11 @@ void Foam::ReactingParcel<ParcelType>::writeFields
|
||||
const wordList& liquidNames = c.composition().liquidNames();
|
||||
forAll(liquidNames, j)
|
||||
{
|
||||
IOField<scalar> YLiquid(c.fieldIOobject("Y" + liquidNames[j]), np);
|
||||
IOField<scalar> YLiquid
|
||||
(
|
||||
c.fieldIOobject("Y" + liquidNames[j], IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(typename Cloud<ParcelType>, c, iter)
|
||||
@ -256,7 +277,11 @@ void Foam::ReactingParcel<ParcelType>::writeFields
|
||||
const wordList& solidNames = c.composition().solidNames();
|
||||
forAll(solidNames, j)
|
||||
{
|
||||
IOField<scalar> YSolid(c.fieldIOobject("Y" + solidNames[j]), np);
|
||||
IOField<scalar> YSolid
|
||||
(
|
||||
c.fieldIOobject("Y" + solidNames[j], IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(typename Cloud<ParcelType>, c, iter)
|
||||
|
@ -82,10 +82,10 @@ void Foam::ThermoParcel<ParcelType>::readFields
|
||||
|
||||
KinematicParcel<ParcelType>::readFields(c);
|
||||
|
||||
IOField<scalar> T(c.fieldIOobject("T"));
|
||||
IOField<scalar> T(c.fieldIOobject("T", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, T);
|
||||
|
||||
IOField<scalar> cp(c.fieldIOobject("cp"));
|
||||
IOField<scalar> cp(c.fieldIOobject("cp", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, cp);
|
||||
|
||||
|
||||
@ -111,8 +111,8 @@ void Foam::ThermoParcel<ParcelType>::writeFields
|
||||
|
||||
label np = c.size();
|
||||
|
||||
IOField<scalar> T(c.fieldIOobject("T"), np);
|
||||
IOField<scalar> cp(c.fieldIOobject("cp"), np);
|
||||
IOField<scalar> T(c.fieldIOobject("T", IOobject::NO_READ), np);
|
||||
IOField<scalar> cp(c.fieldIOobject("cp", IOobject::NO_READ), np);
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(typename Cloud<ParcelType>, c, iter)
|
||||
|
@ -85,22 +85,25 @@ void molecule::readFields(moleculeCloud& mC)
|
||||
return;
|
||||
}
|
||||
|
||||
IOField<label> id(mC.fieldIOobject("id"));
|
||||
IOField<label> id(mC.fieldIOobject("id", IOobject::MUST_READ));
|
||||
mC.checkFieldIOobject(mC, id);
|
||||
|
||||
IOField<scalar> mass(mC.fieldIOobject("mass"));
|
||||
IOField<scalar> mass(mC.fieldIOobject("mass", IOobject::MUST_READ));
|
||||
mC.checkFieldIOobject(mC, mass);
|
||||
|
||||
IOField<vector> U(mC.fieldIOobject("U"));
|
||||
IOField<vector> U(mC.fieldIOobject("U", IOobject::MUST_READ));
|
||||
mC.checkFieldIOobject(mC, U);
|
||||
|
||||
IOField<vector> A(mC.fieldIOobject("A"));
|
||||
IOField<vector> A(mC.fieldIOobject("A", IOobject::MUST_READ));
|
||||
mC.checkFieldIOobject(mC, A);
|
||||
|
||||
IOField<label> tethered(mC.fieldIOobject("tethered"));
|
||||
IOField<label> tethered(mC.fieldIOobject("tethered", IOobject::MUST_READ));
|
||||
mC.checkFieldIOobject(mC, tethered);
|
||||
|
||||
IOField<vector> tetherPositions(mC.fieldIOobject("tetherPositions"));
|
||||
IOField<vector> tetherPositions
|
||||
(
|
||||
mC.fieldIOobject("tetherPositions", IOobject::MUST_READ)
|
||||
);
|
||||
mC.checkFieldIOobject(mC, tetherPositions);
|
||||
|
||||
label i = 0;
|
||||
@ -127,12 +130,20 @@ void molecule::writeFields(const moleculeCloud& mC)
|
||||
|
||||
label np = mC.size();
|
||||
|
||||
IOField<label> id(mC.fieldIOobject("id"), np);
|
||||
IOField<scalar> mass(mC.fieldIOobject("mass"), np);
|
||||
IOField<vector> U(mC.fieldIOobject("U"), np);
|
||||
IOField<vector> A(mC.fieldIOobject("A"), np);
|
||||
IOField<label> tethered(mC.fieldIOobject("tethered"), np);
|
||||
IOField<vector> tetherPositions(mC.fieldIOobject("tetherPositions"), np);
|
||||
IOField<label> id(mC.fieldIOobject("id", IOobject::NO_READ), np);
|
||||
IOField<scalar> mass(mC.fieldIOobject("mass", IOobject::NO_READ), np);
|
||||
IOField<vector> U(mC.fieldIOobject("U", IOobject::NO_READ), np);
|
||||
IOField<vector> A(mC.fieldIOobject("A", IOobject::NO_READ), np);
|
||||
IOField<label> tethered
|
||||
(
|
||||
mC.fieldIOobject("tethered", IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
IOField<vector> tetherPositions
|
||||
(
|
||||
mC.fieldIOobject("tetherPositions", IOobject::NO_READ),
|
||||
np
|
||||
);
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(moleculeCloud, mC, iter)
|
||||
|
@ -28,7 +28,6 @@ License
|
||||
#include "fvMesh.H"
|
||||
#include "volFields.H"
|
||||
#include "interpolationCellPoint.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -75,12 +74,9 @@ void Foam::solidParticleCloud::move(const dimensionedVector& g)
|
||||
const volVectorField& U = mesh_.lookupObject<const volVectorField>("U");
|
||||
const volScalarField& nu = mesh_.lookupObject<const volScalarField>("nu");
|
||||
|
||||
pointMesh pMesh(U.mesh());
|
||||
volPointInterpolation vpi(U.mesh(), pMesh);
|
||||
|
||||
interpolationCellPoint<scalar> rhoInterp(vpi, rho);
|
||||
interpolationCellPoint<vector> UInterp(vpi, U);
|
||||
interpolationCellPoint<scalar> nuInterp(vpi, nu);
|
||||
interpolationCellPoint<scalar> rhoInterp(rho);
|
||||
interpolationCellPoint<vector> UInterp(U);
|
||||
interpolationCellPoint<scalar> nuInterp(nu);
|
||||
|
||||
solidParticle::trackData td(*this, rhoInterp, UInterp, nuInterp, g.value());
|
||||
|
||||
|
@ -66,10 +66,10 @@ void Foam::solidParticle::readFields(Cloud<solidParticle>& c)
|
||||
{
|
||||
return;
|
||||
}
|
||||
IOField<scalar> d(c.fieldIOobject("d"));
|
||||
IOField<scalar> d(c.fieldIOobject("d", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, d);
|
||||
|
||||
IOField<vector> U(c.fieldIOobject("U"));
|
||||
IOField<vector> U(c.fieldIOobject("U", IOobject::MUST_READ));
|
||||
c.checkFieldIOobject(c, U);
|
||||
|
||||
label i = 0;
|
||||
@ -90,8 +90,8 @@ void Foam::solidParticle::writeFields(const Cloud<solidParticle>& c)
|
||||
|
||||
label np = c.size();
|
||||
|
||||
IOField<scalar> d(c.fieldIOobject("d"), np);
|
||||
IOField<vector> U(c.fieldIOobject("U"), np);
|
||||
IOField<scalar> d(c.fieldIOobject("d", IOobject::NO_READ), np);
|
||||
IOField<vector> U(c.fieldIOobject("U", IOobject::NO_READ), np);
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(Cloud<solidParticle>, c, iter)
|
||||
|
@ -25,7 +25,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "PointEdgeWave.H"
|
||||
#include "pointMesh.H"
|
||||
#include "polyMesh.H"
|
||||
#include "processorPolyPatch.H"
|
||||
#include "cyclicPolyPatch.H"
|
||||
#include "OPstream.H"
|
||||
@ -33,7 +33,6 @@ License
|
||||
#include "PstreamCombineReduceOps.H"
|
||||
#include "debug.H"
|
||||
#include "typeInfo.H"
|
||||
#include "ListOps.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -61,13 +60,11 @@ void Foam::PointEdgeWave<Type>::offset(const label val, labelList& elems)
|
||||
template <class Type>
|
||||
void Foam::PointEdgeWave<Type>::calcCyclicAddressing()
|
||||
{
|
||||
const polyMesh& mesh = pMesh_();
|
||||
|
||||
label cycHalf = 0;
|
||||
|
||||
forAll(mesh.boundaryMesh(), patchI)
|
||||
forAll(mesh_.boundaryMesh(), patchI)
|
||||
{
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
||||
const polyPatch& patch = mesh_.boundaryMesh()[patchI];
|
||||
|
||||
if (isA<cyclicPolyPatch>(patch))
|
||||
{
|
||||
@ -75,7 +72,7 @@ void Foam::PointEdgeWave<Type>::calcCyclicAddressing()
|
||||
|
||||
SubList<face> halfAFaces
|
||||
(
|
||||
mesh.faces(),
|
||||
mesh_.faces(),
|
||||
halfSize,
|
||||
patch.start()
|
||||
);
|
||||
@ -83,12 +80,12 @@ void Foam::PointEdgeWave<Type>::calcCyclicAddressing()
|
||||
cycHalves_.set
|
||||
(
|
||||
cycHalf++,
|
||||
new primitivePatch(halfAFaces, mesh.points())
|
||||
new primitivePatch(halfAFaces, mesh_.points())
|
||||
);
|
||||
|
||||
SubList<face> halfBFaces
|
||||
(
|
||||
mesh.faces(),
|
||||
mesh_.faces(),
|
||||
halfSize,
|
||||
patch.start() + halfSize
|
||||
);
|
||||
@ -96,7 +93,7 @@ void Foam::PointEdgeWave<Type>::calcCyclicAddressing()
|
||||
cycHalves_.set
|
||||
(
|
||||
cycHalf++,
|
||||
new primitivePatch(halfBFaces, mesh.points())
|
||||
new primitivePatch(halfBFaces, mesh_.points())
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -203,7 +200,7 @@ bool Foam::PointEdgeWave<Type>::updatePoint
|
||||
bool propagate =
|
||||
pointInfo.updatePoint
|
||||
(
|
||||
pMesh_(),
|
||||
mesh_,
|
||||
pointI,
|
||||
neighbourEdgeI,
|
||||
neighbourInfo,
|
||||
@ -249,7 +246,7 @@ bool Foam::PointEdgeWave<Type>::updatePoint
|
||||
bool propagate =
|
||||
pointInfo.updatePoint
|
||||
(
|
||||
pMesh_(),
|
||||
mesh_,
|
||||
pointI,
|
||||
neighbourInfo,
|
||||
tol
|
||||
@ -295,7 +292,7 @@ bool Foam::PointEdgeWave<Type>::updateEdge
|
||||
bool propagate =
|
||||
edgeInfo.updateEdge
|
||||
(
|
||||
pMesh_(),
|
||||
mesh_,
|
||||
edgeI,
|
||||
neighbourPointI,
|
||||
neighbourInfo,
|
||||
@ -327,9 +324,9 @@ Foam::label Foam::PointEdgeWave<Type>::countPatchType() const
|
||||
{
|
||||
label nPatches = 0;
|
||||
|
||||
forAll(pMesh_().boundaryMesh(), patchI)
|
||||
forAll(mesh_.boundaryMesh(), patchI)
|
||||
{
|
||||
if (isA<PatchType>(pMesh_().boundaryMesh()[patchI]))
|
||||
if (isA<PatchType>(mesh_.boundaryMesh()[patchI]))
|
||||
{
|
||||
nPatches++;
|
||||
}
|
||||
@ -433,15 +430,12 @@ void Foam::PointEdgeWave<Type>::updateFromPatchInfo
|
||||
template <class Type>
|
||||
void Foam::PointEdgeWave<Type>::handleProcPatches()
|
||||
{
|
||||
const polyMesh& mesh = pMesh_();
|
||||
|
||||
|
||||
// 1. Send all point info on processor patches. Send as
|
||||
// face label + offset in face.
|
||||
|
||||
forAll(mesh.boundaryMesh(), patchI)
|
||||
forAll(mesh_.boundaryMesh(), patchI)
|
||||
{
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
||||
const polyPatch& patch = mesh_.boundaryMesh()[patchI];
|
||||
|
||||
if (isA<processorPolyPatch>(patch))
|
||||
{
|
||||
@ -491,9 +485,9 @@ void Foam::PointEdgeWave<Type>::handleProcPatches()
|
||||
// 2. Receive all point info on processor patches.
|
||||
//
|
||||
|
||||
forAll(mesh.boundaryMesh(), patchI)
|
||||
forAll(mesh_.boundaryMesh(), patchI)
|
||||
{
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
||||
const polyPatch& patch = mesh_.boundaryMesh()[patchI];
|
||||
|
||||
if (isA<processorPolyPatch>(patch))
|
||||
{
|
||||
@ -544,7 +538,7 @@ void Foam::PointEdgeWave<Type>::handleProcPatches()
|
||||
// (Note:irrespective if changed or not for now)
|
||||
//
|
||||
|
||||
const globalMeshData& pd = mesh.globalData();
|
||||
const globalMeshData& pd = mesh_.globalData();
|
||||
|
||||
List<Type> sharedData(pd.nGlobalPoints());
|
||||
|
||||
@ -579,16 +573,14 @@ void Foam::PointEdgeWave<Type>::handleProcPatches()
|
||||
template <class Type>
|
||||
void Foam::PointEdgeWave<Type>::handleCyclicPatches()
|
||||
{
|
||||
const polyMesh& mesh = pMesh_();
|
||||
|
||||
// 1. Send all point info on cyclic patches. Send as
|
||||
// face label + offset in face.
|
||||
|
||||
label cycHalf = 0;
|
||||
|
||||
forAll(mesh.boundaryMesh(), patchI)
|
||||
forAll(mesh_.boundaryMesh(), patchI)
|
||||
{
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
||||
const polyPatch& patch = mesh_.boundaryMesh()[patchI];
|
||||
|
||||
if (isA<cyclicPolyPatch>(patch))
|
||||
{
|
||||
@ -692,7 +684,7 @@ void Foam::PointEdgeWave<Type>::handleCyclicPatches()
|
||||
template <class Type>
|
||||
Foam::PointEdgeWave<Type>::PointEdgeWave
|
||||
(
|
||||
const pointMesh& pMesh,
|
||||
const polyMesh& mesh,
|
||||
const labelList& changedPoints,
|
||||
const List<Type>& changedPointsInfo,
|
||||
|
||||
@ -702,45 +694,45 @@ Foam::PointEdgeWave<Type>::PointEdgeWave
|
||||
const label maxIter
|
||||
)
|
||||
:
|
||||
pMesh_(pMesh),
|
||||
mesh_(mesh),
|
||||
allPointInfo_(allPointInfo),
|
||||
allEdgeInfo_(allEdgeInfo),
|
||||
changedPoint_(pMesh_().nPoints(), false),
|
||||
changedPoints_(pMesh_().nPoints()),
|
||||
changedPoint_(mesh_.nPoints(), false),
|
||||
changedPoints_(mesh_.nPoints()),
|
||||
nChangedPoints_(0),
|
||||
changedEdge_(pMesh_().nEdges(), false),
|
||||
changedEdges_(pMesh_().nEdges()),
|
||||
changedEdge_(mesh_.nEdges(), false),
|
||||
changedEdges_(mesh_.nEdges()),
|
||||
nChangedEdges_(0),
|
||||
nCyclicPatches_(countPatchType<cyclicPolyPatch>()),
|
||||
cycHalves_(2*nCyclicPatches_),
|
||||
nEvals_(0),
|
||||
nUnvisitedPoints_(pMesh_().nPoints()),
|
||||
nUnvisitedEdges_(pMesh_().nEdges())
|
||||
nUnvisitedPoints_(mesh_.nPoints()),
|
||||
nUnvisitedEdges_(mesh_.nEdges())
|
||||
{
|
||||
if (allPointInfo_.size() != pMesh_().nPoints())
|
||||
if (allPointInfo_.size() != mesh_.nPoints())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"PointEdgeWave<Type>::PointEdgeWave"
|
||||
"(const pointMesh&, const labelList&, const List<Type>,"
|
||||
"(const polyMesh&, const labelList&, const List<Type>,"
|
||||
" List<Type>&, List<Type>&, const label maxIter)"
|
||||
) << "size of pointInfo work array is not equal to the number"
|
||||
<< " of points in the mesh" << endl
|
||||
<< " pointInfo :" << allPointInfo_.size() << endl
|
||||
<< " mesh.nPoints:" << pMesh_().nPoints()
|
||||
<< " mesh.nPoints:" << mesh_.nPoints()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
if (allEdgeInfo_.size() != pMesh_().nEdges())
|
||||
if (allEdgeInfo_.size() != mesh_.nEdges())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"PointEdgeWave<Type>::PointEdgeWave"
|
||||
"(const pointMesh&, const labelList&, const List<Type>,"
|
||||
"(const polyMesh&, const labelList&, const List<Type>,"
|
||||
" List<Type>&, List<Type>&, const label maxIter)"
|
||||
) << "size of edgeInfo work array is not equal to the number"
|
||||
<< " of edges in the mesh" << endl
|
||||
<< " edgeInfo :" << allEdgeInfo_.size() << endl
|
||||
<< " mesh.nEdges:" << pMesh_().nEdges()
|
||||
<< " mesh.nEdges:" << mesh_.nEdges()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -768,7 +760,7 @@ Foam::PointEdgeWave<Type>::PointEdgeWave
|
||||
FatalErrorIn
|
||||
(
|
||||
"PointEdgeWave<Type>::PointEdgeWave"
|
||||
"(const pointMesh&, const labelList&, const List<Type>,"
|
||||
"(const polyMesh&, const labelList&, const List<Type>,"
|
||||
" List<Type>&, List<Type>&, const label maxIter)"
|
||||
) << "Maximum number of iterations reached. Increase maxIter." << endl
|
||||
<< " maxIter:" << maxIter << endl
|
||||
@ -863,7 +855,7 @@ Foam::label Foam::PointEdgeWave<Type>::edgeToPoint()
|
||||
const Type& neighbourWallInfo = allEdgeInfo_[edgeI];
|
||||
|
||||
// Evaluate all connected points (= edge endpoints)
|
||||
const edge& e = pMesh_().edges()[edgeI];
|
||||
const edge& e = mesh_.edges()[edgeI];
|
||||
|
||||
forAll(e, eI)
|
||||
{
|
||||
@ -918,7 +910,7 @@ Foam::label Foam::PointEdgeWave<Type>::edgeToPoint()
|
||||
template <class Type>
|
||||
Foam::label Foam::PointEdgeWave<Type>::pointToEdge()
|
||||
{
|
||||
const labelListList& pointEdges = pMesh_().pointEdges();
|
||||
const labelListList& pointEdges = mesh_.pointEdges();
|
||||
|
||||
for
|
||||
(
|
||||
|
@ -61,7 +61,6 @@ SourceFiles
|
||||
|
||||
#include "label.H"
|
||||
#include "boolList.H"
|
||||
#include "labelList.H"
|
||||
#include "scalarField.H"
|
||||
#include "pointFields.H"
|
||||
#include "tensor.H"
|
||||
@ -74,7 +73,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class pointMesh;
|
||||
class polyMesh;
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -104,7 +103,7 @@ class PointEdgeWave
|
||||
// Private data
|
||||
|
||||
//- Reference to mesh
|
||||
const pointMesh& pMesh_;
|
||||
const polyMesh& mesh_;
|
||||
|
||||
//- Wall information for all points
|
||||
List<Type>& allPointInfo_;
|
||||
@ -272,7 +271,7 @@ public:
|
||||
// (maxIter can be 0)
|
||||
PointEdgeWave
|
||||
(
|
||||
const pointMesh& pMesh,
|
||||
const polyMesh& mesh,
|
||||
const labelList& initialPoints,
|
||||
const List<Type>& initialPointsInfo,
|
||||
List<Type>& allPointInfo,
|
||||
|
@ -2188,6 +2188,9 @@ bool Foam::distributedTriSurfaceMesh::writeObject
|
||||
IOstream::compressionType cmp
|
||||
) const
|
||||
{
|
||||
// Make sure dictionary goes to same directory as surface
|
||||
const_cast<fileName&>(dict_.instance()) = searchableSurface::instance();
|
||||
|
||||
return
|
||||
triSurfaceMesh::writeObject(fmt, ver, cmp)
|
||||
&& dict_.writeObject(fmt, ver, cmp);
|
||||
|
@ -22,6 +22,8 @@ cuttingPlane/cuttingPlane.C
|
||||
|
||||
sampledSurface/patch/sampledPatch.C
|
||||
sampledSurface/plane/sampledPlane.C
|
||||
sampledSurface/isoSurface/isoSurface.C
|
||||
sampledSurface/isoSurface/sampledIsoSurface.C
|
||||
sampledSurface/sampledSurface/sampledSurface.C
|
||||
sampledSurface/sampledSurfaces/sampledSurfaces.C
|
||||
sampledSurface/sampledSurfacesFunctionObject/sampledSurfacesFunctionObject.C
|
||||
|
@ -52,7 +52,6 @@ meshToMesh::meshToMesh
|
||||
fromMesh_(meshFrom),
|
||||
toMesh_(meshTo),
|
||||
patchMap_(patchMap),
|
||||
fromPointMesh_(meshFrom),
|
||||
cellAddressing_(toMesh_.nCells()),
|
||||
boundaryAddressing_(toMesh_.boundaryMesh().size()),
|
||||
inverseDistanceWeightsPtr_(NULL)
|
||||
@ -123,7 +122,6 @@ meshToMesh::meshToMesh
|
||||
:
|
||||
fromMesh_(meshFrom),
|
||||
toMesh_(meshTo),
|
||||
fromPointMesh_(meshFrom),
|
||||
cellAddressing_(toMesh_.nCells()),
|
||||
boundaryAddressing_(toMesh_.boundaryMesh().size()),
|
||||
inverseDistanceWeightsPtr_(NULL)
|
||||
|
@ -40,7 +40,6 @@ SourceFiles
|
||||
#define meshtoMesh_H
|
||||
|
||||
#include "fvMesh.H"
|
||||
#include "pointMesh.H"
|
||||
#include "HashTable.H"
|
||||
#include "fvPatchMapper.H"
|
||||
#include "scalarList.H"
|
||||
@ -81,9 +80,6 @@ class meshToMesh
|
||||
//- toMesh patch labels which cut the from-mesh
|
||||
HashTable<label> cuttingPatches_;
|
||||
|
||||
//- Point mesh used for interpolation
|
||||
pointMesh fromPointMesh_;
|
||||
|
||||
//- Cell addressing
|
||||
labelList cellAddressing_;
|
||||
|
||||
|
@ -26,7 +26,6 @@ License
|
||||
|
||||
#include "meshToMesh.H"
|
||||
#include "volFields.H"
|
||||
#include "volPointInterpolation.H"
|
||||
#include "interpolationCellPoint.H"
|
||||
#include "SubField.H"
|
||||
#include "mixedFvPatchField.H"
|
||||
@ -102,13 +101,7 @@ void meshToMesh::interpolateField
|
||||
) const
|
||||
{
|
||||
// Cell-Point interpolation
|
||||
volPointInterpolation vpi(fromMesh_, fromPointMesh_);
|
||||
|
||||
interpolationCellPoint<Type> interpolator
|
||||
(
|
||||
vpi,
|
||||
fromVf
|
||||
);
|
||||
interpolationCellPoint<Type> interpolator(fromVf);
|
||||
|
||||
forAll (toF, celli)
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ License
|
||||
#include "volFields.H"
|
||||
#include "ListListOps.H"
|
||||
#include "SortableList.H"
|
||||
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -236,8 +236,8 @@ Foam::sampledSets::sampledSets
|
||||
loadFromFiles_(loadFromFiles),
|
||||
outputPath_(fileName::null),
|
||||
searchEngine_(mesh_, true),
|
||||
pMeshPtr_(NULL),
|
||||
pInterpPtr_(NULL),
|
||||
// pMeshPtr_(NULL),
|
||||
// pInterpPtr_(NULL),
|
||||
fieldNames_(),
|
||||
interpolationScheme_(word::null),
|
||||
writeFormat_(word::null)
|
||||
@ -330,8 +330,10 @@ void Foam::sampledSets::read(const dictionary& dict)
|
||||
|
||||
void Foam::sampledSets::correct()
|
||||
{
|
||||
pMeshPtr_.clear();
|
||||
pInterpPtr_.clear();
|
||||
// reset interpolation
|
||||
pointMesh::Delete(mesh_);
|
||||
volPointInterpolation::Delete(mesh_);
|
||||
|
||||
searchEngine_.correct();
|
||||
|
||||
PtrList<sampledSet> newList
|
||||
|
@ -52,7 +52,6 @@ namespace Foam
|
||||
class objectRegistry;
|
||||
class dictionary;
|
||||
class fvMesh;
|
||||
class volPointInterpolation;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class sampledSets Declaration
|
||||
@ -104,7 +103,6 @@ class sampledSets
|
||||
//- Construct interpolating field to the sampleSets
|
||||
volFieldSampler
|
||||
(
|
||||
const volPointInterpolation&,
|
||||
const word& interpolationScheme,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
const PtrList<sampledSet>&
|
||||
@ -159,12 +157,6 @@ class sampledSets
|
||||
//- Mesh search engine
|
||||
meshSearch searchEngine_;
|
||||
|
||||
//- pointMesh for interpolation
|
||||
autoPtr<pointMesh> pMeshPtr_;
|
||||
|
||||
//- volPointInterpolation for interpolation
|
||||
autoPtr<volPointInterpolation> pInterpPtr_;
|
||||
|
||||
|
||||
// Read from dictonary
|
||||
|
||||
|
@ -26,7 +26,6 @@ License
|
||||
|
||||
#include "sampledSets.H"
|
||||
#include "volFields.H"
|
||||
#include "volPointInterpolation.H"
|
||||
#include "ListListOps.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -34,7 +33,6 @@ License
|
||||
template <class Type>
|
||||
Foam::sampledSets::volFieldSampler<Type>::volFieldSampler
|
||||
(
|
||||
const volPointInterpolation& pInterp,
|
||||
const word& interpolationScheme,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
const PtrList<sampledSet>& samplers
|
||||
@ -45,7 +43,7 @@ Foam::sampledSets::volFieldSampler<Type>::volFieldSampler
|
||||
{
|
||||
autoPtr<interpolation<Type> > interpolator
|
||||
(
|
||||
interpolation<Type>::New(interpolationScheme, pInterp, field)
|
||||
interpolation<Type>::New(interpolationScheme, field)
|
||||
);
|
||||
|
||||
forAll(samplers, seti)
|
||||
@ -228,13 +226,6 @@ void Foam::sampledSets::sampleAndWrite
|
||||
{
|
||||
bool interpolate = interpolationScheme_ != "cell";
|
||||
|
||||
if (interpolate && (!pMeshPtr_.valid() || !pInterpPtr_.valid()))
|
||||
{
|
||||
// set up interpolation
|
||||
pMeshPtr_.reset(new pointMesh(mesh_));
|
||||
pInterpPtr_.reset(new volPointInterpolation(mesh_, pMeshPtr_()));
|
||||
}
|
||||
|
||||
// Create or use existing writer
|
||||
if (!fields.formatter.valid())
|
||||
{
|
||||
@ -275,7 +266,6 @@ void Foam::sampledSets::sampleAndWrite
|
||||
fieldi,
|
||||
new volFieldSampler<Type>
|
||||
(
|
||||
pInterpPtr_(),
|
||||
interpolationScheme_,
|
||||
vf,
|
||||
*this
|
||||
@ -300,7 +290,6 @@ void Foam::sampledSets::sampleAndWrite
|
||||
fieldi,
|
||||
new volFieldSampler<Type>
|
||||
(
|
||||
pInterpPtr_(),
|
||||
interpolationScheme_,
|
||||
mesh_.lookupObject
|
||||
<GeometricField<Type, fvPatchField, volMesh> >
|
||||
|
291
src/sampling/sampledSurface/isoSurface/isoSurface.C
Normal file
291
src/sampling/sampledSurface/isoSurface/isoSurface.C
Normal file
@ -0,0 +1,291 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "isoSurface.H"
|
||||
#include "dictionary.H"
|
||||
#include "polyMesh.H"
|
||||
#include "volFields.H"
|
||||
#include "mergePoints.H"
|
||||
#include "tetMatcher.H"
|
||||
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(isoSurface, 0);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::isoSurface::isoSurface
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const scalarField& cellValues,
|
||||
const scalarField& pointValues,
|
||||
const scalar iso
|
||||
)
|
||||
:
|
||||
mesh_(mesh),
|
||||
cellValues_(cellValues),
|
||||
pointValues_(pointValues),
|
||||
iso_(iso)
|
||||
{
|
||||
const pointField& cellCentres = mesh.cellCentres();
|
||||
|
||||
tetMatcher tet;
|
||||
|
||||
DynamicList<point> triPoints;
|
||||
DynamicList<label> triMeshCells;
|
||||
|
||||
forAll(mesh.cells(), cellI)
|
||||
{
|
||||
label oldNPoints = triPoints.size();
|
||||
|
||||
const cell& cFaces = mesh.cells()[cellI];
|
||||
|
||||
if (tet.isA(mesh, cellI))
|
||||
{
|
||||
// For tets don't do cell-centre decomposition, just use the
|
||||
// tet points and values
|
||||
|
||||
const face& f0 = mesh.faces()[cFaces[0]];
|
||||
|
||||
// Get the other point
|
||||
const face& f1 = mesh.faces()[cFaces[1]];
|
||||
label oppositeI = -1;
|
||||
forAll(f1, fp)
|
||||
{
|
||||
oppositeI = f1[fp];
|
||||
|
||||
if (findIndex(f0, oppositeI) == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
vertexInterp
|
||||
(
|
||||
iso,
|
||||
pointValues[f0[0]],
|
||||
pointValues[f0[1]],
|
||||
pointValues[f0[2]],
|
||||
pointValues[oppositeI],
|
||||
|
||||
mesh.points()[f0[0]],
|
||||
mesh.points()[f0[1]],
|
||||
mesh.points()[f0[2]],
|
||||
mesh.points()[oppositeI],
|
||||
|
||||
triPoints
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
const cell& cFaces = mesh.cells()[cellI];
|
||||
|
||||
forAll(cFaces, cFaceI)
|
||||
{
|
||||
label faceI = cFaces[cFaceI];
|
||||
const face& f = mesh.faces()[faceI];
|
||||
|
||||
// Do a tetrahedrisation. Each face to cc becomes pyr.
|
||||
// Each pyr gets split into two tets by diagionalisation
|
||||
// of face. So
|
||||
// - f[0], f[1], f[2], cc
|
||||
// - f[0], f[2], f[3], cc
|
||||
|
||||
for(label fp = 1; fp < f.size() - 1; fp++)
|
||||
{
|
||||
vertexInterp
|
||||
(
|
||||
iso,
|
||||
pointValues[f[0]],
|
||||
pointValues[f[fp]],
|
||||
pointValues[f[f.fcIndex(fp)]],
|
||||
cellValues[cellI],
|
||||
|
||||
mesh.points()[f[0]],
|
||||
mesh.points()[f[fp]],
|
||||
mesh.points()[f[f.fcIndex(fp)]],
|
||||
cellCentres[cellI],
|
||||
|
||||
triPoints
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Every three triPoints is a cell
|
||||
label nCells = (triPoints.size()-oldNPoints)/3;
|
||||
for (label i = 0; i < nCells; i++)
|
||||
{
|
||||
triMeshCells.append(cellI);
|
||||
}
|
||||
}
|
||||
|
||||
triPoints.shrink();
|
||||
triMeshCells.shrink();
|
||||
meshCells_.transfer(triMeshCells);
|
||||
|
||||
pointField newPoints;
|
||||
mergePoints(triPoints, SMALL, false, triPointMergeMap_, newPoints);
|
||||
|
||||
DynamicList<labelledTri> tris(meshCells_.size());
|
||||
forAll(meshCells_, triI)
|
||||
{
|
||||
tris.append
|
||||
(
|
||||
labelledTri
|
||||
(
|
||||
triPointMergeMap_[3*triI],
|
||||
triPointMergeMap_[3*triI+1],
|
||||
triPointMergeMap_[3*triI+2],
|
||||
0
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//- 1.5.x:
|
||||
//tris.shrink();
|
||||
//triSurface::operator=
|
||||
//(
|
||||
// triSurface(tris, geometricSurfacePatchList(0), newPoints)
|
||||
//);
|
||||
|
||||
triSurface::operator=
|
||||
(
|
||||
triSurface(tris, geometricSurfacePatchList(0), newPoints, true)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
//Foam::tmp<Foam::scalarField>
|
||||
//Foam::isoSurface::sample
|
||||
//(
|
||||
// const volScalarField& vField
|
||||
//) const
|
||||
//{
|
||||
// return sampleField(vField);
|
||||
//}
|
||||
//
|
||||
//
|
||||
//Foam::tmp<Foam::vectorField>
|
||||
//Foam::isoSurface::sample
|
||||
//(
|
||||
// const volVectorField& vField
|
||||
//) const
|
||||
//{
|
||||
// return sampleField(vField);
|
||||
//}
|
||||
//
|
||||
//Foam::tmp<Foam::sphericalTensorField>
|
||||
//Foam::isoSurface::sample
|
||||
//(
|
||||
// const volSphericalTensorField& vField
|
||||
//) const
|
||||
//{
|
||||
// return sampleField(vField);
|
||||
//}
|
||||
//
|
||||
//
|
||||
//Foam::tmp<Foam::symmTensorField>
|
||||
//Foam::isoSurface::sample
|
||||
//(
|
||||
// const volSymmTensorField& vField
|
||||
//) const
|
||||
//{
|
||||
// return sampleField(vField);
|
||||
//}
|
||||
//
|
||||
//
|
||||
//Foam::tmp<Foam::tensorField>
|
||||
//Foam::isoSurface::sample
|
||||
//(
|
||||
// const volTensorField& vField
|
||||
//) const
|
||||
//{
|
||||
// return sampleField(vField);
|
||||
//}
|
||||
//
|
||||
//
|
||||
//Foam::tmp<Foam::scalarField>
|
||||
//Foam::isoSurface::interpolate
|
||||
//(
|
||||
// const interpolation<scalar>& interpolator
|
||||
//) const
|
||||
//{
|
||||
// return interpolateField(interpolator);
|
||||
//}
|
||||
//
|
||||
//
|
||||
//Foam::tmp<Foam::vectorField>
|
||||
//Foam::isoSurface::interpolate
|
||||
//(
|
||||
// const interpolation<vector>& interpolator
|
||||
//) const
|
||||
//{
|
||||
// return interpolateField(interpolator);
|
||||
//}
|
||||
//
|
||||
//Foam::tmp<Foam::sphericalTensorField>
|
||||
//Foam::isoSurface::interpolate
|
||||
//(
|
||||
// const interpolation<sphericalTensor>& interpolator
|
||||
//) const
|
||||
//{
|
||||
// return interpolateField(interpolator);
|
||||
//}
|
||||
//
|
||||
//
|
||||
//Foam::tmp<Foam::symmTensorField>
|
||||
//Foam::isoSurface::interpolate
|
||||
//(
|
||||
// const interpolation<symmTensor>& interpolator
|
||||
//) const
|
||||
//{
|
||||
// return interpolateField(interpolator);
|
||||
//}
|
||||
//
|
||||
//
|
||||
//Foam::tmp<Foam::tensorField>
|
||||
//Foam::isoSurface::interpolate
|
||||
//(
|
||||
// const interpolation<tensor>& interpolator
|
||||
//) const
|
||||
//{
|
||||
// return interpolateField(interpolator);
|
||||
//}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
173
src/sampling/sampledSurface/isoSurface/isoSurface.H
Normal file
173
src/sampling/sampledSurface/isoSurface/isoSurface.H
Normal file
@ -0,0 +1,173 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::isoSurface
|
||||
|
||||
Description
|
||||
A surface formed by the iso value.
|
||||
After "Polygonising A Scalar Field Using Tetrahedrons", Paul Bourke
|
||||
|
||||
SourceFiles
|
||||
isoSurface.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef isoSurface_H
|
||||
#define isoSurface_H
|
||||
|
||||
#include "triSurface.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class polyMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class isoSurface Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class isoSurface
|
||||
:
|
||||
public triSurface
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Reference to mesh
|
||||
const polyMesh& mesh_;
|
||||
|
||||
//- Reference to cell values
|
||||
const scalarField& cellValues_;
|
||||
|
||||
//- Reference to point values
|
||||
const scalarField& pointValues_;
|
||||
|
||||
//- Isosurface value
|
||||
const scalar iso_;
|
||||
|
||||
|
||||
//- For every triangle the original cell in mesh
|
||||
labelList meshCells_;
|
||||
|
||||
//- For every unmerged triangle point the point in the triSurface
|
||||
labelList triPointMergeMap_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
template<class T>
|
||||
static T vertexInterp
|
||||
(
|
||||
const scalar iso,
|
||||
const T& p0,
|
||||
const T& p1,
|
||||
const scalar s0,
|
||||
const scalar s1
|
||||
);
|
||||
|
||||
template<class T>
|
||||
static void vertexInterp
|
||||
(
|
||||
const scalar iso,
|
||||
const scalar s0,
|
||||
const scalar s1,
|
||||
const scalar s2,
|
||||
const scalar s3,
|
||||
|
||||
const T& p0,
|
||||
const T& p1,
|
||||
const T& p2,
|
||||
const T& p3,
|
||||
|
||||
DynamicList<T>& points
|
||||
);
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("isoSurface");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
isoSurface
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const scalarField& cellValues,
|
||||
const scalarField& pointValues,
|
||||
const scalar iso
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- For every face original cell in mesh
|
||||
const labelList& meshCells() const
|
||||
{
|
||||
return meshCells_;
|
||||
}
|
||||
|
||||
//- For every unmerged triangle point the point in the triSurface
|
||||
const labelList triPointMergeMap() const
|
||||
{
|
||||
return triPointMergeMap_;
|
||||
}
|
||||
|
||||
|
||||
//- sample field on faces
|
||||
template <class Type>
|
||||
tmp<Field<Type> > sample
|
||||
(
|
||||
const Field<Type>& sampleCellValues
|
||||
) const;
|
||||
|
||||
//- interpolate field to points
|
||||
template <class Type>
|
||||
tmp<Field<Type> >
|
||||
interpolate
|
||||
(
|
||||
const Field<Type>& sampleCellValues,
|
||||
const Field<Type>& samplePointValues
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "isoSurfaceTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
292
src/sampling/sampledSurface/isoSurface/isoSurfaceTemplates.C
Normal file
292
src/sampling/sampledSurface/isoSurface/isoSurfaceTemplates.C
Normal file
@ -0,0 +1,292 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "isoSurface.H"
|
||||
#include "polyMesh.H"
|
||||
#include "tetMatcher.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Type Foam::isoSurface::vertexInterp
|
||||
(
|
||||
const scalar iso,
|
||||
const Type& p0,
|
||||
const Type& p1,
|
||||
const scalar s0,
|
||||
const scalar s1
|
||||
)
|
||||
{
|
||||
scalar d = s1-s0;
|
||||
|
||||
if (mag(d) > VSMALL)
|
||||
{
|
||||
return (iso-s0)/d*p1 + (s1-iso)/d*p0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.5*(p0+p1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// After "Polygonising A Scalar Field Using Tetrahedrons"
|
||||
// by Paul Bourke
|
||||
// Get value consistent with uncompacted triangle points.
|
||||
// Given tet corner sample values s0..s3 interpolate the corresponding
|
||||
// values p0..p3 to construct the surface corresponding to sample value iso.
|
||||
template<class Type>
|
||||
void Foam::isoSurface::vertexInterp
|
||||
(
|
||||
const scalar iso,
|
||||
const scalar s0,
|
||||
const scalar s1,
|
||||
const scalar s2,
|
||||
const scalar s3,
|
||||
|
||||
const Type& p0,
|
||||
const Type& p1,
|
||||
const Type& p2,
|
||||
const Type& p3,
|
||||
|
||||
DynamicList<Type>& points
|
||||
)
|
||||
{
|
||||
int triIndex = 0;
|
||||
if (s0 < iso)
|
||||
{
|
||||
triIndex |= 1;
|
||||
}
|
||||
if (s1 < iso)
|
||||
{
|
||||
triIndex |= 2;
|
||||
}
|
||||
if (s2 < iso)
|
||||
{
|
||||
triIndex |= 4;
|
||||
}
|
||||
if (s3 < iso)
|
||||
{
|
||||
triIndex |= 8;
|
||||
}
|
||||
|
||||
/* Form the vertices of the triangles for each case */
|
||||
switch (triIndex)
|
||||
{
|
||||
case 0x00:
|
||||
case 0x0F:
|
||||
break;
|
||||
|
||||
case 0x0E:
|
||||
case 0x01:
|
||||
points.append(vertexInterp(iso,p0,p1,s0,s1));
|
||||
points.append(vertexInterp(iso,p0,p2,s0,s2));
|
||||
points.append(vertexInterp(iso,p0,p3,s0,s3));
|
||||
break;
|
||||
|
||||
case 0x0D:
|
||||
case 0x02:
|
||||
points.append(vertexInterp(iso,p1,p0,s1,s0));
|
||||
points.append(vertexInterp(iso,p1,p3,s1,s3));
|
||||
points.append(vertexInterp(iso,p1,p2,s1,s2));
|
||||
break;
|
||||
|
||||
case 0x0C:
|
||||
case 0x03:
|
||||
{
|
||||
const Type tp1 = vertexInterp(iso,p0,p2,s0,s2);
|
||||
const Type tp2 = vertexInterp(iso,p1,p3,s1,s3);
|
||||
|
||||
points.append(vertexInterp(iso,p0,p3,s0,s3));
|
||||
points.append(tp1);
|
||||
points.append(tp2);
|
||||
points.append(tp2);
|
||||
points.append(vertexInterp(iso,p1,p2,s1,s2));
|
||||
points.append(tp1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0B:
|
||||
case 0x04:
|
||||
{
|
||||
points.append(vertexInterp(iso,p2,p0,s2,s0));
|
||||
points.append(vertexInterp(iso,p2,p1,s2,s1));
|
||||
points.append(vertexInterp(iso,p2,p3,s2,s3));
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0A:
|
||||
case 0x05:
|
||||
{
|
||||
const Type tp0 = vertexInterp(iso,p0,p1,s0,s1);
|
||||
const Type tp1 = vertexInterp(iso,p2,p3,s2,s3);
|
||||
|
||||
points.append(tp0);
|
||||
points.append(tp1);
|
||||
points.append(vertexInterp(iso,p0,p3,s0,s3));
|
||||
points.append(tp0);
|
||||
points.append(vertexInterp(iso,p1,p2,s1,s2));
|
||||
points.append(tp1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x09:
|
||||
case 0x06:
|
||||
{
|
||||
const Type tp0 = vertexInterp(iso,p0,p1,s0,s1);
|
||||
const Type tp1 = vertexInterp(iso,p2,p3,s2,s3);
|
||||
|
||||
points.append(tp0);
|
||||
points.append(vertexInterp(iso,p1,p3,s1,s3));
|
||||
points.append(tp1);
|
||||
points.append(tp0);
|
||||
points.append(vertexInterp(iso,p0,p2,s0,s2));
|
||||
points.append(tp1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x07:
|
||||
case 0x08:
|
||||
points.append(vertexInterp(iso,p3,p0,s3,s0));
|
||||
points.append(vertexInterp(iso,p3,p2,s3,s2));
|
||||
points.append(vertexInterp(iso,p3,p1,s3,s1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::isoSurface::sample(const Field<Type>& vField) const
|
||||
{
|
||||
return tmp<Field<Type> >(new Field<Type>(vField, meshCells()));
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::isoSurface::interpolate
|
||||
(
|
||||
const Field<Type>& sampleCellValues,
|
||||
const Field<Type>& samplePointValues
|
||||
) const
|
||||
{
|
||||
tetMatcher tet;
|
||||
|
||||
DynamicList<Type> triValues;
|
||||
|
||||
// Note: in same order as construction of triSurface
|
||||
label oldCellI = -1;
|
||||
forAll(meshCells_, triI)
|
||||
{
|
||||
label cellI = meshCells_[triI];
|
||||
|
||||
if (cellI != oldCellI)
|
||||
{
|
||||
oldCellI = cellI;
|
||||
|
||||
const cell& cFaces = mesh_.cells()[cellI];
|
||||
|
||||
if (tet.isA(mesh_, cellI))
|
||||
{
|
||||
// For tets don't do cell-centre decomposition, just use the
|
||||
// tet points and values
|
||||
|
||||
const face& f0 = mesh_.faces()[cFaces[0]];
|
||||
|
||||
// Get the other point
|
||||
const face& f1 = mesh_.faces()[cFaces[1]];
|
||||
label oppositeI = -1;
|
||||
forAll(f1, fp)
|
||||
{
|
||||
oppositeI = f1[fp];
|
||||
|
||||
if (findIndex(f0, oppositeI) == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
vertexInterp
|
||||
(
|
||||
iso_,
|
||||
pointValues_[f0[0]],
|
||||
pointValues_[f0[1]],
|
||||
pointValues_[f0[2]],
|
||||
pointValues_[oppositeI],
|
||||
|
||||
samplePointValues[f0[0]],
|
||||
samplePointValues[f0[1]],
|
||||
samplePointValues[f0[2]],
|
||||
samplePointValues[oppositeI],
|
||||
|
||||
triValues
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(cFaces, cFaceI)
|
||||
{
|
||||
label faceI = cFaces[cFaceI];
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
|
||||
for(label fp = 1; fp < f.size() - 1; fp++)
|
||||
{
|
||||
vertexInterp
|
||||
(
|
||||
iso_,
|
||||
pointValues_[f[0]],
|
||||
pointValues_[f[fp]],
|
||||
pointValues_[f[f.fcIndex(fp)]],
|
||||
cellValues_[cellI],
|
||||
|
||||
samplePointValues[f[0]],
|
||||
samplePointValues[f[fp]],
|
||||
samplePointValues[f[f.fcIndex(fp)]],
|
||||
sampleCellValues[cellI],
|
||||
|
||||
triValues
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// One value per point
|
||||
tmp<Field<Type> > tvalues(new Field<Type>(points().size()));
|
||||
Field<Type>& values = tvalues();
|
||||
|
||||
forAll(triValues, i)
|
||||
{
|
||||
values[triPointMergeMap_[i]] = triValues[i];
|
||||
}
|
||||
|
||||
return tvalues;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
204
src/sampling/sampledSurface/isoSurface/sampledIsoSurface.C
Normal file
204
src/sampling/sampledSurface/isoSurface/sampledIsoSurface.C
Normal file
@ -0,0 +1,204 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "sampledIsoSurface.H"
|
||||
#include "dictionary.H"
|
||||
#include "volFields.H"
|
||||
#include "volPointInterpolation.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(sampledIsoSurface, 0);
|
||||
addNamedToRunTimeSelectionTable(sampledSurface, sampledIsoSurface, word, isoSurface);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::sampledIsoSurface::sampledIsoSurface
|
||||
(
|
||||
const word& name,
|
||||
const polyMesh& mesh,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
sampledSurface(name, mesh, dict),
|
||||
isoField_(dict.lookup("isoField")),
|
||||
isoVal_(readScalar(dict.lookup("isoValue"))),
|
||||
zoneName_(word::null),
|
||||
facesPtr_(NULL),
|
||||
storedTimeIndex_(-1),
|
||||
meshCells_(0),
|
||||
triPointMergeMap_(0)
|
||||
{
|
||||
// label zoneId = -1;
|
||||
// if (dict.readIfPresent("zone", zoneName_))
|
||||
// {
|
||||
// zoneId = mesh.cellZones().findZoneID(zoneName_);
|
||||
// if (debug && zoneId < 0)
|
||||
// {
|
||||
// Info<< "cellZone \"" << zoneName_
|
||||
// << "\" not found - using entire mesh"
|
||||
// << endl;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::sampledIsoSurface::~sampledIsoSurface()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::sampledIsoSurface::correct(const bool meshChanged)
|
||||
{
|
||||
// Only change of mesh changes plane - zone restriction gets lost
|
||||
if (meshChanged)
|
||||
{
|
||||
facesPtr_.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::sampledIsoSurface::sample
|
||||
(
|
||||
const volScalarField& vField
|
||||
) const
|
||||
{
|
||||
return sampleField(vField);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::vectorField>
|
||||
Foam::sampledIsoSurface::sample
|
||||
(
|
||||
const volVectorField& vField
|
||||
) const
|
||||
{
|
||||
return sampleField(vField);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::sphericalTensorField>
|
||||
Foam::sampledIsoSurface::sample
|
||||
(
|
||||
const volSphericalTensorField& vField
|
||||
) const
|
||||
{
|
||||
return sampleField(vField);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::symmTensorField>
|
||||
Foam::sampledIsoSurface::sample
|
||||
(
|
||||
const volSymmTensorField& vField
|
||||
) const
|
||||
{
|
||||
return sampleField(vField);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::tensorField>
|
||||
Foam::sampledIsoSurface::sample
|
||||
(
|
||||
const volTensorField& vField
|
||||
) const
|
||||
{
|
||||
return sampleField(vField);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::sampledIsoSurface::interpolate
|
||||
(
|
||||
const interpolation<scalar>& interpolator
|
||||
) const
|
||||
{
|
||||
return interpolateField(interpolator);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::vectorField>
|
||||
Foam::sampledIsoSurface::interpolate
|
||||
(
|
||||
const interpolation<vector>& interpolator
|
||||
) const
|
||||
{
|
||||
return interpolateField(interpolator);
|
||||
}
|
||||
|
||||
Foam::tmp<Foam::sphericalTensorField>
|
||||
Foam::sampledIsoSurface::interpolate
|
||||
(
|
||||
const interpolation<sphericalTensor>& interpolator
|
||||
) const
|
||||
{
|
||||
return interpolateField(interpolator);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::symmTensorField>
|
||||
Foam::sampledIsoSurface::interpolate
|
||||
(
|
||||
const interpolation<symmTensor>& interpolator
|
||||
) const
|
||||
{
|
||||
return interpolateField(interpolator);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::tensorField>
|
||||
Foam::sampledIsoSurface::interpolate
|
||||
(
|
||||
const interpolation<tensor>& interpolator
|
||||
) const
|
||||
{
|
||||
return interpolateField(interpolator);
|
||||
}
|
||||
|
||||
|
||||
void Foam::sampledIsoSurface::print(Ostream& os) const
|
||||
{
|
||||
os << "sampledIsoSurface: " << name() << " :"
|
||||
<< " field:" << isoField_
|
||||
<< " value:" << isoVal_
|
||||
<< " faces:" << faces().size()
|
||||
<< " points:" << points().size();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
232
src/sampling/sampledSurface/isoSurface/sampledIsoSurface.H
Normal file
232
src/sampling/sampledSurface/isoSurface/sampledIsoSurface.H
Normal file
@ -0,0 +1,232 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::sampledIsoSurface
|
||||
|
||||
Description
|
||||
A sampledSurface defined by a surface of iso value. Always triangulated.
|
||||
To be used in sampleSurfaces / functionObjects. Recalculates iso surface
|
||||
only if time changes.
|
||||
|
||||
SourceFiles
|
||||
sampledIsoSurface.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef sampledIsoSurface_H
|
||||
#define sampledIsoSurface_H
|
||||
|
||||
#include "sampledSurface.H"
|
||||
#include "triSurface.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class sampledIsoSurface Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class sampledIsoSurface
|
||||
:
|
||||
public sampledSurface,
|
||||
public triSurface
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Field to get isoSurface of
|
||||
word isoField_;
|
||||
|
||||
//- iso value
|
||||
scalar isoVal_;
|
||||
|
||||
//- zone name (if restricted to zones)
|
||||
word zoneName_;
|
||||
|
||||
//- triangles converted to faceList
|
||||
mutable autoPtr<faceList> facesPtr_;
|
||||
|
||||
|
||||
// Recreated for every isoSurface
|
||||
|
||||
//- Time at last call
|
||||
mutable label storedTimeIndex_;
|
||||
|
||||
//- For every triangle the original cell in mesh
|
||||
mutable labelList meshCells_;
|
||||
|
||||
//- For every unmerged triangle point the point in the triSurface
|
||||
mutable labelList triPointMergeMap_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- sample field on faces
|
||||
template <class Type>
|
||||
tmp<Field<Type> > sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const;
|
||||
|
||||
|
||||
template <class Type>
|
||||
tmp<Field<Type> >
|
||||
interpolateField(const interpolation<Type>&) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("sampledIsoSurface");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
sampledIsoSurface
|
||||
(
|
||||
const word& name,
|
||||
const polyMesh& mesh,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~sampledIsoSurface();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Points of surface
|
||||
virtual const pointField& points() const
|
||||
{
|
||||
return triSurface::points();
|
||||
}
|
||||
|
||||
//- Faces of surface
|
||||
virtual const faceList& faces() const
|
||||
{
|
||||
if (!facesPtr_.valid())
|
||||
{
|
||||
const triSurface& s = *this;
|
||||
|
||||
facesPtr_.reset(new faceList(s.size()));
|
||||
|
||||
forAll(s, i)
|
||||
{
|
||||
facesPtr_()[i] = s[i].triFaceFace();
|
||||
}
|
||||
}
|
||||
return facesPtr_;
|
||||
}
|
||||
|
||||
|
||||
//- Correct for mesh movement and/or field changes
|
||||
virtual void correct(const bool meshChanged);
|
||||
|
||||
|
||||
//- sample field on surface
|
||||
virtual tmp<scalarField> sample
|
||||
(
|
||||
const volScalarField&
|
||||
) const;
|
||||
|
||||
//- sample field on surface
|
||||
virtual tmp<vectorField> sample
|
||||
(
|
||||
const volVectorField&
|
||||
) const;
|
||||
|
||||
//- sample field on surface
|
||||
virtual tmp<sphericalTensorField> sample
|
||||
(
|
||||
const volSphericalTensorField&
|
||||
) const;
|
||||
|
||||
//- sample field on surface
|
||||
virtual tmp<symmTensorField> sample
|
||||
(
|
||||
const volSymmTensorField&
|
||||
) const;
|
||||
|
||||
//- sample field on surface
|
||||
virtual tmp<tensorField> sample
|
||||
(
|
||||
const volTensorField&
|
||||
) const;
|
||||
|
||||
|
||||
//- interpolate field on surface
|
||||
virtual tmp<scalarField> interpolate
|
||||
(
|
||||
const interpolation<scalar>&
|
||||
) const;
|
||||
|
||||
//- interpolate field on surface
|
||||
virtual tmp<vectorField> interpolate
|
||||
(
|
||||
const interpolation<vector>&
|
||||
) const;
|
||||
|
||||
//- interpolate field on surface
|
||||
virtual tmp<sphericalTensorField> interpolate
|
||||
(
|
||||
const interpolation<sphericalTensor>&
|
||||
) const;
|
||||
|
||||
//- interpolate field on surface
|
||||
virtual tmp<symmTensorField> interpolate
|
||||
(
|
||||
const interpolation<symmTensor>&
|
||||
) const;
|
||||
|
||||
//- interpolate field on surface
|
||||
virtual tmp<tensorField> interpolate
|
||||
(
|
||||
const interpolation<tensor>&
|
||||
) const;
|
||||
|
||||
//- Write
|
||||
virtual void print(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "sampledIsoSurfaceTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -0,0 +1,144 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "sampledIsoSurface.H"
|
||||
#include "isoSurface.H"
|
||||
#include "volFieldsFwd.H"
|
||||
#include "pointFields.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template <class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::sampledIsoSurface::sampleField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
) const
|
||||
{
|
||||
const fvMesh& fvm = vField.mesh();
|
||||
|
||||
if (fvm.time().timeIndex() != storedTimeIndex_)
|
||||
{
|
||||
storedTimeIndex_ = fvm.time().timeIndex();
|
||||
|
||||
//- Clear any stored topo
|
||||
facesPtr_.clear();
|
||||
|
||||
const volScalarField& cellFld =
|
||||
fvm.lookupObject<volScalarField>(isoField_);
|
||||
|
||||
tmp<pointScalarField> pointFld
|
||||
(
|
||||
volPointInterpolation::New(fvm).interpolate(cellFld)
|
||||
);
|
||||
|
||||
const isoSurface iso
|
||||
(
|
||||
fvm,
|
||||
cellFld.internalField(),
|
||||
pointFld().internalField(),
|
||||
isoVal_
|
||||
);
|
||||
|
||||
const_cast<sampledIsoSurface&>(*this).triSurface::operator=(iso);
|
||||
meshCells_ = iso.meshCells();
|
||||
triPointMergeMap_ = iso.triPointMergeMap();
|
||||
}
|
||||
|
||||
return tmp<Field<Type> >(new Field<Type>(vField, meshCells_));
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::sampledIsoSurface::interpolateField
|
||||
(
|
||||
const interpolation<Type>& interpolator
|
||||
) const
|
||||
{
|
||||
const fvMesh& fvm = static_cast<const fvMesh&>(mesh());
|
||||
|
||||
if (fvm.time().timeIndex() != storedTimeIndex_)
|
||||
{
|
||||
//- Clear any stored topo
|
||||
facesPtr_.clear();
|
||||
|
||||
storedTimeIndex_ = fvm.time().timeIndex();
|
||||
|
||||
const volScalarField& cellFld =
|
||||
fvm.lookupObject<volScalarField>(isoField_);
|
||||
|
||||
tmp<pointScalarField> pointFld
|
||||
(
|
||||
volPointInterpolation::New(fvm).interpolate(cellFld)
|
||||
);
|
||||
|
||||
const isoSurface iso
|
||||
(
|
||||
fvm,
|
||||
cellFld.internalField(),
|
||||
pointFld().internalField(),
|
||||
isoVal_
|
||||
);
|
||||
|
||||
const_cast<sampledIsoSurface&>(*this).triSurface::operator=(iso);
|
||||
meshCells_ = iso.meshCells();
|
||||
triPointMergeMap_ = iso.triPointMergeMap();
|
||||
}
|
||||
|
||||
|
||||
// One value per point
|
||||
tmp<Field<Type> > tvalues(new Field<Type>(points().size()));
|
||||
Field<Type>& values = tvalues();
|
||||
|
||||
boolList pointDone(points().size(), false);
|
||||
|
||||
forAll(faces(), cutFaceI)
|
||||
{
|
||||
const face& f = faces()[cutFaceI];
|
||||
|
||||
forAll(f, faceVertI)
|
||||
{
|
||||
label pointI = f[faceVertI];
|
||||
|
||||
if (!pointDone[pointI])
|
||||
{
|
||||
values[pointI] = interpolator.interpolate
|
||||
(
|
||||
points()[pointI],
|
||||
meshCells_[cutFaceI]
|
||||
);
|
||||
pointDone[pointI] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tvalues;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
@ -31,6 +31,7 @@ License
|
||||
#include "IOmanip.H"
|
||||
#include "ListListOps.H"
|
||||
#include "mergePoints.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -270,8 +271,6 @@ Foam::sampledSurfaces::sampledSurfaces
|
||||
mesh_(refCast<const fvMesh>(obr)),
|
||||
loadFromFiles_(loadFromFiles),
|
||||
outputPath_(fileName::null),
|
||||
pMeshPtr_(NULL),
|
||||
pInterpPtr_(NULL),
|
||||
fieldNames_(),
|
||||
interpolationScheme_(word::null),
|
||||
writeFormat_(word::null),
|
||||
@ -369,9 +368,9 @@ void Foam::sampledSurfaces::correct()
|
||||
operator[](surfI).correct(true);
|
||||
}
|
||||
|
||||
// reset interpolation for later
|
||||
pMeshPtr_.clear();
|
||||
pInterpPtr_.clear();
|
||||
// reset interpolation
|
||||
pointMesh::Delete(mesh_);
|
||||
volPointInterpolation::Delete(mesh_);
|
||||
|
||||
mergeSurfaces();
|
||||
}
|
||||
|
@ -41,7 +41,6 @@ SourceFiles
|
||||
#include "sampledSurface.H"
|
||||
#include "surfaceWriter.H"
|
||||
#include "volFieldsFwd.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -130,23 +129,17 @@ class sampledSurfaces
|
||||
|
||||
//- Name of this set of surfaces,
|
||||
// Also used as the name of the sampledSurfaces directory.
|
||||
word name_;
|
||||
const word name_;
|
||||
|
||||
//- Const reference to fvMesh
|
||||
const fvMesh& mesh_;
|
||||
|
||||
//- Load fields from files (not from objectRegistry)
|
||||
bool loadFromFiles_;
|
||||
const bool loadFromFiles_;
|
||||
|
||||
//- output path
|
||||
fileName outputPath_;
|
||||
|
||||
//- pointMesh for interpolation
|
||||
autoPtr<pointMesh> pMeshPtr_;
|
||||
|
||||
//- volPointInterpolation for interpolation
|
||||
autoPtr<volPointInterpolation> pInterpPtr_;
|
||||
|
||||
|
||||
// Read from dictonary
|
||||
|
||||
@ -192,13 +185,6 @@ class sampledSurfaces
|
||||
const wordList& fieldTypes
|
||||
) const;
|
||||
|
||||
//- Set interpolator for the field
|
||||
template<class Type>
|
||||
autoPtr<interpolation<Type> > setInterpolator
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
);
|
||||
|
||||
//- Sample and write a particular volume field
|
||||
template<class Type>
|
||||
void sampleAndWrite
|
||||
|
@ -59,30 +59,6 @@ Foam::label Foam::sampledSurfaces::grep
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::autoPtr<Foam::interpolation<Type> >
|
||||
Foam::sampledSurfaces::setInterpolator
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vField
|
||||
)
|
||||
{
|
||||
if (!pMeshPtr_.valid() || !pInterpPtr_.valid())
|
||||
{
|
||||
// set up interpolation
|
||||
pMeshPtr_.reset(new pointMesh(mesh_));
|
||||
pInterpPtr_.reset(new volPointInterpolation(mesh_, pMeshPtr_()));
|
||||
}
|
||||
|
||||
// interpolator for this field
|
||||
return interpolation<Type>::New
|
||||
(
|
||||
interpolationScheme_,
|
||||
pInterpPtr_(),
|
||||
vField
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::sampledSurfaces::sampleAndWrite
|
||||
(
|
||||
@ -106,7 +82,11 @@ void Foam::sampledSurfaces::sampleAndWrite
|
||||
{
|
||||
if (!interpolator.valid())
|
||||
{
|
||||
interpolator = setInterpolator(vField);
|
||||
interpolator = interpolation<Type>::New
|
||||
(
|
||||
interpolationScheme_,
|
||||
vField
|
||||
);
|
||||
}
|
||||
|
||||
values = s.interpolate(interpolator());
|
||||
|
@ -57,6 +57,10 @@ functions
|
||||
// Type of functionObject
|
||||
type probes;
|
||||
|
||||
// Output every
|
||||
outputControl timeStep;
|
||||
outputInterval 1;
|
||||
|
||||
// Name of the directory for the probe data
|
||||
name probes;
|
||||
|
||||
@ -82,8 +86,9 @@ functions
|
||||
// Where to load it from (if not already in solver)
|
||||
functionObjectLibs ("libsampling.so");
|
||||
|
||||
// Output every 10th time step
|
||||
interval 10;
|
||||
// Output every
|
||||
outputControl timeStep;
|
||||
outputInterval 10;
|
||||
|
||||
surfaceFormat raw;
|
||||
|
||||
|
@ -57,6 +57,10 @@ functions
|
||||
// Type of functionObject
|
||||
type probes;
|
||||
|
||||
// Output every 10th time step
|
||||
outputControl timeStep;
|
||||
outputInterval 10;
|
||||
|
||||
// Name of the directory for the probe data
|
||||
name probes;
|
||||
|
||||
@ -82,8 +86,9 @@ functions
|
||||
// Where to load it from (if not already in solver)
|
||||
functionObjectLibs ("libsampling.so");
|
||||
|
||||
// Output every 10th time step
|
||||
interval 10;
|
||||
// Output every 10th time step
|
||||
outputControl timeStep;
|
||||
outputInterval 10;
|
||||
|
||||
surfaceFormat raw;
|
||||
|
||||
|
@ -57,6 +57,10 @@ functions
|
||||
// Type of functionObject
|
||||
type probes;
|
||||
|
||||
// Output every
|
||||
outputControl timeStep;
|
||||
outputInterval 1;
|
||||
|
||||
// Name of the directory for the probe data
|
||||
name probes;
|
||||
|
||||
@ -83,8 +87,9 @@ functions
|
||||
// Where to load it from (if not already in solver)
|
||||
functionObjectLibs ("libsampling.so");
|
||||
|
||||
// Output every 10th time step
|
||||
interval 10;
|
||||
// Output every 10th time step
|
||||
outputControl timeStep;
|
||||
outputInterval 10;
|
||||
|
||||
surfaceFormat raw;
|
||||
|
||||
|
@ -57,6 +57,10 @@ functions
|
||||
// Type of functionObject
|
||||
type probes;
|
||||
|
||||
// Output every
|
||||
outputControl timeStep;
|
||||
outputInterval 1;
|
||||
|
||||
// Name of the directory for the probe data
|
||||
name probes;
|
||||
|
||||
@ -83,8 +87,9 @@ functions
|
||||
// Where to load it from (if not already in solver)
|
||||
functionObjectLibs ("libsampling.so");
|
||||
|
||||
// Output every 10th time step
|
||||
interval 10;
|
||||
// Output every 10th time step
|
||||
outputControl timeStep;
|
||||
outputInterval 10;
|
||||
|
||||
surfaceFormat raw;
|
||||
|
||||
|
@ -57,6 +57,10 @@ functions
|
||||
// Type of functionObject
|
||||
type probes;
|
||||
|
||||
// Output every
|
||||
outputControl timeStep;
|
||||
outputInterval 1;
|
||||
|
||||
// Name of the directory for the probe data
|
||||
name probes;
|
||||
|
||||
@ -83,8 +87,9 @@ functions
|
||||
// Where to load it from (if not already in solver)
|
||||
functionObjectLibs ("libsampling.so");
|
||||
|
||||
// Output every 10th time step
|
||||
interval 10;
|
||||
// Output every 10th time step
|
||||
outputControl timeStep;
|
||||
outputInterval 10;
|
||||
|
||||
surfaceFormat raw;
|
||||
|
||||
|
@ -57,14 +57,10 @@
|
||||
volScalarField DpDt =
|
||||
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
||||
|
||||
pointMesh pMesh(mesh);
|
||||
volPointInterpolation vpi(mesh, pMesh);
|
||||
|
||||
Info<< "Constructing thermoCloud1" << endl;
|
||||
basicThermoCloud thermoCloud1
|
||||
(
|
||||
"thermoCloud1",
|
||||
vpi,
|
||||
rho,
|
||||
U,
|
||||
g,
|
||||
@ -75,7 +71,6 @@
|
||||
basicKinematicCloud kinematicCloud1
|
||||
(
|
||||
"kinematicCloud1",
|
||||
vpi,
|
||||
rho,
|
||||
U,
|
||||
thermo().mu(),
|
||||
|
Loading…
Reference in New Issue
Block a user