diff --git a/src/lagrangian/basic/Cloud/Cloud.C b/src/lagrangian/basic/Cloud/Cloud.C index e18e0e3b53..8d39c1f70a 100644 --- a/src/lagrangian/basic/Cloud/Cloud.C +++ b/src/lagrangian/basic/Cloud/Cloud.C @@ -48,8 +48,7 @@ Foam::Cloud::Cloud cellFaces_(pMesh.cells()), allFaceCentres_(pMesh.faceCentres()), owner_(pMesh.faceOwner()), - neighbour_(pMesh.faceNeighbour()), - meshInfo_(polyMesh_) + neighbour_(pMesh.faceNeighbour()) {} @@ -69,8 +68,7 @@ Foam::Cloud::Cloud cellFaces_(pMesh.cells()), allFaceCentres_(pMesh.faceCentres()), owner_(pMesh.faceOwner()), - neighbour_(pMesh.faceNeighbour()), - meshInfo_(polyMesh_) + neighbour_(pMesh.faceNeighbour()) {} diff --git a/src/lagrangian/basic/Cloud/Cloud.H b/src/lagrangian/basic/Cloud/Cloud.H index 684ceb979e..d82dc933f1 100644 --- a/src/lagrangian/basic/Cloud/Cloud.H +++ b/src/lagrangian/basic/Cloud/Cloud.H @@ -39,8 +39,7 @@ SourceFiles #include "cloud.H" #include "IDLList.H" #include "IOField.H" - -#include "polyMeshInfo.H" +#include "polyMesh.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -68,7 +67,6 @@ class Cloud public cloud, public IDLList { - // Private data const polyMesh& polyMesh_; @@ -79,9 +77,6 @@ class Cloud const unallocLabelList& owner_; const unallocLabelList& neighbour_; - //- Mesh information object - const polyMeshInfo meshInfo_; - // Private member functions @@ -173,12 +168,6 @@ public: return polyMesh_.boundaryMesh()[patchi].whichFace(facei); } - //- Return reference to the mesh information object - const polyMeshInfo& meshInfo() const - { - return meshInfo_; - } - label size() const { return IDLList::size(); diff --git a/src/lagrangian/basic/Cloud/CloudIO.C b/src/lagrangian/basic/Cloud/CloudIO.C index 9b58c12ea5..42c1a9317a 100644 --- a/src/lagrangian/basic/Cloud/CloudIO.C +++ b/src/lagrangian/basic/Cloud/CloudIO.C @@ -72,8 +72,7 @@ Foam::Cloud::Cloud cellFaces_(pMesh.cells()), allFaceCentres_(pMesh.faceCentres()), owner_(pMesh.faceOwner()), - neighbour_(pMesh.faceNeighbour()), - meshInfo_(polyMesh_) + neighbour_(pMesh.faceNeighbour()) { initCloud(checkClass); } @@ -94,8 +93,7 @@ Foam::Cloud::Cloud cellFaces_(pMesh.cells()), allFaceCentres_(pMesh.faceCentres()), owner_(pMesh.faceOwner()), - neighbour_(pMesh.faceNeighbour()), - meshInfo_(polyMesh_) + neighbour_(pMesh.faceNeighbour()) { initCloud(checkClass); } diff --git a/src/lagrangian/basic/Make/files b/src/lagrangian/basic/Make/files index 629d47f474..969b966f1a 100644 --- a/src/lagrangian/basic/Make/files +++ b/src/lagrangian/basic/Make/files @@ -6,6 +6,4 @@ indexedParticle = indexedParticle $(passiveParticle)/passiveParticleCloud.C $(indexedParticle)/indexedParticleCloud.C -polyMeshInfo/polyMeshInfo.C - LIB = $(FOAM_LIBBIN)/liblagrangian diff --git a/src/lagrangian/basic/polyMeshInfo/polyMeshInfo.C b/src/lagrangian/basic/polyMeshInfo/polyMeshInfo.C deleted file mode 100644 index 16b347ccbe..0000000000 --- a/src/lagrangian/basic/polyMeshInfo/polyMeshInfo.C +++ /dev/null @@ -1,325 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 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 "polyMeshInfo.H" -#include "wedgePolyPatch.H" -#include "symmetryPolyPatch.H" -#include "emptyPolyPatch.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(polyMeshInfo, 0); -} - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void Foam::polyMeshInfo::setCentrePoint() -{ - boundBox bounds = mesh_.bounds(); - - centrePoint_ = 0.5*(bounds.max() + bounds.min()); -} - - -void Foam::polyMeshInfo::setEmptyComponent(const vector& dir) -{ - for (direction cmpt=0; cmpt 1.0e-6) - { - emptyComponent_ = cmpt; - } - } -} - - -void Foam::polyMeshInfo::queryWedge() -{ - label patchId[4]; - - bool symmPlaneExists = false; - - forAll(mesh_.boundaryMesh(), patchi) - { - const polyPatch& patch = mesh_.boundaryMesh()[patchi]; - if (isA(patch)) - { - if (patch.size()) - { - nWedge_++; - if (nWedge_ > 4) - { - break; - } - patchId[nWedge_-1] = patchi; - } - } - else if (isA(patch)) - { - symmPlaneExists = true; - } - } - - if (nWedge_ != 0 && nWedge_ != 2 && nWedge_ != 4) - { - FatalErrorIn("void polyMeshInfo::queryWedge() const") - << "Number of wedge patches " << nWedge_ << " is incorrect, " - "should be 0, 2 or 4" - << exit(FatalError); - } - else - { - if (symmPlaneExists) - { - wedgeAngle_ = mathematicalConstant::pi; - } - else - { - if (nWedge_) - { - if (nWedge_ > 2) - { - WarningIn("void polyMeshInfo::queryWedge() const") - << "Only configured for cases with 2 wedges. " - << "Lagrangian calculations may result in errors" - << endl; - } - // Get the vector normal to wedge patch1 - const wedgePolyPatch& patch1 = refCast - (mesh_.boundaryMesh()[patchId[0]]); - vector n1 = patch1.patchNormal(); - - // Get the vector normal to wedge patch2 - const wedgePolyPatch& patch2 = refCast - (mesh_.boundaryMesh()[patchId[1]]); - vector n2 = patch2.patchNormal(); - - // Calculate the angle swept between the patches - const scalar arcCos = (n1 & n2)/mag(n1); - wedgeAngle_ = mathematicalConstant::pi - acos(arcCos); - - // Get the centre normal - centreNormal_ = patch1.centreNormal(); - - // Get the wedge axis - wedgeAxis_ = patch1.axis(); - } - } - } -} - - -void Foam::polyMeshInfo::queryDirections() -{ - vector dirVec = vector::zero; - - forAll(mesh_.boundaryMesh(), patchi) - { - if (isA(mesh_.boundaryMesh()[patchi])) - { - if (mesh_.boundaryMesh()[patchi].size()) - { - nEmpty_++; - dirVec += - sum(cmptMag(mesh_.boundaryMesh()[patchi].faceAreas())); - } - } - } - - - for (direction cmpt=0; cmpt()); - - dirVec /= mag(dirVec); - - for (direction cmpt=0; cmpt 1.0e-6) - { - directions_[cmpt] = -1; - emptyComponent_ = cmpt; - } - else - { - directions_[cmpt] = 1; - } - } - - // Set the patch normal - centreNormal_ = dirVec; - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::polyMeshInfo::polyMeshInfo -( - const polyMesh& mesh -) -: - mesh_(mesh), - nGeometricD_(0), - nSolutionD_(0), - centreNormal_(vector::zero), - emptyComponent_(0), - centrePoint_(vector::zero), - nEmpty_(0), - nWedge_(0), - wedgeAxis_(vector::zero), - wedgeAngle_(0) -{ - setCentrePoint(); - - queryWedge(); - - queryDirections(); - - nSolutionD_ = cmptSum(directions_ + Vector