mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Move commented out testing code to proper function.
This commit is contained in:
@ -474,6 +474,10 @@ private:
|
||||
label& hitSurfaceLargest
|
||||
) const;
|
||||
|
||||
//- Write out debugging information about the surface conformation
|
||||
// quality
|
||||
void reportSurfaceConformationQuality();
|
||||
|
||||
//- Limit the displacement of a point so that it doesn't penetrate the
|
||||
// surface to be meshed or come too close to it
|
||||
void limitDisplacement
|
||||
|
||||
@ -368,115 +368,9 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
|
||||
}
|
||||
}
|
||||
|
||||
// Info<< nl << "After iterations, check penetrations" << endl;
|
||||
//reportSurfaceConformationQuality();
|
||||
|
||||
// for
|
||||
// (
|
||||
// Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
|
||||
// vit != finite_vertices_end();
|
||||
// vit++
|
||||
// )
|
||||
// {
|
||||
// if (vit->internalOrBoundaryPoint())
|
||||
// {
|
||||
// Foam::point vert(topoint(vit->point()));
|
||||
// pointIndexHit surfHit;
|
||||
// label hitSurface;
|
||||
|
||||
// dualCellLargestSurfaceProtrusion(vit, surfHit, hitSurface);
|
||||
|
||||
// if (surfHit.hit())
|
||||
// {
|
||||
// Info<< nl << "Residual penetration: " << nl
|
||||
// << vit->index() << nl
|
||||
// << vit->type() << nl
|
||||
// << vit->ppMaster() << nl
|
||||
// << "nearFeaturePt "
|
||||
// << nearFeaturePt(surfHit.hitPoint()) << nl
|
||||
// << vert << nl
|
||||
// << surfHit.hitPoint()
|
||||
// << endl;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// {
|
||||
// // TEST - ASSESS CLOSE SURFACE POINTS
|
||||
|
||||
// setVertexSizeAndAlignment();
|
||||
|
||||
// for
|
||||
// (
|
||||
// Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
|
||||
// vit != finite_vertices_end();
|
||||
// vit++
|
||||
// )
|
||||
// {
|
||||
// if
|
||||
// (
|
||||
// vit->index() >= startOfSurfacePoints_
|
||||
// && vit->internalOrBoundaryPoint()
|
||||
// )
|
||||
// {
|
||||
// std::list<Vertex_handle> adjacentVertices;
|
||||
|
||||
// adjacent_vertices(vit, std::back_inserter(adjacentVertices));
|
||||
|
||||
// Foam::point pt = topoint(vit->point());
|
||||
|
||||
// // Info<< nl << "vit: " << vit->index() << " "
|
||||
// // << topoint(vit->point())
|
||||
// // << endl;
|
||||
|
||||
// // Info<< adjacentVertices.size() << endl;
|
||||
|
||||
// for
|
||||
// (
|
||||
// std::list<Vertex_handle>::iterator
|
||||
// avit = adjacentVertices.begin();
|
||||
// avit != adjacentVertices.end();
|
||||
// ++avit
|
||||
// )
|
||||
// {
|
||||
// Vertex_handle avh = *avit;
|
||||
|
||||
// // The lower indexed vertex will perform the assessment
|
||||
// if
|
||||
// (
|
||||
// avh->index() >= startOfSurfacePoints_
|
||||
// && avh->internalOrBoundaryPoint()
|
||||
// && vit->index() < avh->index()
|
||||
// && vit->type() != avh->type()
|
||||
// )
|
||||
// {
|
||||
// scalar targetSize = 0.2*averageAnyCellSize(vit, avh);
|
||||
|
||||
// // Info<< "diff " << mag(pt - topoint(avh->point()))
|
||||
// // << " " << targetSize << endl;
|
||||
|
||||
// if
|
||||
// (
|
||||
// magSqr(pt - topoint(avh->point()))
|
||||
// < sqr(targetSize)
|
||||
// )
|
||||
// {
|
||||
// Info<< nl << "vit: " << vit->index() << " "
|
||||
// << topoint(vit->point())
|
||||
// << endl;
|
||||
|
||||
// Info<< " adjacent too close: "
|
||||
// << avh->index() << " "
|
||||
// << topoint(avh->point())
|
||||
// << endl;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
Pout<< "NOT STORING SURFACE CONFORMATION" << endl;
|
||||
// storeSurfaceConformation();
|
||||
storeSurfaceConformation();
|
||||
}
|
||||
|
||||
|
||||
@ -1294,6 +1188,117 @@ void Foam::conformalVoronoiMesh::dualCellLargestSurfaceIncursion
|
||||
}
|
||||
|
||||
|
||||
void Foam::conformalVoronoiMesh::reportSurfaceConformationQuality()
|
||||
{
|
||||
Info<< nl << "Check surface conformation quality" << endl;
|
||||
|
||||
for
|
||||
(
|
||||
Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
|
||||
vit != finite_vertices_end();
|
||||
vit++
|
||||
)
|
||||
{
|
||||
if (vit->internalOrBoundaryPoint())
|
||||
{
|
||||
Foam::point vert(topoint(vit->point()));
|
||||
pointIndexHit surfHit;
|
||||
label hitSurface;
|
||||
|
||||
dualCellLargestSurfaceProtrusion(vit, surfHit, hitSurface);
|
||||
|
||||
if (surfHit.hit())
|
||||
{
|
||||
Pout<< nl << "Residual penetration: " << nl
|
||||
<< vit->index() << nl
|
||||
<< vit->type() << nl
|
||||
<< vit->ppMaster() << nl
|
||||
<< "nearFeaturePt "
|
||||
<< nearFeaturePt(surfHit.hitPoint()) << nl
|
||||
<< vert << nl
|
||||
<< surfHit.hitPoint()
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
// Assess close surface points
|
||||
|
||||
setVertexSizeAndAlignment();
|
||||
|
||||
for
|
||||
(
|
||||
Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
|
||||
vit != finite_vertices_end();
|
||||
vit++
|
||||
)
|
||||
{
|
||||
if
|
||||
(
|
||||
vit->index() >= startOfSurfacePoints_
|
||||
&& vit->internalOrBoundaryPoint()
|
||||
)
|
||||
{
|
||||
std::list<Vertex_handle> adjacentVertices;
|
||||
|
||||
adjacent_vertices(vit, std::back_inserter(adjacentVertices));
|
||||
|
||||
Foam::point pt = topoint(vit->point());
|
||||
|
||||
// Pout<< nl << "vit: " << vit->index() << " "
|
||||
// << topoint(vit->point())
|
||||
// << endl;
|
||||
|
||||
// Pout<< adjacentVertices.size() << endl;
|
||||
|
||||
for
|
||||
(
|
||||
std::list<Vertex_handle>::iterator
|
||||
avit = adjacentVertices.begin();
|
||||
avit != adjacentVertices.end();
|
||||
++avit
|
||||
)
|
||||
{
|
||||
Vertex_handle avh = *avit;
|
||||
|
||||
// The lower indexed vertex will perform the assessment
|
||||
if
|
||||
(
|
||||
avh->index() >= startOfSurfacePoints_
|
||||
&& avh->internalOrBoundaryPoint()
|
||||
&& vit->index() < avh->index()
|
||||
&& vit->type() != avh->type()
|
||||
)
|
||||
{
|
||||
scalar targetSize = 0.2*averageAnyCellSize(vit, avh);
|
||||
|
||||
// Pout<< "diff " << mag(pt - topoint(avh->point()))
|
||||
// << " " << targetSize << endl;
|
||||
|
||||
if
|
||||
(
|
||||
magSqr(pt - topoint(avh->point()))
|
||||
< sqr(targetSize)
|
||||
)
|
||||
{
|
||||
Pout<< nl << "vit: " << vit->index() << " "
|
||||
<< topoint(vit->point())
|
||||
<< endl;
|
||||
|
||||
Pout<< " adjacent too close: "
|
||||
<< avh->index() << " "
|
||||
<< topoint(avh->point())
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::conformalVoronoiMesh::limitDisplacement
|
||||
(
|
||||
const Delaunay::Finite_vertices_iterator& vit,
|
||||
|
||||
Reference in New Issue
Block a user