diff --git a/applications/solvers/Lagrangian/kinematicParcelFoam/createFields.H b/applications/solvers/Lagrangian/kinematicParcelFoam/createFields.H index 6b87262133..c5a992817f 100644 --- a/applications/solvers/Lagrangian/kinematicParcelFoam/createFields.H +++ b/applications/solvers/Lagrangian/kinematicParcelFoam/createFields.H @@ -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(), diff --git a/applications/solvers/combustion/dieselEngineFoam/createSpray.H b/applications/solvers/combustion/dieselEngineFoam/createSpray.H index c5bc0d88cf..b86b3684c2 100644 --- a/applications/solvers/combustion/dieselEngineFoam/createSpray.H +++ b/applications/solvers/combustion/dieselEngineFoam/createSpray.H @@ -1,8 +1,5 @@ Info << "Constructing Spray" << endl; -pointMesh pMesh(mesh); -volPointInterpolation vpi(mesh, pMesh); - PtrList gasProperties(Y.size()); forAll(gasProperties, i) { @@ -18,7 +15,6 @@ forAll(gasProperties, i) spray dieselSpray ( - vpi, U, rho, p, diff --git a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C index b6cfb46d92..f579825384 100644 --- a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C +++ b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C @@ -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::New(mesh) + ).updateMesh(); dieselSpray.evolve(); diff --git a/applications/utilities/mesh/manipulation/deformedGeom/deformedGeom.C b/applications/utilities/mesh/manipulation/deformedGeom/deformedGeom.C index 3246c1d335..06586f4a8f 100644 --- a/applications/utilities/mesh/manipulation/deformedGeom/deformedGeom.C +++ b/applications/utilities/mesh/manipulation/deformedGeom/deformedGeom.C @@ -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(); diff --git a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/foamToFieldview9.C b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/foamToFieldview9.C index 7cf137cd0e..62a68eda69 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/foamToFieldview9.C +++ b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/foamToFieldview9.C @@ -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); diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C index 96b13cad71..a9c7edadfb 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C @@ -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); diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/vtkMesh.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/vtkMesh.C index f650dab04c..51f4951906 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/vtkMesh.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/vtkMesh.C @@ -70,7 +70,6 @@ Foam::polyMesh::readUpdateState Foam::vtkMesh::readUpdate() // the subset even if only movement. topoPtr_.clear(); - pointMeshPtr_.clear(); if (setName_.size() > 0) { diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/vtkMesh.H b/applications/utilities/postProcessing/dataConversion/foamToVTK/vtkMesh.H index 315a36561b..b0533dcc86 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/vtkMesh.H +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/vtkMesh.H @@ -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 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(); } diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C index 4f320c802c..94f98d8f25 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C @@ -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 > ppInterpList(mesh.boundaryMesh().size()); diff --git a/etc/settings.csh b/etc/settings.csh index 69dc7d2a7e..0a38b78f6a 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -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 # ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/OpenFOAM/db/objectRegistry/objectRegistry.C b/src/OpenFOAM/db/objectRegistry/objectRegistry.C index dbbf8a82e5..df9da24055 100644 --- a/src/OpenFOAM/db/objectRegistry/objectRegistry.C +++ b/src/OpenFOAM/db/objectRegistry/objectRegistry.C @@ -177,12 +177,16 @@ bool Foam::objectRegistry::checkOut(regIOobject& io) const } else { + regIOobject* object = iter(); + + bool hasErased = const_cast(*this).erase(iter); + if (io.ownedByRegistry()) { - delete iter(); + delete object; } - return const_cast(*this).erase(iter); + return hasErased; } } else diff --git a/src/OpenFOAM/meshes/MeshObject/MeshObject.C b/src/OpenFOAM/meshes/MeshObject/MeshObject.C index 155e01f6f0..340df29e67 100644 --- a/src/OpenFOAM/meshes/MeshObject/MeshObject.C +++ b/src/OpenFOAM/meshes/MeshObject/MeshObject.C @@ -148,6 +148,29 @@ const Type& Foam::MeshObject::New // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // +template +bool Foam::MeshObject::Delete(const Mesh& mesh) +{ + if (mesh.db().objectRegistry::foundObject(Type::typeName)) + { + return mesh.db().objectRegistry::checkOut + ( + const_cast + ( + mesh.db().objectRegistry::lookupObject + ( + Type::typeName + ) + ) + ); + } + else + { + return false; + } +} + + template Foam::MeshObject::~MeshObject() { diff --git a/src/OpenFOAM/meshes/MeshObject/MeshObject.H b/src/OpenFOAM/meshes/MeshObject/MeshObject.H index e472ad6adf..3bf11b5f6a 100644 --- a/src/OpenFOAM/meshes/MeshObject/MeshObject.H +++ b/src/OpenFOAM/meshes/MeshObject/MeshObject.H @@ -106,6 +106,8 @@ public: // Destructor + static bool Delete(const Mesh& mesh); + virtual ~MeshObject(); diff --git a/src/OpenFOAM/meshes/pointMesh/pointMesh.C b/src/OpenFOAM/meshes/pointMesh/pointMesh.C index c17993109d..bbafbad0e7 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMesh.C +++ b/src/OpenFOAM/meshes/pointMesh/pointMesh.C @@ -62,11 +62,16 @@ Foam::pointMesh::pointMesh bool alwaysConstructGlobalPatch ) : + MeshObject(pMesh), GeoMesh(pMesh), boundary_(*this, pMesh.boundaryMesh()) { // Add the globalPointPatch if there are global points - if (alwaysConstructGlobalPatch || mesh_.globalData().nGlobalPoints()) + if + ( + alwaysConstructGlobalPatch + || GeoMesh::mesh_.globalData().nGlobalPoints() + ) { boundary_.setSize(boundary_.size() + 1); diff --git a/src/OpenFOAM/meshes/pointMesh/pointMesh.H b/src/OpenFOAM/meshes/pointMesh/pointMesh.H index e760ab3cab..093fc06255 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMesh.H +++ b/src/OpenFOAM/meshes/pointMesh/pointMesh.H @@ -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, public GeoMesh { // Permanent data @@ -95,7 +97,7 @@ public: //- Return number of points static label size(const Mesh& mesh) { - return mesh.mesh_.nPoints(); + return mesh.GeoMesh::mesh_.nPoints(); } //- Return reference to boundary mesh @@ -107,7 +109,13 @@ public: //- Return parallel info const globalMeshData& globalData() const { - return mesh_.globalData(); + return GeoMesh::mesh_.globalData(); + } + + //- Return database (only needed for compilation purposes) + const objectRegistry& db() const + { + return GeoMesh::mesh_.db(); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index a17c9b6f69..31ff85bf2c 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -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::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::typeName + ) + ) + { + const_cast + ( + db().objectRegistry::lookupObject + ( + pointMesh::typeName + ) + ).movePoints(points_); + } + return sweptVols; } diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C b/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C index 7ac30ce8a8..ae5ab8b761 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C @@ -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); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C b/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C index 5e1d1cadeb..9b53965e2a 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C @@ -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::typeName + ) + ) + { + const_cast + ( + db().objectRegistry::lookupObject + ( + pointMesh::typeName + ) + ).updateMesh(mpm); + } } diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C index c07b950d0a..de6ee7c894 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C @@ -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" diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index 7caa1af11e..71707195f3 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -3082,7 +3082,7 @@ void Foam::autoLayerDriver::doLayers Info<< "Constructing mesh displacer ..." << endl; { - pointMesh pMesh(mesh); + const pointMesh& pMesh = pointMesh::New(mesh); motionSmoother meshMover ( diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C index 8c41371ddc..c21c44f8d5 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriverShrink.C @@ -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 edgeWallDist(mesh.nEdges()); PointEdgeWave wallDistCalc ( - pMesh, + mesh, meshPoints, wallInfo, pointWallDist, @@ -892,7 +891,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo // Do all calculations PointEdgeWave 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 wallDistCalc ( - pMesh, + mesh, wallPoints, wallInfo, pointWallDist, diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C index bd0825217a..3a6c79987c 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C @@ -527,7 +527,7 @@ Foam::tmp Foam::autoSnapDriver::edgePatchDist PointEdgeWave 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 ( diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C index 626fb2fe25..93e37f1932 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C @@ -1992,7 +1992,7 @@ void Foam::meshRefinement::dumpRefinementLevel() const volRefLevel.write(); - pointMesh pMesh(mesh_); + const pointMesh& pMesh = pointMesh::New(mesh_); pointScalarField pointRefLevel ( diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index 5762d4619a..8021b09f55 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -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::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::typeName + ) + ) + { + const_cast + ( + db().objectRegistry::lookupObject + ( + volPointInterpolation::typeName + ) + ).movePoints(); + } + + // extendedLeastSquaresVectors + if + ( + db().objectRegistry::foundObject + ( + extendedLeastSquaresVectors::typeName + ) + ) + { + const_cast + ( + db().objectRegistry::lookupObject + ( + extendedLeastSquaresVectors::typeName + ) + ).movePoints(); + } + + // leastSquaresVectors + if + ( + db().objectRegistry::foundObject + ( + leastSquaresVectors::typeName + ) + ) + { + const_cast + ( + db().objectRegistry::lookupObject + ( + leastSquaresVectors::typeName + ) + ).movePoints(); + } + + //// linearFitData + //if + //( + // db().objectRegistry::foundObject + // ( + // linearFitData::typeName + // ) + //) + //{ + // const_cast + // ( + // db().objectRegistry::lookupObject + // ( + // linearFitData::typeName + // ) + // ).movePoints(); + //} + + // quadraticFitData + if + ( + db().objectRegistry::foundObject + ( + quadraticFitData::typeName + ) + ) + { + const_cast + ( + db().objectRegistry::lookupObject + ( + quadraticFitData::typeName + ) + ).movePoints(); + } + + //// quadraticFitSnGradData + //if + //( + // db().objectRegistry::foundObject + // ( + // quadraticFitSnGradData::typeName + // ) + //) + //{ + // const_cast + // ( + // db().objectRegistry::lookupObject + // ( + // quadraticFitSnGradData::typeName + // ) + // ).movePoints(); + //} + + // skewCorrectionVectors + if + ( + db().objectRegistry::foundObject + ( + skewCorrectionVectors::typeName + ) + ) + { + const_cast + ( + db().objectRegistry::lookupObject + ( + skewCorrectionVectors::typeName + ) + ).movePoints(); + } + + return tsweptVols; } diff --git a/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.C b/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.C index 2351ab9f8b..2a703ba462 100644 --- a/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.C +++ b/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.C @@ -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 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(); diff --git a/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.H b/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.H index 11c1af1bc9..3fbc20d9f8 100644 --- a/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.H +++ b/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.H @@ -171,8 +171,6 @@ private: //- Subset mesh pointer autoPtr fvMeshSubsetPtr_; - mutable autoPtr 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; diff --git a/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubsetInterpolate.C b/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubsetInterpolate.C index ea3fdccbcf..1afa83f9d0 100644 --- a/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubsetInterpolate.C +++ b/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubsetInterpolate.C @@ -409,7 +409,7 @@ tmp > 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() diff --git a/src/finiteVolume/interpolation/interpolation/interpolation/interpolation.H b/src/finiteVolume/interpolation/interpolation/interpolation/interpolation.H index 2a37087a48..d9893d0e82 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolation/interpolation.H +++ b/src/finiteVolume/interpolation/interpolation/interpolation/interpolation.H @@ -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& psi ), - (pInterp, psi) + (psi) ); @@ -96,7 +94,6 @@ public: static autoPtr > New ( const word& interpolationType, - const volPointInterpolation& pInterp, const GeometricField& psi ); @@ -104,7 +101,6 @@ public: static autoPtr > New ( const dictionary& interpolationSchemes, - const volPointInterpolation& pInterp, const GeometricField& psi ); diff --git a/src/finiteVolume/interpolation/interpolation/interpolation/newInterpolation.C b/src/finiteVolume/interpolation/interpolation/interpolation/newInterpolation.C index a908b61f19..9cb13f8c71 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolation/newInterpolation.C +++ b/src/finiteVolume/interpolation/interpolation/interpolation/newInterpolation.C @@ -34,7 +34,6 @@ Foam::autoPtr > Foam::interpolation::New ( const word& interpolationType, - const volPointInterpolation& pInterp, const GeometricField& psi ) { @@ -55,7 +54,7 @@ Foam::interpolation::New << exit(FatalError); } - return autoPtr >(cstrIter()(pInterp, psi)); + return autoPtr >(cstrIter()(psi)); } @@ -64,11 +63,10 @@ Foam::autoPtr > Foam::interpolation::New ( const dictionary& interpolationSchemes, - const volPointInterpolation& pInterp, const GeometricField& psi ) { - return New(word(interpolationSchemes.lookup(psi.name())), pInterp, psi); + return New(word(interpolationSchemes.lookup(psi.name())), psi); } diff --git a/src/finiteVolume/interpolation/interpolation/interpolationCell/interpolationCell.C b/src/finiteVolume/interpolation/interpolation/interpolationCell/interpolationCell.C index c99ffcaf9d..6d634db810 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolationCell/interpolationCell.C +++ b/src/finiteVolume/interpolation/interpolation/interpolationCell/interpolationCell.C @@ -39,7 +39,6 @@ namespace Foam template interpolationCell::interpolationCell ( - const volPointInterpolation&, const GeometricField& psi ) : diff --git a/src/finiteVolume/interpolation/interpolation/interpolationCell/interpolationCell.H b/src/finiteVolume/interpolation/interpolation/interpolationCell/interpolationCell.H index dac33efbbf..44e6fc8c6f 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolationCell/interpolationCell.H +++ b/src/finiteVolume/interpolation/interpolation/interpolationCell/interpolationCell.H @@ -63,7 +63,6 @@ public: //- Construct from components interpolationCell ( - const volPointInterpolation& pInterp, const GeometricField& psi ); diff --git a/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/interpolationCellPoint.C b/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/interpolationCellPoint.C index 0701737ffa..7b837feb20 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/interpolationCellPoint.C +++ b/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/interpolationCellPoint.C @@ -32,12 +32,11 @@ License template Foam::interpolationCellPoint::interpolationCellPoint ( - const volPointInterpolation& pInterp, const GeometricField& psi ) : interpolation(psi), - psip_(pInterp.interpolate(psi)) + psip_(volPointInterpolation::New(psi.mesh()).interpolate(psi)) {} diff --git a/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/interpolationCellPoint.H b/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/interpolationCellPoint.H index c29bad38da..6ba0be2c46 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/interpolationCellPoint.H +++ b/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/interpolationCellPoint.H @@ -52,7 +52,8 @@ class interpolationCellPoint { // Private data - GeometricField psip_; + //- Interpolated volfield + const GeometricField psip_; public: @@ -66,7 +67,6 @@ public: //- Construct from components interpolationCellPoint ( - const volPointInterpolation& pInterp, const GeometricField& psi ); diff --git a/src/finiteVolume/interpolation/interpolation/interpolationCellPointFace/interpolationCellPointFace.C b/src/finiteVolume/interpolation/interpolation/interpolationCellPointFace/interpolationCellPointFace.C index 4c398155bb..0ffc3efe4c 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolationCellPointFace/interpolationCellPointFace.C +++ b/src/finiteVolume/interpolation/interpolation/interpolationCellPointFace/interpolationCellPointFace.C @@ -44,12 +44,11 @@ namespace Foam template interpolationCellPointFace::interpolationCellPointFace ( - const volPointInterpolation& pInterp, const GeometricField& psi ) : interpolation(psi), - psip_(pInterp.interpolate(psi)), + psip_(volPointInterpolation::New(psi.mesh()).interpolate(psi)), psis_(linearInterpolate(psi)) {} diff --git a/src/finiteVolume/interpolation/interpolation/interpolationCellPointFace/interpolationCellPointFace.H b/src/finiteVolume/interpolation/interpolation/interpolationCellPointFace/interpolationCellPointFace.H index 02bb34d7a2..fc1378a3a9 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolationCellPointFace/interpolationCellPointFace.H +++ b/src/finiteVolume/interpolation/interpolation/interpolationCellPointFace/interpolationCellPointFace.H @@ -51,8 +51,11 @@ class interpolationCellPointFace { // Private data - GeometricField psip_; - GeometricField psis_; + //- Interpolated volfield + const GeometricField psip_; + + //- Linearly interpolated volfield + const GeometricField psis_; bool findTet ( @@ -87,7 +90,6 @@ public: //- Construct from components interpolationCellPointFace ( - const volPointInterpolation& pInterp, const GeometricField& psi ); diff --git a/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolate.C b/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolate.C index e81791e9f1..01af2cc5ec 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolate.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolate.C @@ -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) { diff --git a/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.C b/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.C index 82e2bfc899..f823b2c7b2 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.C @@ -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(); } diff --git a/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.H b/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.H index 5f84902662..042c608e23 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.H +++ b/src/finiteVolume/interpolation/volPointInterpolation/pointPatchInterpolation/pointPatchInterpolation.H @@ -61,7 +61,6 @@ class pointPatchInterpolation // Private data const fvMesh& fvMesh_; - const pointMesh& pointMesh_; //- Primitive patch interpolators PtrList 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 diff --git a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C index 048f7697e8..8175242a03 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C @@ -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 ( - 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 @@ -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() ) ); diff --git a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C index 64f0e24b38..be773374ae 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C @@ -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(vm), + boundaryInterpolator_(vm) { updateMesh(); } diff --git a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.H b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.H index 2072adf559..7679868552 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.H +++ b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.H @@ -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 { // 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 diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C index f445079809..ba8498bba0 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C @@ -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::displacementSBRStressFvMotionSolver::curPoints() const { - vpi_.interpolate(cellDisplacement_, pointDisplacement_); + volPointInterpolation::New(fvMesh_).interpolate + ( + cellDisplacement_, + pointDisplacement_ + ); tmp tcurPoints ( diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C index 3f6e85acba..0b676f19a1 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C @@ -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::displacementComponentLaplacianFvMotionSolver::curPoints() const { - vpi_.interpolate(cellDisplacement_, pointDisplacement_); + volPointInterpolation::New(fvMesh_).interpolate + ( + cellDisplacement_, + pointDisplacement_ + ); if (pointLocation_.valid()) { diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C index 7ad1d32712..dae6656380 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C @@ -334,7 +334,8 @@ displacementInterpolationFvMotionSolver // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::displacementInterpolationFvMotionSolver::~displacementInterpolationFvMotionSolver() +Foam::displacementInterpolationFvMotionSolver:: +~displacementInterpolationFvMotionSolver() {} diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C index 2437710385..02e5f3b5eb 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C @@ -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::displacementLaplacianFvMotionSolver::curPoints() const { - vpi_.interpolate(cellDisplacement_, pointDisplacement_); + volPointInterpolation::New(fvMesh_).interpolate + ( + cellDisplacement_, + pointDisplacement_ + ); if (pointLocation_.valid()) { diff --git a/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.C index 5c54c4f03c..e7a26d4b41 100644 --- a/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.C @@ -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(mesh)), - pointMesh_(fvMesh_), - vpi_(fvMesh_, pointMesh_) + fvMesh_(refCast(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 } diff --git a/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.H b/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.H index c91a3ca65e..ae5e744b70 100644 --- a/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.H +++ b/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.H @@ -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 diff --git a/src/fvMotionSolver/fvMotionSolvers/velocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/velocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C index 86d5c1e32b..2cefbdec25 100644 --- a/src/fvMotionSolver/fvMotionSolvers/velocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/velocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C @@ -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::velocityComponentLaplacianFvMotionSolver::curPoints() const { - vpi_.interpolate(cellMotionU_, pointMotionU_); + volPointInterpolation::New(fvMesh_).interpolate + ( + cellMotionU_, + pointMotionU_ + ); tmp tcurPoints(new pointField(fvMesh_.points())); diff --git a/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C index f259a097ca..50a06de548 100644 --- a/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C @@ -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::velocityLaplacianFvMotionSolver::curPoints() const { - vpi_.interpolate(cellMotionU_, pointMotionU_); + volPointInterpolation::New(fvMesh_).interpolate + ( + cellMotionU_, + pointMotionU_ + ); tmp tcurPoints ( diff --git a/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C index 9767dabc42..5859c4d356 100644 --- a/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C @@ -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 waveInfo ( - pMesh, + mesh, seedPoints, seedInfo, diff --git a/src/lagrangian/basic/Cloud/Cloud.H b/src/lagrangian/basic/Cloud/Cloud.H index 270a30ce7b..0dc41403e7 100644 --- a/src/lagrangian/basic/Cloud/Cloud.H +++ b/src/lagrangian/basic/Cloud/Cloud.H @@ -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 void checkFieldIOobject ( @@ -240,13 +245,6 @@ public: const IOField& data ) const; - //- Read and return a lagrangian data field - IOobject fieldIOobject(const word& fieldName) const; - - //- Read and return a lagrangian data field - template - tmp > readField(const word& fieldName) const; - //- Read the field data for the cloud of particles void readFields(); diff --git a/src/lagrangian/basic/Cloud/CloudIO.C b/src/lagrangian/basic/Cloud/CloudIO.C index 0401955801..d9247527d3 100644 --- a/src/lagrangian/basic/Cloud/CloudIO.C +++ b/src/lagrangian/basic/Cloud/CloudIO.C @@ -103,6 +103,25 @@ Foam::Cloud::Cloud // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +Foam::IOobject Foam::Cloud::fieldIOobject +( + const word& fieldName, + const IOobject::readOption r +) const +{ + return IOobject + ( + fieldName, + time().timeName(), + *this, + r, + IOobject::NO_WRITE, + false + ); +} + + template template void Foam::Cloud::checkFieldIOobject @@ -116,7 +135,7 @@ void Foam::Cloud::checkFieldIOobject FatalErrorIn ( "void Cloud::checkFieldIOobject" - "(Cloud, IOField)" + "(const Cloud&, const IOField&) const" ) << "Size of " << data.name() << " field " << data.size() << " does not match the number of particles " << c.size() @@ -125,35 +144,6 @@ void Foam::Cloud::checkFieldIOobject } -template -Foam::IOobject Foam::Cloud::fieldIOobject -( - const word& fieldName -) const -{ - return IOobject - ( - fieldName, - time().timeName(), - *this, - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ); -} - - -template -template -Foam::tmp > Foam::Cloud::readField -( - const word& fieldName -) const -{ - return tmp >(new IOField(fieldIOobject(fieldName))); -} - - template void Foam::Cloud::readFields() {} diff --git a/src/lagrangian/dieselSpray/parcel/parcelIO.C b/src/lagrangian/dieselSpray/parcel/parcelIO.C index cbc432eb31..5f31f40212 100644 --- a/src/lagrangian/dieselSpray/parcel/parcelIO.C +++ b/src/lagrangian/dieselSpray/parcel/parcelIO.C @@ -106,43 +106,46 @@ void Foam::parcel::readFields return; } - IOField d(c.fieldIOobject("d")); + IOField d(c.fieldIOobject("d", IOobject::MUST_READ)); c.checkFieldIOobject(c, d); - IOField T(c.fieldIOobject("T")); + IOField T(c.fieldIOobject("T", IOobject::MUST_READ)); c.checkFieldIOobject(c, T); - IOField m(c.fieldIOobject("m")); + IOField m(c.fieldIOobject("m", IOobject::MUST_READ)); c.checkFieldIOobject(c, m); - IOField y(c.fieldIOobject("y")); + IOField y(c.fieldIOobject("y", IOobject::MUST_READ)); c.checkFieldIOobject(c, y); - IOField yDot(c.fieldIOobject("yDot")); + IOField yDot(c.fieldIOobject("yDot", IOobject::MUST_READ)); c.checkFieldIOobject(c, yDot); - IOField ct(c.fieldIOobject("ct")); + IOField ct(c.fieldIOobject("ct", IOobject::MUST_READ)); c.checkFieldIOobject(c, ct); - IOField ms(c.fieldIOobject("ms")); + IOField ms(c.fieldIOobject("ms", IOobject::MUST_READ)); c.checkFieldIOobject(c, ms); - IOField tTurb(c.fieldIOobject("tTurb")); + IOField tTurb(c.fieldIOobject("tTurb", IOobject::MUST_READ)); c.checkFieldIOobject(c, tTurb); - IOField liquidCore(c.fieldIOobject("liquidCore")); + IOField liquidCore + ( + c.fieldIOobject("liquidCore", IOobject::MUST_READ) + ); c.checkFieldIOobject(c, liquidCore); - IOField injector(c.fieldIOobject("injector")); + IOField injector(c.fieldIOobject("injector", IOobject::MUST_READ)); c.checkFieldIOobject(c, injector); - IOField U(c.fieldIOobject("U")); + IOField U(c.fieldIOobject("U", IOobject::MUST_READ)); c.checkFieldIOobject(c, U); - IOField Uturb(c.fieldIOobject("Uturb")); + IOField Uturb(c.fieldIOobject("Uturb", IOobject::MUST_READ)); c.checkFieldIOobject(c, Uturb); - IOField n(c.fieldIOobject("n")); + IOField 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 X(c.fieldIOobject(names[j])); + IOField X(c.fieldIOobject(names[j], IOobject::MUST_READ)); label i = 0; forAllIter(Cloud, c, iter) @@ -201,20 +204,27 @@ void Foam::parcel::writeFields label np = c.size(); - IOField d(c.fieldIOobject("d"), np); - IOField T(c.fieldIOobject("T"), np); - IOField m(c.fieldIOobject("m"), np); - IOField y(c.fieldIOobject("y"), np); - IOField yDot(c.fieldIOobject("yDot"), np); - IOField ct(c.fieldIOobject("ct"), np); - IOField ms(c.fieldIOobject("ms"), np); - IOField tTurb(c.fieldIOobject("tTurb"), np); - IOField liquidCore(c.fieldIOobject("liquidCore"), np); - IOField injector(c.fieldIOobject("injector"), np); - - IOField U(c.fieldIOobject("U"), np); - IOField Uturb(c.fieldIOobject("Uturb"), np); - IOField n(c.fieldIOobject("n"), np); + IOField d(c.fieldIOobject("d", IOobject::NO_READ), np); + IOField T(c.fieldIOobject("T", IOobject::NO_READ), np); + IOField m(c.fieldIOobject("m", IOobject::NO_READ), np); + IOField y(c.fieldIOobject("y", IOobject::NO_READ), np); + IOField yDot(c.fieldIOobject("yDot", IOobject::NO_READ), np); + IOField ct(c.fieldIOobject("ct", IOobject::NO_READ), np); + IOField ms(c.fieldIOobject("ms", IOobject::NO_READ), np); + IOField tTurb(c.fieldIOobject("tTurb", IOobject::NO_READ), np); + IOField liquidCore + ( + c.fieldIOobject("liquidCore", IOobject::NO_READ), + np + ); + IOField injector + ( + c.fieldIOobject("injector", IOobject::NO_READ), + np + ); + IOField U(c.fieldIOobject("U", IOobject::NO_READ), np); + IOField Uturb(c.fieldIOobject("Uturb", IOobject::NO_READ), np); + IOField n(c.fieldIOobject("n", IOobject::NO_READ), np); label i = 0; forAllConstIter(Cloud, c, iter) @@ -265,7 +275,7 @@ void Foam::parcel::writeFields for (label j=0; j X(c.fieldIOobject(names[j]), np); + IOField X(c.fieldIOobject(names[j], IOobject::NO_READ), np); label i = 0; forAllConstIter(Cloud, c, iter) diff --git a/src/lagrangian/dieselSpray/spray/spray.C b/src/lagrangian/dieselSpray/spray/spray.C index fb9e16bc9b..4aa5c775ef 100644 --- a/src/lagrangian/dieselSpray/spray/spray.C +++ b/src/lagrangian/dieselSpray/spray/spray.C @@ -52,7 +52,6 @@ defineTemplateTypeNameAndDebug(IOPtrList, 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& gaseousFuelProperties, " diff --git a/src/lagrangian/dieselSpray/spray/spray.H b/src/lagrangian/dieselSpray/spray/spray.H index 83c93c16f0..603d0c8b68 100644 --- a/src/lagrangian/dieselSpray/spray/spray.H +++ b/src/lagrangian/dieselSpray/spray/spray.H @@ -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, diff --git a/src/lagrangian/dieselSpray/spray/sprayOps.C b/src/lagrangian/dieselSpray/spray/sprayOps.C index 048080ae0c..58199f3c72 100644 --- a/src/lagrangian/dieselSpray/spray/sprayOps.C +++ b/src/lagrangian/dieselSpray/spray/sprayOps.C @@ -49,33 +49,13 @@ void spray::evolve() srhos_[i].setSize(rho_.size()); } - UInterpolator_ = interpolation::New - ( - interpolationSchemes_, - volPointInterpolation_, - U_ - ); + UInterpolator_ = interpolation::New(interpolationSchemes_, U_); - rhoInterpolator_ = interpolation::New - ( - interpolationSchemes_, - volPointInterpolation_, - rho_ - ); + rhoInterpolator_ = interpolation::New(interpolationSchemes_, rho_); - pInterpolator_ = interpolation::New - ( - interpolationSchemes_, - volPointInterpolation_, - p_ - ); + pInterpolator_ = interpolation::New(interpolationSchemes_, p_); - TInterpolator_ = interpolation::New - ( - interpolationSchemes_, - volPointInterpolation_, - T_ - ); + TInterpolator_ = interpolation::New(interpolationSchemes_, T_); calculateAmbientPressure(); calculateAmbientTemperature(); diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C index 6ee04f1235..dc32224a00 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C @@ -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 Foam::KinematicCloud::KinematicCloud ( const word& cloudType, - const volPointInterpolation& vpi, const volScalarField& rho, const volVectorField& U, const volScalarField& mu, @@ -153,7 +151,6 @@ Foam::KinematicCloud::KinematicCloud kinematicCloud(), cloudType_(cloudType), mesh_(rho.mesh()), - vpi_(vpi), particleProperties_ ( IOobject @@ -267,7 +264,7 @@ Foam::KinematicCloud::KinematicCloud FatalErrorIn ( "Foam::KinematicCloud::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::evolve() interpolation::New ( interpolationSchemes_, - vpi_, rho_ ); @@ -308,7 +304,6 @@ void Foam::KinematicCloud::evolve() interpolation::New ( interpolationSchemes_, - vpi_, U_ ); @@ -316,7 +311,6 @@ void Foam::KinematicCloud::evolve() interpolation::New ( interpolationSchemes_, - vpi_, mu_ ); diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index da0f1738e5..ebd298c44e 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -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; diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H index c7196c57cd..73a891dcb3 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H @@ -47,14 +47,6 @@ inline const Foam::fvMesh& Foam::KinematicCloud::mesh() const } -template -inline const Foam::volPointInterpolation& -Foam::KinematicCloud::vpi() const -{ - return vpi_; -} - - template inline const Foam::IOdictionary& Foam::KinematicCloud::particleProperties() const diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C index ffef30b10d..1f358d6f6c 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C @@ -29,15 +29,12 @@ License #include "MassTransferModel.H" #include "SurfaceReactionModel.H" -#include "interpolationCellPoint.H" - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template Foam::ReactingCloud::ReactingCloud ( const word& cloudType, - const volPointInterpolation& vpi, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, @@ -45,7 +42,7 @@ Foam::ReactingCloud::ReactingCloud PtrList& gases ) : - ThermoCloud(cloudType, vpi, rho, U, g, thermo), + ThermoCloud(cloudType, rho, U, g, thermo), reactingCloud(), constProps_(this->particleProperties()), carrierThermo_(thermo), @@ -131,42 +128,36 @@ void Foam::ReactingCloud::evolve() autoPtr > rhoInterpolator = interpolation::New ( this->interpolationSchemes(), - this->vpi(), this->rho() ); autoPtr > UInterpolator = interpolation::New ( this->interpolationSchemes(), - this->vpi(), this->U() ); autoPtr > muInterpolator = interpolation::New ( this->interpolationSchemes(), - this->vpi(), this->mu() ); autoPtr > TInterpolator = interpolation::New ( this->interpolationSchemes(), - this->vpi(), T ); autoPtr > cpInterpolator = interpolation::New ( this->interpolationSchemes(), - this->vpi(), cp ); autoPtr > pInterpolator = interpolation::New ( this->interpolationSchemes(), - this->vpi(), p ); diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H index 6f7bb05e09..d1c60f5a97 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H @@ -133,7 +133,6 @@ public: ReactingCloud ( const word& cloudType, - const volPointInterpolation& vpi, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C index ad0d520b74..c585d22fd3 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C @@ -36,7 +36,6 @@ template Foam::ThermoCloud::ThermoCloud ( const word& cloudType, - const volPointInterpolation& vpi, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, @@ -46,7 +45,6 @@ Foam::ThermoCloud::ThermoCloud KinematicCloud ( cloudType, - vpi, rho, U, thermo.mu(), @@ -130,35 +128,30 @@ void Foam::ThermoCloud::evolve() autoPtr > rhoInterpolator = interpolation::New ( this->interpolationSchemes(), - this->vpi(), this->rho() ); autoPtr > UInterpolator = interpolation::New ( this->interpolationSchemes(), - this->vpi(), this->U() ); autoPtr > muInterpolator = interpolation::New ( this->interpolationSchemes(), - this->vpi(), this->mu() ); autoPtr > TInterpolator = interpolation::New ( this->interpolationSchemes(), - this->vpi(), T ); autoPtr > cpInterpolator = interpolation::New ( this->interpolationSchemes(), - this->vpi(), cp ); diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H index 072c86165b..ba7930af30 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H @@ -135,7 +135,6 @@ public: ThermoCloud ( const word& cloudType, - const volPointInterpolation& vpi, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, diff --git a/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.C b/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.C index 587edfda5a..a7d2d126be 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.C +++ b/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.C @@ -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(cloudType, vpi, rho, U, mu, g) + KinematicCloud(cloudType, rho, U, mu, g) { basicKinematicParcel::readFields(*this); } diff --git a/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H b/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H index a2b0c1663c..1ab9ac4ef6 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H @@ -74,7 +74,6 @@ public: basicKinematicCloud ( const word& cloudType, - const volPointInterpolation& vpi, const volScalarField& rho, const volVectorField& U, const volScalarField& mu, diff --git a/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.C b/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.C index ed95352309..708b428542 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.C +++ b/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.C @@ -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 ( cloudType, - vpi, rho, U, g, diff --git a/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.H b/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.H index fe608d19c5..c547c783a9 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.H @@ -73,7 +73,6 @@ public: basicReactingCloud ( const word& cloudType, - const volPointInterpolation& vpi, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, diff --git a/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.C b/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.C index 118da0a00e..eb2450c724 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.C +++ b/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.C @@ -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(cloudType, vpi, rho, U, g, thermo) + ThermoCloud(cloudType, rho, U, g, thermo) { basicThermoParcel::readFields(*this); } diff --git a/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H b/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H index ba5f776c76..81f3c26302 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H @@ -76,7 +76,6 @@ public: basicThermoCloud ( const word& cloudType, - const volPointInterpolation& vpi, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C index b000ed0237..c51524bc97 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C @@ -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::readFields return; } - IOField