From 592271921b7299c3ce565e6482ae1592bea9b75c Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 21 Jul 2011 14:00:17 +0100 Subject: [PATCH] ENH: polyMesh: remove support for read in cellCentres --- .../mesh/manipulation/checkMesh/checkMesh.C | 20 ------ src/OpenFOAM/meshes/polyMesh/polyMesh.C | 25 -------- .../meshes/primitiveMesh/primitiveMesh.H | 6 -- .../primitiveMeshCellCentresAndVols.C | 63 ------------------- 4 files changed, 114 deletions(-) diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C index 31e9b74a0f..1f40bc50a7 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C @@ -91,26 +91,6 @@ int main(int argc, char *argv[]) // Clear mesh before checking mesh.clearOut(); - pointIOField overrideCCs - ( - IOobject - ( - "cellCentres", - mesh.pointsInstance(), - polyMesh::meshSubDir, - runTime, - IOobject::READ_IF_PRESENT, - IOobject::NO_WRITE - ) - ); - - if (overrideCCs.headerOk()) - { - Info<< "Read " << overrideCCs.size() << " cell centres" << endl; - - mesh.overrideCellCentres(overrideCCs); - } - // Reconstruct globalMeshData mesh.globalData(); diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index b0573f00e0..1e08d994e3 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -295,31 +295,6 @@ Foam::polyMesh::polyMesh(const IOobject& io) neighbour_.write(); } - // Read cell centres if present - pointIOField cellCentres - ( - IOobject - ( - "cellCentres", - time().findInstance - ( - meshDir(), - "cellCentres", - IOobject::READ_IF_PRESENT - ), - meshSubDir, - *this, - IOobject::READ_IF_PRESENT, - IOobject::NO_WRITE - ) - ); - - if (cellCentres.headerOk()) - { - Pout<< "Reading cell centres" << endl; - overrideCellCentres(cellCentres); - } - // Calculate topology for the patches (processor-processor comms etc.) boundary_.updateMesh(); diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H index 138076b23f..65f2adb157 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.H @@ -496,12 +496,6 @@ public: const scalarField& cellVolumes() const; const vectorField& faceAreas() const; - // Override cell centres with supplied positions - void overrideCellCentres - ( - const vectorField& cellCtrs - ) const; - // Mesh motion diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCentresAndVols.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCentresAndVols.C index 9730c92578..c8785b544f 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCentresAndVols.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCentresAndVols.C @@ -28,7 +28,6 @@ Description \*---------------------------------------------------------------------------*/ #include "primitiveMesh.H" -#include "demandDrivenData.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -169,66 +168,4 @@ const Foam::scalarField& Foam::primitiveMesh::cellVolumes() const } -void Foam::primitiveMesh::overrideCellCentres -( - const vectorField& newCellCtrs -) const -{ - if (newCellCtrs.size() != nCells()) - { - FatalErrorIn - ( - "void Foam::primitiveMesh::overrideCellCentres" - "(" - "const vectorField& newCellCtrs" - ") const" - ) - << "Size of new cell centres for override " << newCellCtrs.size() - << " not equal to the number of cells in the mesh " << nCells() - << abort(FatalError); - } - - if (debug) - { - Pout<< "void Foam::primitiveMesh::overrideCellCentres" - << "(const vectorField& newCellCtrs) const : " - << "overriding cell centres." << endl; - } - - deleteDemandDrivenData(cellCentresPtr_); - deleteDemandDrivenData(cellVolumesPtr_); - - // Calculate the cell volumes - these are invariant with respect - // to the centre. - calcCellCentresAndVols(); - - *cellCentresPtr_ = newCellCtrs; - - // Set internal face centres to the midpoint of the cell-centre delta vector - - // if (debug) - // { - // Pout<< "void Foam::primitiveMesh::overrideCellCentres" - // << "(const vectorField& newCellCtrs) const : " - // << "overriding internal face centres." << endl; - // } - - // deleteDemandDrivenData(faceCentresPtr_); - // deleteDemandDrivenData(faceAreasPtr_); - - // calcFaceCentresAndAreas(); - - // vectorField& fCtrs = *faceCentresPtr_; - - // const vectorField& C = cellCentres(); - // const labelUList& owner = faceOwner(); - // const labelUList& neighbour = faceNeighbour(); - - // forAll(neighbour, faceI) - // { - // fCtrs[faceI] = 0.5*(C[neighbour[faceI]] + C[owner[faceI]]); - // } -} - - // ************************************************************************* //