Added control for surface conformation rebuild frequency.

Adding execution time to application.

Adding boolean control for timeChecks, setting to off.

Added determination and reporting of the net number of vertices removed during
an iteration.

Modified and cleaned up all reporting to screen.
This commit is contained in:
graham
2009-08-06 16:39:48 +01:00
parent b29a383ab8
commit 5c28dd80cd
6 changed files with 80 additions and 31 deletions

View File

@ -62,11 +62,19 @@ int main(int argc, char *argv[])
Info<< nl << "Time = " << runTime.timeName() << endl;
mesh.move();
Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
mesh.writeMesh();
Info<< nl << "End\n" << endl;
Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
Info<< nl << "End" << nl << endl;
return 0;
}

View File

@ -862,7 +862,7 @@ void Foam::conformalVoronoiMesh::storeSizesAndAlignments
{
timeCheck();
Info << " Initialise stored data" << endl;
Info << nl << " Initialise stored size and alignment data" << endl;
sizeAndAlignmentLocations_.setSize(initPts.size());
@ -885,13 +885,9 @@ void Foam::conformalVoronoiMesh::storeSizesAndAlignments
timeCheck();
Info<< " Initialise sizeAndAlignmentTree_" << endl;
buildSizeAndAlignmentTree();
timeCheck();
Info<< " Initialised" << endl;
}
@ -980,10 +976,15 @@ Foam::conformalVoronoiMesh::reconformationControl() const
return FINE;
}
else if(runTime_.timeIndex() % 10 == 0)
else if
(
runTime_.timeIndex()
% cvMeshControls().surfaceConformationRebuildFrequency()
== 0
)
{
Info<< nl << " Rebuilding surface conformation "
<< "HARD CODED TO EVERY 10 STEPS" << endl;
Info<< nl << " Rebuilding surface conformation for more iterations"
<< endl;
return COARSE;
}
@ -996,15 +997,13 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
reconformationMode reconfMode
)
{
Info<< nl << " Build surface conformation" << endl;
if (reconfMode == COARSE)
{
Info<< " Coarse surface conformation" << endl;
Info<< nl << " Build coarse surface conformation" << endl;
}
else if (reconfMode == FINE)
{
Info<< " Fine surface conformation" << endl;
Info<< nl << " Build fine surface conformation" << endl;
}
else if (reconfMode == NONE)
{
@ -1100,10 +1099,10 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
}
}
Info<< nl <<" Initial conformation " << nl
<< " number_of_vertices " << number_of_vertices() << nl
<< " surfaceHits.size() " << surfaceHits.size() << nl
<< " featureEdgeHits.size() " << featureEdgeHits.size()
Info<< nl <<" Initial conformation" << nl
<< " Number of vertices " << number_of_vertices() << nl
<< " Number of surface hits " << surfaceHits.size() << nl
<< " Number of edge hits " << featureEdgeHits.size()
<< endl;
insertSurfacePointPairs
@ -1201,10 +1200,10 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
}
}
Info<< nl <<" iterationNo " << iterationNo << nl
<< " number_of_vertices " << number_of_vertices() << nl
<< " surfaceHits.size() " << surfaceHits.size() << nl
<< " featureEdgeHits.size() " << featureEdgeHits.size()
Info<< nl <<" Conformation iteration " << iterationNo << nl
<< " Number of vertices " << number_of_vertices() << nl
<< " Number of surface hits " << surfaceHits.size() << nl
<< " Number of edge hits " << featureEdgeHits.size()
<< endl;
totalHits = surfaceHits.size() + featureEdgeHits.size();
@ -2405,7 +2404,7 @@ void Foam::conformalVoronoiMesh::move()
timeCheck();
Info<< nl << " Looping over all dual faces" << endl;
Info<< nl << " Determining vertex displacements" << endl;
vectorField cartesianDirections(3);
@ -2645,11 +2644,6 @@ void Foam::conformalVoronoiMesh::move()
vector totalDisp = sum(displacementAccumulator);
scalar totalDist = sum(mag(displacementAccumulator));
Info<< " Total displacement = " << totalDisp << nl
<< " Total distance = " << totalDist << nl
<< " Points added = " << pointsAdded
<< endl;
// Relax the calculated displacement
displacementAccumulator *= relaxation;
@ -2691,17 +2685,29 @@ void Foam::conformalVoronoiMesh::move()
timeCheck();
Info<< nl << " Reinserting entire tessellation" << endl;
Info<< nl << " Inserting displaced tessellation" << endl;
insertPoints(pointsToInsert);
startOfSurfacePointPairs_ = number_of_vertices();
label pointsRemoved =
displacementAccumulator.size()
- number_of_vertices()
+ pointsAdded;
timeCheck();
conformToSurface();
timeCheck();
Info<< nl
<< " Total displacement = " << totalDisp << nl
<< " Total distance = " << totalDist << nl
<< " Points added = " << pointsAdded << nl
<< " Points removed = " << pointsRemoved
<< endl;
}

