From c224d19c838d058f9c74afc3d9f09f99875e6a6c Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 30 Jun 2016 10:33:28 +0100 Subject: [PATCH] sampledCuttingPlane: Rationalized --- .../sampledCuttingPlane/sampledCuttingPlane.C | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C index aa06bc1b0e..7d439f3bfe 100644 --- a/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C +++ b/src/sampling/sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C @@ -71,13 +71,11 @@ void Foam::sampledCuttingPlane::createGeometry() // Patch to put exposed internal faces into const label exposedPatchi = patches.findPatchID(exposedPatchName_); - if (debug) - { - Info<< "Allocating subset of size " - << mesh().cellZones()[zoneID_.index()].size() - << " with exposed faces into patch " - << patches[exposedPatchi].name() << endl; - } + DebugInfo + << "Allocating subset of size " + << mesh().cellZones()[zoneID_.index()].size() + << " with exposed faces into patch " + << patches[exposedPatchi].name() << endl; subMeshPtr_.reset ( @@ -92,11 +90,11 @@ void Foam::sampledCuttingPlane::createGeometry() // Select either the submesh or the underlying mesh - const fvMesh& fvm = + const fvMesh& mesh = ( subMeshPtr_.valid() ? subMeshPtr_().subMesh() - : static_cast(mesh()) + : static_cast(this->mesh()) ); @@ -110,13 +108,13 @@ void Foam::sampledCuttingPlane::createGeometry() IOobject ( "cellDistance", - fvm.time().timeName(), - fvm.time(), + mesh.time().timeName(), + mesh.time(), IOobject::NO_READ, IOobject::NO_WRITE, false ), - fvm, + mesh, dimensionedScalar("zero", dimLength, 0) ) ); @@ -124,7 +122,7 @@ void Foam::sampledCuttingPlane::createGeometry() // Internal field { - const pointField& cc = fvm.cellCentres(); + const pointField& cc = mesh.cellCentres(); scalarField& fld = cellDistance.primitiveFieldRef(); forAll(cc, i) @@ -154,13 +152,13 @@ void Foam::sampledCuttingPlane::createGeometry() patchi, new calculatedFvPatchScalarField ( - fvm.boundary()[patchi], + mesh.boundary()[patchi], cellDistance ) ); - const polyPatch& pp = fvm.boundary()[patchi].patch(); - pointField::subField cc = pp.patchSlice(fvm.faceCentres()); + const polyPatch& pp = mesh.boundary()[patchi].patch(); + pointField::subField cc = pp.patchSlice(mesh.faceCentres()); fvPatchScalarField& fld = cellDistanceBf[patchi]; fld.setSize(pp.size()); @@ -171,7 +169,7 @@ void Foam::sampledCuttingPlane::createGeometry() } else { - const pointField& cc = fvm.C().boundaryField()[patchi]; + const pointField& cc = mesh.C().boundaryField()[patchi]; fvPatchScalarField& fld = cellDistanceBf[patchi]; forAll(fld, i) @@ -188,9 +186,9 @@ void Foam::sampledCuttingPlane::createGeometry() // Distance to points - pointDistance_.setSize(fvm.nPoints()); + pointDistance_.setSize(mesh.nPoints()); { - const pointField& pts = fvm.points(); + const pointField& pts = mesh.points(); forAll(pointDistance_, i) { @@ -208,13 +206,13 @@ void Foam::sampledCuttingPlane::createGeometry() IOobject ( "pointDistance", - fvm.time().timeName(), - fvm.time(), + mesh.time().timeName(), + mesh.time(), IOobject::NO_READ, IOobject::NO_WRITE, false ), - pointMesh::New(fvm), + pointMesh::New(mesh), dimensionedScalar("zero", dimLength, 0) ); pDist.primitiveFieldRef() = pointDistance_; @@ -237,7 +235,7 @@ void Foam::sampledCuttingPlane::createGeometry() ) //new isoSurfaceCell //( - // fvm, + // mesh, // cellDistance, // pointDistance_, // 0.0, @@ -328,7 +326,7 @@ bool Foam::sampledCuttingPlane::expire() // Clear derived data clearGeom(); - // already marked as expired + // Already marked as expired if (needsUpdate_) { return false;