diff --git a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C index a953c66ea6cec8f555429309a11808edee84bd66..b817777a3e3ea0a96f6d2bc22e8a50d03bcb8b97 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 f78a11a9a3810541d6da13e50c52df536b34b18f..17730d131ef1bfbaefa5d17048f224ef3a9d5d35 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 5bc4d56e9414f88583067db33246031a7a68d57a..4993bae684d5ea474236daaa4e6359a9ba5bb774 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 b5256155ee7cdb60e497a5d8b8bc9cc680430c06..06515ba003b58673103035ccacd551457003c452 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 c30ee47c2a0374e792340498c11e758811d2a93d..724d827e7ffec97fab2bed41bd132bd374a398f4 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 16b3abed4edc9bc2d5507f57983061f1fd553739..2c9bf7d5e4b1d601cce470a11069aa6026a382de 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 53e1e4c448488ff3ede623e8ae15f409741adf09..7a307d31ae697aa52b00b76d949ddf59c72cacc0 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 2e208340428d4b3207d8f0bf6efe83c9b601a8aa..19bf22ef944c65756db5ed77710edb55dad73a64 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_); }