From 91bb2631f10c01d494b2862933de12703a38b111 Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Tue, 17 Dec 2013 12:04:35 +0000 Subject: [PATCH] ENH: pointConstraints: revert to meshObject on pointMesh --- .../motionSmoother/motionSmootherAlgo.C | 12 +++++------ .../motionSmootherAlgoTemplates.C | 4 ++-- .../volPointInterpolation/pointConstraints.C | 21 +++++++++---------- .../volPointInterpolation/pointConstraints.H | 11 ++-------- .../pointConstraintsTemplates.C | 7 +------ .../volPointInterpolate.C | 2 +- .../volPointInterpolation.C | 2 +- .../sixDoFRigidBodyMotionSolver.C | 5 ++++- 8 files changed, 27 insertions(+), 37 deletions(-) diff --git a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C index a953c66ea6c..b817777a3e3 100644 --- a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C +++ b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C @@ -169,7 +169,7 @@ void Foam::motionSmootherAlgo::minSmooth } // Single and multi-patch constraints - pointConstraints::New(mesh()).constrain(newFld, false); + pointConstraints::New(pMesh()).constrain(newFld, false); } @@ -202,7 +202,7 @@ void Foam::motionSmootherAlgo::minSmooth } // Single and multi-patch constraints - pointConstraints::New(mesh()).constrain(newFld, false); + pointConstraints::New(pMesh()).constrain(newFld, false); } @@ -224,7 +224,7 @@ void Foam::motionSmootherAlgo::scaleField } // Single and multi-patch constraints - pointConstraints::New(mesh()).constrain(fld, false); + pointConstraints::New(pMesh()).constrain(fld, false); } @@ -266,7 +266,7 @@ void Foam::motionSmootherAlgo::subtractField } // Single and multi-patch constraints - pointConstraints::New(mesh()).constrain(fld); + pointConstraints::New(pMesh()).constrain(fld); } @@ -476,7 +476,7 @@ void Foam::motionSmootherAlgo::setDisplacementPatchFields } // Multi-patch constraints - pointConstraints::New(displacement.mesh()()).constrainCorners(displacement); + pointConstraints::New(displacement.mesh()).constrainCorners(displacement); // Adapt the fixedValue bc's (i.e. copy internal point data to // boundaryField for all affected patches) to take the changes caused @@ -622,7 +622,7 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions } // Multi-patch constraints - pointConstraints::New(displacement.mesh()()).constrainCorners(displacement); + pointConstraints::New(displacement.mesh()).constrainCorners(displacement); // Correct for problems introduced by corner constraints syncTools::syncPointList diff --git a/src/dynamicMesh/motionSmoother/motionSmootherAlgoTemplates.C b/src/dynamicMesh/motionSmoother/motionSmootherAlgoTemplates.C index f78a11a9a38..17730d131ef 100644 --- a/src/dynamicMesh/motionSmoother/motionSmootherAlgoTemplates.C +++ b/src/dynamicMesh/motionSmoother/motionSmootherAlgoTemplates.C @@ -229,7 +229,7 @@ Foam::motionSmootherAlgo::avg } // Single and multi-patch constraints - pointConstraints::New(mesh).constrain(res, false); + pointConstraints::New(fld.mesh()).constrain(res, false); return tres; } @@ -256,7 +256,7 @@ void Foam::motionSmootherAlgo::smooth } // Single and multi-patch constraints - pointConstraints::New(mesh_).constrain(newFld, false); + pointConstraints::New(fld.mesh()).constrain(newFld, false); } diff --git a/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.C b/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.C index 5bc4d56e941..4993bae684d 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.C @@ -51,11 +51,11 @@ void pointConstraints::makePatchPatchAddressing() << endl; } - //const polyMesh& mesh = mesh(); - const pointMesh& pMesh = pointMesh::New(mesh()); + const pointMesh& pMesh = mesh(); + const polyMesh& mesh = pMesh(); const pointBoundaryMesh& pbm = pMesh.boundary(); - const polyBoundaryMesh& bm = mesh().boundaryMesh(); + const polyBoundaryMesh& bm = mesh.boundaryMesh(); // first count the total number of patch-patch points @@ -146,7 +146,7 @@ void pointConstraints::makePatchPatchAddressing() // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { - const globalMeshData& gd = mesh().globalData(); + const globalMeshData& gd = mesh.globalData(); const labelListList& globalPointSlaves = gd.globalPointSlaves(); const mapDistribute& globalPointSlavesMap = gd.globalPointSlavesMap(); const Map<label>& cpPointMap = gd.coupledPatch().meshPointMap(); @@ -226,7 +226,7 @@ void pointConstraints::makePatchPatchAddressing() { //Pout<< "on meshpoint:" << meshPointI // << " coupled:" << coupledPointI - // << " at:" << mesh().points()[meshPointI] + // << " at:" << mesh.points()[meshPointI] // << " have new constraint:" // << constraints[coupledPointI] // << endl; @@ -244,7 +244,7 @@ void pointConstraints::makePatchPatchAddressing() { //Pout<< "on meshpoint:" << meshPointI // << " coupled:" << coupledPointI - // << " at:" << mesh().points()[meshPointI] + // << " at:" << mesh.points()[meshPointI] // << " have possibly extended constraint:" // << constraints[coupledPointI] // << endl; @@ -323,10 +323,9 @@ void pointConstraints::makePatchPatchAddressing() // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // -//pointConstraints::pointConstraints(const pointMesh& pm) -pointConstraints::pointConstraints(const polyMesh& pm) +pointConstraints::pointConstraints(const pointMesh& pm) : - MeshObject<polyMesh, Foam::UpdateableMeshObject, pointConstraints>(pm) + MeshObject<pointMesh, Foam::UpdateableMeshObject, pointConstraints>(pm) { makePatchPatchAddressing(); } @@ -381,9 +380,9 @@ void pointConstraints::constrainDisplacement // Apply any 2D motion constraints (or should they go before // corner constraints?) - twoDPointCorrector::New(mesh()).correctDisplacement + twoDPointCorrector::New(mesh()()).correctDisplacement ( - mesh().points(), + mesh()().points(), pf.internalField() ); diff --git a/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.H b/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.H index b5256155ee7..06515ba003b 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.H +++ b/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.H @@ -34,11 +34,6 @@ Description coupled to points which are not on any constraint patch and we don't want to get inconsistency between the two points. - Note: is currently MeshObject on polyMesh but should really be on - pointMesh. The problem is that pointMesh::updateMesh never - gets called (since currently polyMesh gets reset and destroys - pointMesh) - SourceFiles pointConstraints.C pointConstraintsTemplates.C @@ -67,8 +62,7 @@ class polyMesh; class pointConstraints : -//See above:public MeshObject<pointMesh, UpdateableMeshObject, pointConstraints> - public MeshObject<polyMesh, UpdateableMeshObject, pointConstraints> + public MeshObject<pointMesh, UpdateableMeshObject, pointConstraints> { // Private data @@ -103,8 +97,7 @@ public: // Constructors //- Constructor from pointMesh. - //explicit pointConstraints(const pointMesh&); - explicit pointConstraints(const polyMesh&); + explicit pointConstraints(const pointMesh&); //- Destructor diff --git a/src/finiteVolume/interpolation/volPointInterpolation/pointConstraintsTemplates.C b/src/finiteVolume/interpolation/volPointInterpolation/pointConstraintsTemplates.C index c30ee47c2a0..724d827e7ff 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/pointConstraintsTemplates.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/pointConstraintsTemplates.C @@ -139,12 +139,7 @@ void pointConstraints::constrain pf.correctBoundaryConditions(); // Sync any dangling points - syncUntransformedData - ( - pf.mesh()(), - pf.internalField(), - maxMagSqrEqOp<Type>() - ); + syncUntransformedData(mesh()(), pf.internalField(), maxMagSqrEqOp<Type>()); // Apply multiple constraints on edge/corner points constrainCorners(pf); diff --git a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C index 16b3abed4ed..2c9bf7d5e4b 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C @@ -271,7 +271,7 @@ void volPointInterpolation::interpolateBoundaryField interpolateBoundaryField(vf, pf); // Apply constraints - const pointConstraints& pcs = pointConstraints::New(vf.mesh()); + const pointConstraints& pcs = pointConstraints::New(pf.mesh()); pcs.constrain(pf, overrideFixedValue); } diff --git a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C index 53e1e4c4484..7a307d31ae6 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C @@ -390,7 +390,7 @@ void volPointInterpolation::interpolateDisplacement interpolateBoundaryField(vf, pf); // Apply displacement constraints - const pointConstraints& pcs = pointConstraints::New(vf.mesh()); + const pointConstraints& pcs = pointConstraints::New(pf.mesh()); pcs.constrainDisplacement(pf, false); } diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.C index 2e208340428..19bf22ef944 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.C @@ -220,7 +220,10 @@ void Foam::sixDoFRigidBodyMotionSolver::solve() motion_.scaledPosition(points0(), scale_) - points0(); // Displacement has changed. Update boundary conditions - pointConstraints::New(mesh()).constrainDisplacement(pointDisplacement_); + pointConstraints::New + ( + pointDisplacement_.mesh() + ).constrainDisplacement(pointDisplacement_); } -- GitLab