mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Basic functions for point motion/relaxation.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -208,6 +208,27 @@ void Foam::CV3D::insertGrid()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::CV3D::relaxPoints(const scalar relaxation)
|
||||
{
|
||||
Info<< "Calculating new points: " << endl;
|
||||
|
||||
for
|
||||
(
|
||||
Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
|
||||
vit != finite_vertices_end();
|
||||
++vit
|
||||
)
|
||||
{
|
||||
if (vit->internalPoint())
|
||||
{
|
||||
// movePoint(vit, newPoint);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Foam::CV3D::insertSurfacePointPairs()
|
||||
{
|
||||
startOfSurfacePointPairs_ = number_of_vertices();
|
||||
@ -236,6 +257,7 @@ void Foam::CV3D::boundaryConform()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Foam::CV3D::removeSurfacePointPairs()
|
||||
{
|
||||
for
|
||||
@ -252,6 +274,7 @@ void Foam::CV3D::removeSurfacePointPairs()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::CV3D::write() const
|
||||
{
|
||||
if (controls_.writeFinalTriangulation)
|
||||
|
||||
@ -211,6 +211,8 @@ private:
|
||||
const vector& n
|
||||
);
|
||||
|
||||
inline void movePoint(const Vertex_handle& vh, const point& p);
|
||||
|
||||
//- Create the initial mesh from the bounding-box
|
||||
void insertBoundingBox();
|
||||
|
||||
@ -330,6 +332,12 @@ public:
|
||||
// Points outside the geometry are ignored.
|
||||
void insertGrid();
|
||||
|
||||
|
||||
// Point motion
|
||||
|
||||
//- Calculate the displacements to relax the points
|
||||
void relaxPoints(const scalar relaxation);
|
||||
|
||||
//- Insert all surface point-pairs from
|
||||
// insertSurfaceNearestPointPairs and
|
||||
// findIntersectionForOutsideCentroid
|
||||
|
||||
@ -91,6 +91,16 @@ inline void Foam::CV3D::insertPointPair
|
||||
insertPoint(surfPt + ppDistn, master);
|
||||
}
|
||||
|
||||
|
||||
void Foam::CV3D::movePoint(const Vertex_handle& vh, const point& p)
|
||||
{
|
||||
label nv = vh->index();
|
||||
|
||||
remove(vh);
|
||||
insert(toPoint(p))->index() = nv;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef CGAL_INEXACT
|
||||
|
||||
@ -90,12 +90,20 @@ int main(int argc, char *argv[])
|
||||
mesh.boundaryConform();
|
||||
}
|
||||
|
||||
scalar relaxation = 1;
|
||||
|
||||
for (int iter=1; iter<=nIterations; iter++)
|
||||
{
|
||||
Info<< nl
|
||||
<< "Relaxation iteration " << iter << nl
|
||||
<< "~~~~~~~~~~~~~~~~~~~~~~~~" << endl;
|
||||
|
||||
relaxation -= 0.02;
|
||||
|
||||
Info<< "relaxation = " << relaxation << endl;
|
||||
|
||||
mesh.relaxPoints(relaxation);
|
||||
|
||||
mesh.removeSurfacePointPairs();
|
||||
mesh.insertSurfacePointPairs();
|
||||
mesh.boundaryConform();
|
||||
|
||||
Reference in New Issue
Block a user