From 51abd0e34acd104a64336b9f49c8a0b10c27e2a3 Mon Sep 17 00:00:00 2001 From: william Date: Tue, 3 Jun 2014 11:54:57 +0100 Subject: [PATCH 1/8] COMP: reduced the amount of included code in MPPIC submodels --- .../submodels/MPPIC/AveragingMethods/Dual/Dual.C | 4 ++-- .../submodels/MPPIC/AveragingMethods/makeAveragingMethods.C | 5 +++-- .../CorrectionLimitingMethod/CorrectionLimitingMethod.H | 2 +- .../submodels/MPPIC/PackingModels/Implicit/Implicit.C | 6 +++++- .../ParticleStressModel/ParticleStressModel.H | 3 ++- .../MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.H | 6 ++++-- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/Dual/Dual.C b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/Dual/Dual.C index 6600b655..54f0749c 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/Dual/Dual.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/Dual/Dual.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // template -Foam::autoPtr Foam::AveragingMethods::Dual::size +Foam::autoPtr Foam::AveragingMethods::Dual::size ( const fvMesh& mesh ) diff --git a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/makeAveragingMethods.C b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/makeAveragingMethods.C index c421ab9c..2c36126d 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/makeAveragingMethods.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/AveragingMethods/makeAveragingMethods.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,7 +23,8 @@ License \*---------------------------------------------------------------------------*/ -#include "fvCFD.H" +#include "Field.H" +#include "fvcGrad.H" #include "polyMeshTetDecomposition.H" #include "Basic.H" diff --git a/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.H b/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.H index 18978b5a..d82cbc8c 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.H +++ b/src/lagrangian/intermediate/submodels/MPPIC/CorrectionLimitingMethods/CorrectionLimitingMethod/CorrectionLimitingMethod.H @@ -35,7 +35,7 @@ SourceFiles #ifndef CorrectionLimitingMethod_H #define CorrectionLimitingMethod_H -#include "fvCFD.H" +#include "volFieldsFwd.H" #include "dictionary.H" #include "runTimeSelectionTables.H" diff --git a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Implicit/Implicit.C b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Implicit/Implicit.C index 4851de3e..a159ed37 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Implicit/Implicit.C +++ b/src/lagrangian/intermediate/submodels/MPPIC/PackingModels/Implicit/Implicit.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,10 @@ License #include "Implicit.H" #include "fixedValueFvsPatchField.H" +#include "fvmDdt.H" +#include "fvmDiv.H" +#include "fvmLaplacian.H" +#include "fvcReconstruct.H" #include "volPointInterpolation.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.H b/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.H index d5f5ebb6..61b117c9 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.H +++ b/src/lagrangian/intermediate/submodels/MPPIC/ParticleStressModels/ParticleStressModel/ParticleStressModel.H @@ -35,7 +35,8 @@ SourceFiles #ifndef ParticleStressModel_H #define ParticleStressModel_H -#include "fvCFD.H" +#include "Field.H" +#include "FieldField.H" #include "dictionary.H" #include "runTimeSelectionTables.H" diff --git a/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.H b/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.H index 6c7f6e93..6a8e6bef 100644 --- a/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.H +++ b/src/lagrangian/intermediate/submodels/MPPIC/TimeScaleModels/TimeScaleModel/TimeScaleModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,7 +35,9 @@ SourceFiles #ifndef TimeScaleModel_H #define TimeScaleModel_H -#include "fvCFD.H" +#include "constants.H" +#include "Field.H" +#include "FieldField.H" #include "dictionary.H" #include "runTimeSelectionTables.H" From 548d0fbd3c23587900a73711c9f52b1e1feadc2b Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 3 Jun 2014 14:31:33 +0100 Subject: [PATCH 2/8] ENH: displacemetMotionSolver - updated handling of points0 --- .../displacement/displacementMotionSolver.C | 117 ++++++++++++++---- .../displacement/displacementMotionSolver.H | 22 ++-- 2 files changed, 103 insertions(+), 36 deletions(-) diff --git a/src/dynamicMesh/motionSolver/displacement/displacementMotionSolver.C b/src/dynamicMesh/motionSolver/displacement/displacementMotionSolver.C index 9330b5b3..6d759d96 100644 --- a/src/dynamicMesh/motionSolver/displacement/displacementMotionSolver.C +++ b/src/dynamicMesh/motionSolver/displacement/displacementMotionSolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,6 +34,76 @@ namespace Foam } +// * * * * * * * * * * * * * Protected Data Members * * * * * * * * * * * * * // + +Foam::IOobject Foam::displacementMotionSolver::points0IO +( + const polyMesh& mesh +) const +{ + const word instance = + time().findInstance + ( + mesh.meshDir(), + "points0", + IOobject::READ_IF_PRESENT + ); + + if (instance != time().constant()) + { + // points0 written to a time folder + + return + IOobject + ( + "points0", + instance, + polyMesh::meshSubDir, + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + } + else + { + // check that points0 are actually in constant directory + + IOobject io + ( + "points0", + instance, + polyMesh::meshSubDir, + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + + if (io.headerOk()) + { + return io; + } + else + { + // copy of original mesh points + + return + IOobject + ( + "points", + instance, + polyMesh::meshSubDir, + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + } + } +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::displacementMotionSolver::displacementMotionSolver @@ -49,29 +119,14 @@ Foam::displacementMotionSolver::displacementMotionSolver IOobject ( "pointDisplacement", - mesh.time().timeName(), + time().timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), pointMesh::New(mesh) ), - points0_ - ( - pointIOField - ( - IOobject - ( - "points", - mesh.time().constant(), - polyMesh::meshSubDir, - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) - ) - ) + points0_(pointIOField(points0IO(mesh))) { if (points0_.size() != mesh.nPoints()) { @@ -81,7 +136,8 @@ Foam::displacementMotionSolver::displacementMotionSolver "displacementMotionSolver\n" "(\n" " const polyMesh&,\n" - " const IOdictionary&\n" + " const IOdictionary&,\n" + " const word&\n" ")" ) << "Number of points in mesh " << mesh.nPoints() << " differs from number of points " << points0_.size() @@ -90,7 +146,7 @@ Foam::displacementMotionSolver::displacementMotionSolver IOobject ( "points", - mesh.time().constant(), + time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, @@ -118,7 +174,7 @@ void Foam::displacementMotionSolver::movePoints(const pointField&) void Foam::displacementMotionSolver::updateMesh(const mapPolyMesh& mpm) { - // pointMesh already updates pointFields. + // pointMesh already updates pointFields motionSolver::updateMesh(mpm); @@ -136,7 +192,7 @@ void Foam::displacementMotionSolver::updateMesh(const mapPolyMesh& mpm) // Note: boundBox does reduce const vector span0 = boundBox(points0_).span(); - const vector span = boundBox(points).span(); + const vector span = boundBox(points).span(); vector scaleFactors(cmptDivide(span0, span)); @@ -156,11 +212,11 @@ void Foam::displacementMotionSolver::updateMesh(const mapPolyMesh& mpm) } else { - // New point. Assume motion is scaling. + // New point - assume motion is scaling newPoints0[pointI] = points0_[oldPointI] + cmptMultiply ( scaleFactors, - points[pointI]-points[masterPointI] + points[pointI] - points[masterPointI] ); } } @@ -170,12 +226,21 @@ void Foam::displacementMotionSolver::updateMesh(const mapPolyMesh& mpm) ( "displacementMotionSolver::updateMesh" "(const mapPolyMesh&)" - ) << "Cannot work out coordinates of introduced vertices." - << " New vertex " << pointI << " at coordinate " + ) << "Cannot determine co-ordinates of introduced vertices." + << " New vertex " << pointI << " at co-ordinate " << points[pointI] << exit(FatalError); } } + + twoDCorrectPoints(newPoints0); + points0_.transfer(newPoints0); + + // points0 changed - set to write and check-in to database + points0_.rename("points0"); + points0_.writeOpt() = IOobject::AUTO_WRITE; + points0_.instance() = time().timeName(); + points0_.checkIn(); } diff --git a/src/dynamicMesh/motionSolver/displacement/displacementMotionSolver.H b/src/dynamicMesh/motionSolver/displacement/displacementMotionSolver.H index ad7aa193..810aae06 100644 --- a/src/dynamicMesh/motionSolver/displacement/displacementMotionSolver.H +++ b/src/dynamicMesh/motionSolver/displacement/displacementMotionSolver.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,6 +40,7 @@ SourceFiles #include "motionSolver.H" #include "pointFields.H" +#include "pointIOField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -63,21 +64,22 @@ protected: //- Point motion field mutable pointVectorField pointDisplacement_; -private: - - // Private data - //- Starting points - pointField points0_; + pointIOField points0_; + + + // Protected Member Functions + + //- Return IO object for points0 + IOobject points0IO(const polyMesh& mesh) const; + +private: // Private Member Functions //- Disallow default bitwise copy construct - displacementMotionSolver - ( - const displacementMotionSolver& - ); + displacementMotionSolver(const displacementMotionSolver&); //- Disallow default bitwise assignment void operator=(const displacementMotionSolver&); From 33b0d179998123e4e89c79057b60d42fe0066806 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 3 Jun 2014 14:42:39 +0100 Subject: [PATCH 3/8] ENH: mesh motion updates --- .../manipulation/checkMesh/checkGeometry.C | 32 ++-- .../constraint/wedge/wedgePointPatch.C | 20 +- .../constraint/wedge/wedgePointPatch.H | 18 +- .../mapPolyMesh/faceMapper/faceMapper.C | 16 +- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 13 +- .../constraint/wedge/wedgePolyPatch.C | 122 ++++++++---- .../constraint/wedge/wedgePolyPatch.H | 26 ++- .../layerAdditionRemoval/addCellLayer.C | 118 +++++++----- .../layerAdditionRemoval/removeCellLayer.C | 90 +++++---- .../layerAdditionRemoval/setLayerPairing.C | 48 +++-- .../displacementLayeredMotionMotionSolver.C | 178 ++++++++++++------ .../twoDPointCorrector/twoDPointCorrector.C | 134 +++++++------ .../twoDPointCorrector/twoDPointCorrector.H | 16 +- .../sixDoFRigidBodyMotionIO.C | 14 +- 14 files changed, 534 insertions(+), 311 deletions(-) diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C index 32e260f5..8677f08c 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C @@ -19,7 +19,7 @@ Foam::label Foam::findOppositeWedge { const polyBoundaryMesh& patches = mesh.boundaryMesh(); - scalar wppCosAngle = wpp.centreNormal()&wpp.patchNormal(); + scalar wppCosAngle = wpp.cosAngle(); forAll(patches, patchI) { @@ -30,13 +30,11 @@ Foam::label Foam::findOppositeWedge && isA(patches[patchI]) ) { - const wedgePolyPatch& pp = refCast - ( - patches[patchI] - ); + const wedgePolyPatch& pp = + refCast(patches[patchI]); // Calculate (cos of) angle to wpp (not pp!) centre normal - scalar ppCosAngle = wpp.centreNormal()&pp.patchNormal(); + scalar ppCosAngle = wpp.centreNormal() & pp.n(); if ( @@ -73,12 +71,10 @@ bool Foam::checkWedges { if (patches[patchI].size() && isA(patches[patchI])) { - const wedgePolyPatch& pp = refCast - ( - patches[patchI] - ); + const wedgePolyPatch& pp = + refCast(patches[patchI]); - scalar wedgeAngle = acos(pp.centreNormal()&pp.patchNormal()); + scalar wedgeAngle = acos(pp.cosAngle()); if (report) { @@ -100,10 +96,8 @@ bool Foam::checkWedges return true; } - const wedgePolyPatch& opp = refCast - ( - patches[oppositePatchI] - ); + const wedgePolyPatch& opp = + refCast(patches[oppositePatchI]); if (mag(opp.axis() & pp.axis()) < (1-1e-3)) @@ -140,7 +134,7 @@ bool Foam::checkWedges forAll(pp.meshPoints(), i) { const point& pt = p[pp.meshPoints()[i]]; - scalar d = mag((pt-p0) & pp.patchNormal()); + scalar d = mag((pt - p0) & pp.n()); if (d > sqrt(SMALL)) { @@ -385,10 +379,8 @@ bool Foam::checkCoupledPoints { if (patches[patchI].coupled()) { - const coupledPolyPatch& cpp = refCast - ( - patches[patchI] - ); + const coupledPolyPatch& cpp = + refCast(patches[patchI]); if (cpp.owner()) { diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/wedge/wedgePointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/wedge/wedgePointPatch.C index c335911c..56dba997 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/wedge/wedgePointPatch.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/wedge/wedgePointPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -21,9 +21,6 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Description - Wedge front and back plane patch - \*---------------------------------------------------------------------------*/ #include "wedgePointPatch.H" @@ -46,6 +43,19 @@ namespace Foam } +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wedgePointPatch::wedgePointPatch +( + const polyPatch& patch, + const pointBoundaryMesh& bm +) +: + facePointPatch(patch, bm), + wedgePolyPatch_(refCast(patch)) +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::wedgePointPatch::applyConstraint @@ -54,7 +64,7 @@ void Foam::wedgePointPatch::applyConstraint pointConstraint& pc ) const { - pc.applyConstraint(pointNormals()[pointi]); + pc.applyConstraint(wedgePolyPatch_.n()); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/wedge/wedgePointPatch.H b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/wedge/wedgePointPatch.H index a62acfaa..0a437c32 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/wedge/wedgePointPatch.H +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/wedge/wedgePointPatch.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,6 +51,11 @@ class wedgePointPatch : public facePointPatch { + // Private data + + //- Local reference cast into the symmetryPlane patch + const wedgePolyPatch& wedgePolyPatch_; + public: @@ -65,10 +70,7 @@ public: ( const polyPatch& patch, const pointBoundaryMesh& bm - ) - : - facePointPatch(patch, bm) - {} + ); // Member Functions @@ -85,6 +87,12 @@ public: const label pointi, pointConstraint& ) const; + + //- Return symmetry plane normal + const vector& n() const + { + return wedgePolyPatch_.n(); + } }; diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C index e95fbe95..803e523d 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,9 +28,6 @@ License #include "polyMesh.H" #include "mapPolyMesh.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::faceMapper::calcAddressing() const @@ -168,7 +165,7 @@ void Foam::faceMapper::calcAddressing() const } - // Grab inserted points (for them the size of addressing is still zero) + // Grab inserted faces (for them the size of addressing is still zero) insertedFaceLabelsPtr_ = new labelList(mesh_.nFaces()); labelList& insertedFaces = *insertedFaceLabelsPtr_; @@ -413,13 +410,4 @@ const Foam::labelList& Foam::faceMapper::oldPatchSizes() const } -// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // - - -// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * // - - -// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // - - // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index cd70eb39..668a5953 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -921,7 +921,6 @@ Foam::polyMesh::cellTree() const } -// Add boundary patches. Constructor helper void Foam::polyMesh::addPatches ( const List& p, @@ -968,7 +967,6 @@ void Foam::polyMesh::addPatches } -// Add mesh zones. Constructor helper void Foam::polyMesh::addZones ( const List& pz, @@ -1084,7 +1082,6 @@ const Foam::labelList& Foam::polyMesh::faceNeighbour() const } -// Return old mesh motion points const Foam::pointField& Foam::polyMesh::oldPoints() const { if (oldPointsPtr_.empty()) @@ -1129,11 +1126,14 @@ Foam::tmp Foam::polyMesh::movePoints points_ = newPoints; + bool moveError = false; if (debug) { // Check mesh motion if (checkMeshMotion(points_, true)) { + moveError = true; + Info<< "tmp polyMesh::movePoints" << "(const pointField&) : " << "Moving the mesh with given points will " @@ -1176,6 +1176,12 @@ Foam::tmp Foam::polyMesh::movePoints const_cast(time()).functionObjects().movePoints(*this); + + if (debug && moveError) + { + write(); + } + return sweptVols; } @@ -1219,7 +1225,6 @@ Foam::label& Foam::polyMesh::comm() } -// Remove all files and some subdirs (eg, sets) void Foam::polyMesh::removeFiles(const fileName& instanceDir) const { fileName meshFilesPath = thisDb().time().path()/instanceDir/meshDir(); diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C index b7c9783c..e12d22e5 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,56 +40,90 @@ namespace Foam // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // -void Foam::wedgePolyPatch::initTransforms() +void Foam::wedgePolyPatch::calcGeometry(PstreamBuffers&) { - if (size() > 0) + if (axis_ != vector::rootMax) { - const pointField& points = this->points(); + return; + } - patchNormal_ = operator[](0).normal(points); - patchNormal_ /= mag(patchNormal_); + if (returnReduce(size(), sumOp