ENH: pointConstraints: revert to meshObject on pointMesh

This commit is contained in:
mattijs
2013-12-17 12:04:35 +00:00
parent 313841b989
commit 91bb2631f1
8 changed files with 27 additions and 37 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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()
);

View File

@ -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

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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_);
}