View File

@ -28,8 +28,11 @@ License
inline void Foam::conformalVoronoiMesh::timeCheck() const
{
Info<< nl << "--- [ " << runTime_.elapsedCpuTime() << "s, delta "
<< runTime_.cpuTimeIncrement()<< "s ] --- " << endl;
if (cvMeshControls().timeChecks())
{
Info<< nl << "--- [ " << runTime_.elapsedCpuTime() << "s, delta "
<< runTime_.cpuTimeIncrement()<< "s ] --- " << endl;
}
}

View File

@ -49,6 +49,8 @@ Foam::cvControls::cvControls
spanSqr_ = sqr(span_);
timeChecks_ = false;
// Surface conformation controls
const dictionary& surfDict(cvMeshDict_.subDict("surfaceConformation"));
@ -83,7 +85,13 @@ Foam::cvControls::cvControls
surfDict.lookup("maxSurfaceProtrusionCoeff")
);
maxQuadAngle_= readScalar(surfDict.lookup("maxQuadAngle"));
maxQuadAngle_ = readScalar(surfDict.lookup("maxQuadAngle"));
surfaceConformationRebuildFrequency_ = max
(
1,
readLabel(surfDict.lookup("surfaceConformationRebuildFrequency"))
);
// Motion control controls

View File

@ -69,6 +69,9 @@ class cvControls
//- Square of span_
scalar spanSqr_;
//- Activate/deactivate detailed timeChecks during meshing
bool timeChecks_;
// Surface conformation controls
//- Point pair spacing coefficient - fraction of the local target
@ -102,6 +105,9 @@ class cvControls
// additional "mitering" lines are added
scalar maxQuadAngle_;
//- Now often to rebuild the surface conformation
label surfaceConformationRebuildFrequency_;
// Motion control controls
@ -175,6 +181,9 @@ public:
//- Return spanSqr
inline scalar spanSqr() const;
//- Return timeChecks
inline bool timeChecks() const;
//- Return the pointPairDistanceCoeff
inline scalar pointPairDistanceCoeff() const;
@ -196,6 +205,9 @@ public:
//- Return the maxQuadAngle
inline scalar maxQuadAngle() const;
//- Return the surfaceConformationRebuildFrequency
inline label surfaceConformationRebuildFrequency() const;
//- Return the objOutput Switch
inline bool objOutput() const;

View File

@ -44,6 +44,12 @@ inline Foam::scalar Foam::cvControls::spanSqr() const
}
inline bool Foam::cvControls::timeChecks() const
{
return timeChecks_;
}
inline Foam::scalar Foam::cvControls::pointPairDistanceCoeff() const
{
return pointPairDistanceCoeff_;
@ -86,6 +92,12 @@ inline Foam::scalar Foam::cvControls::maxQuadAngle() const
}
inline Foam::label Foam::cvControls::surfaceConformationRebuildFrequency() const
{
return surfaceConformationRebuildFrequency_;
}
inline bool Foam::cvControls::objOutput() const
{
return objOutput_;