ENH: pointConstraints: make polyMesh meshObject (since pointMeshes not currently updated!)

This commit is contained in:
mattijs
2013-12-04 15:55:39 +00:00
parent a5ebecbd3a
commit bab168b5af
7 changed files with 42 additions and 24 deletions

View File

@ -169,7 +169,7 @@ void Foam::motionSmootherAlgo::minSmooth
}
// Single and multi-patch constraints
pointConstraints::New(newFld.mesh()).constrain(newFld, false);
pointConstraints::New(mesh()).constrain(newFld, false);
}
@ -202,7 +202,7 @@ void Foam::motionSmootherAlgo::minSmooth
}
// Single and multi-patch constraints
pointConstraints::New(newFld.mesh()).constrain(newFld, false);
pointConstraints::New(mesh()).constrain(newFld, false);
}
@ -224,7 +224,7 @@ void Foam::motionSmootherAlgo::scaleField
}
// Single and multi-patch constraints
pointConstraints::New(fld.mesh()).constrain(fld, false);
pointConstraints::New(mesh()).constrain(fld, false);
}
@ -266,7 +266,7 @@ void Foam::motionSmootherAlgo::subtractField
}
// Single and multi-patch constraints
pointConstraints::New(fld.mesh()).constrain(fld);
pointConstraints::New(mesh()).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(res.mesh()).constrain(res, false);
pointConstraints::New(mesh).constrain(res, false);
return tres;
}
@ -256,7 +256,7 @@ void Foam::motionSmootherAlgo::smooth
}
// Single and multi-patch constraints
pointConstraints::New(newFld.mesh()).constrain(newFld, false);
pointConstraints::New(mesh_).constrain(newFld, false);
}

View File

@ -51,11 +51,11 @@ void pointConstraints::makePatchPatchAddressing()
<< endl;
}
const pointMesh& pMesh = mesh();
const polyMesh& mesh = pMesh();
//const polyMesh& mesh = mesh();
const pointMesh& pMesh = pointMesh::New(mesh());
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,9 +323,10 @@ void pointConstraints::makePatchPatchAddressing()
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
pointConstraints::pointConstraints(const pointMesh& pm)
//pointConstraints::pointConstraints(const pointMesh& pm)
pointConstraints::pointConstraints(const polyMesh& pm)
:
MeshObject<pointMesh, Foam::UpdateableMeshObject, pointConstraints>(pm)
MeshObject<polyMesh, Foam::UpdateableMeshObject, pointConstraints>(pm)
{
makePatchPatchAddressing();
}
@ -334,7 +335,12 @@ pointConstraints::pointConstraints(const pointMesh& pm)
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
pointConstraints::~pointConstraints()
{}
{
if (debug)
{
Pout<< "pointConstraints::~pointConstraints()" << endl;
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -375,9 +381,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,6 +34,11 @@ 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
@ -62,7 +67,8 @@ class polyMesh;
class pointConstraints
:
public MeshObject<pointMesh, UpdateableMeshObject, pointConstraints>
//See above:public MeshObject<pointMesh, UpdateableMeshObject, pointConstraints>
public MeshObject<polyMesh, UpdateableMeshObject, pointConstraints>
{
// Private data
@ -97,7 +103,8 @@ public:
// Constructors
//- Constructor from pointMesh.
explicit pointConstraints(const pointMesh&);
//explicit pointConstraints(const pointMesh&);
explicit pointConstraints(const polyMesh&);
//- Destructor

View File

@ -139,7 +139,12 @@ void pointConstraints::constrain
pf.correctBoundaryConditions();
// Sync any dangling points
syncUntransformedData(mesh()(), pf.internalField(), maxMagSqrEqOp<Type>());
syncUntransformedData
(
pf.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(pf.mesh());
const pointConstraints& pcs = pointConstraints::New(vf.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(pf.mesh());
const pointConstraints& pcs = pointConstraints::New(vf.mesh());
pcs.constrainDisplacement(pf, false);
}