Commit ab9a7dcb authored by franjo_j@hotmail.com's avatar franjo_j@hotmail.com
Browse files

Improved smoothing of mesh surface + cleanup of unncessary stuff


git-svn-id: https://pl5.projectlocker.com/igui/meshGeneration/svn@52 fdcce57e-7e00-11e2-b579-49867b4cea03
parent 2f146c0b
......@@ -31,7 +31,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "objectRegistry.H"
#include "Time.H"
#include "cartesian2DMeshGenerator.H"
......@@ -49,12 +48,12 @@ int main(int argc, char *argv[])
//- 2d cartesian mesher cannot be run in parallel
argList::noParallel();
cartesian2DMeshGenerator omg(runTime);
cartesian2DMeshGenerator cmg(runTime);
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s\n"
<< "ClockTime = " << runTime.elapsedClockTime() << " s" << endl;
omg.writeMesh();
cmg.writeMesh();
Info << "End\n" << endl;
return 0;
......
......@@ -46,12 +46,12 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
cartesianMeshGenerator omg(runTime);
cartesianMeshGenerator cmg(runTime);
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s\n"
<< "ClockTime = " << runTime.elapsedClockTime() << " s" << endl;
omg.writeMesh();
cmg.writeMesh();
Info << "End\n" << endl;
return 0;
......
......@@ -46,12 +46,15 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
hexMeshGenerator omg(runTime);
//- hex mesher cannot be run in parallel yet
argList::noParallel();
hexMeshGenerator hmg(runTime);
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s\n"
<< "ClockTime = " << runTime.elapsedClockTime() << " s" << endl;
omg.writeMesh();
hmg.writeMesh();
Info << "End\n" << endl;
return 0;
......
......@@ -45,12 +45,15 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
voronoiMeshGenerator omg(runTime);
//- polyhedral mesher cannot be run in parallel yet
argList::noParallel();
voronoiMeshGenerator pmg(runTime);
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s\n"
<< "ClockTime = " << runTime.elapsedClockTime() << endl;
omg.writeMesh();
pmg.writeMesh();
Info << "End\n" << endl;
return 0;
......
......@@ -45,12 +45,15 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
tetMeshGenerator omg(runTime);
//- tetrahedral mesher cannot be run in parallel yet
argList::noParallel();
tetMeshGenerator tmg(runTime);
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s\n"
<< "ClockTime = " << runTime.elapsedClockTime() << endl;
omg.writeMesh();
tmg.writeMesh();
Info << "End\n" << endl;
return 0;
......
......@@ -50,13 +50,6 @@ Description
#include "checkBoundaryFacesSharingTwoEdges.H"
//#define DEBUG
//#define DEBUGfpma
//#define DEBUGEnsight
# ifdef DEBUG
#include "writeMeshEnsight.H"
#include "writeMeshFPMA.H"
# endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -80,11 +73,6 @@ void cartesian2DMeshGenerator::createCartesianMesh()
# ifdef DEBUG
mesh_.write();
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "cartesianMesh");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "cartesianMesh");
# endif
//::exit(EXIT_FAILURE);
# endif
}
......@@ -115,11 +103,6 @@ void cartesian2DMeshGenerator::surfacePreparation()
# ifdef DEBUG
mesh_.write();
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "afterTopoCleaning");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "afterTopoCleaning");
# endif
//::exit(EXIT_FAILURE);
# endif
}
......@@ -137,11 +120,6 @@ void cartesian2DMeshGenerator::mapMeshToSurface()
mapper.preMapVertices();
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "preMappedMesh");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "preMappedMesh");
# endif
mesh_.write();
//::exit(EXIT_FAILURE);
# endif
......@@ -150,13 +128,8 @@ void cartesian2DMeshGenerator::mapMeshToSurface()
mapper.mapVerticesOntoSurface();
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "afterMapping");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "afterMapping");
# endif
mesh_.write();
::exit(0);
//::exit(EXIT_SUCCESS);
# endif
deleteDemandDrivenData(msePtr);
......@@ -168,13 +141,7 @@ void cartesian2DMeshGenerator::mapEdgesAndCorners()
# ifdef DEBUG
mesh_.write();
::exit(0);
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "withEdges");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "withEdges");
#endif
::exit(0);
//::exit(0);
# endif
}
......@@ -187,12 +154,7 @@ void cartesian2DMeshGenerator::optimiseMeshSurface()
# ifdef DEBUG
mesh_.write();
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "optSurfaceWithEdges");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "optSurfaceWithEdges");
#endif
::exit(0);
//::exit(0);
# endif
}
......@@ -205,11 +167,6 @@ void cartesian2DMeshGenerator::generateBoundaryLayers()
bl.addLayerForAllPatches();
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "meshWithBndLayer");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "meshWithBndLayer");
# endif
mesh_.write();
//::exit(0);
# endif
......@@ -240,11 +197,8 @@ void cartesian2DMeshGenerator::replaceBoundaries()
renameBoundaryPatches rbp(mesh_, meshDict_);
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_,"renamedPatchesMesh");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "renamedPatchesMesh");
#endif
mesh_.write();
//::exit(0);
# endif
}
......@@ -253,11 +207,8 @@ void cartesian2DMeshGenerator::renumberMesh()
polyMeshGenModifier(mesh_).renumberMesh();
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_,"renumberedMesh");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "renumberedMesh");
#endif
mesh_.write();
//::exit(0);
# endif
}
......
......@@ -30,14 +30,12 @@ Description
#include "triSurf.H"
#include "triSurfacePatchManipulator.H"
#include "demandDrivenData.H"
#include "objectRegistry.H"
#include "Time.H"
#include "meshOctreeCreator.H"
#include "cartesianMeshExtractor.H"
#include "meshSurfaceEngine.H"
#include "meshSurfaceMapper.H"
#include "meshSurfaceEdgeExtractorNonTopo.H"
#include "surfaceMorpherCells.H"
#include "meshOptimizer.H"
#include "meshSurfaceOptimizer.H"
#include "topologicalCleaner.H"
......@@ -52,13 +50,6 @@ Description
#include "removeCellsInSelectedDomains.H"
//#define DEBUG
//#define DEBUGfpma
//#define DEBUGEnsight
# ifdef DEBUG
#include "writeMeshEnsight.H"
#include "writeMeshFPMA.H"
# endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -82,12 +73,7 @@ void cartesianMeshGenerator::createCartesianMesh()
# ifdef DEBUG
mesh_.write();
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "cartesianMesh");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "cartesianMesh");
# endif
//::exit(EXIT_FAILURE);
//::exit(EXIT_SUCCESS);
# endif
}
......@@ -121,9 +107,6 @@ void cartesianMeshGenerator::surfacePreparation()
}
rCells.removeCells();
//mesh_.write();
//::exit(1);
}
......@@ -151,12 +134,8 @@ void cartesianMeshGenerator::surfacePreparation()
# ifdef DEBUG
mesh_.write();
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "afterTopoCleaning");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "afterTopoCleaning");
# endif
//::exit(EXIT_FAILURE);
returnReduce(1, sumOp<label>());
//::exit(EXIT_SUCCESS);
# endif
}
......@@ -170,39 +149,25 @@ void cartesianMeshGenerator::mapMeshToSurface()
mapper.preMapVertices();
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "preMappedMesh");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "preMappedMesh");
# endif
mesh_.write();
//::exit(EXIT_FAILURE);
returnReduce(1, sumOp<label>());
//::exit(EXIT_SUCCESS);
# endif
//- map mesh surface on the geometry surface
mapper.mapVerticesOntoSurface();
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "afterMapping");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "afterMapping");
# endif
mesh_.write();
//::exit(EXIT_FAILURE);
//::exit(EXIT_SUCCESS);
# endif
//- untangle surface faces
meshSurfaceOptimizer(*msePtr, *octreePtr_).preOptimizeSurface();
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "afterSurfaceSmoothing");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "afterSurfaceSmoothing");
# endif
mesh_.write();
::exit(EXIT_FAILURE);
//::exit(EXIT_SUCCESS);
# endif
deleteDemandDrivenData(msePtr);
......@@ -213,16 +178,8 @@ void cartesianMeshGenerator::mapEdgesAndCorners()
meshSurfaceEdgeExtractorNonTopo(mesh_, *octreePtr_);
# ifdef DEBUG
//mesh_.write();
meshOptimizer(mesh_).optimizeSurface(*octreePtr_);
mesh_.write();
::exit(EXIT_FAILURE);
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "withEdges");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "withEdges");
#endif
//::exit(EXIT_FAILURE);
//::exit(EXIT_SUCCESS);
# endif
}
......@@ -233,12 +190,7 @@ void cartesianMeshGenerator::optimiseMeshSurface()
# ifdef DEBUG
mesh_.write();
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "optSurfaceWithEdges");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "optSurfaceWithEdges");
#endif
//::exit(EXIT_FAILURE);
//::exit(EXIT_SUCCESS);
# endif
}
......@@ -275,13 +227,8 @@ void cartesianMeshGenerator::generateBoundaryLayers()
bl.addLayerForAllPatches();
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "meshWithBndLayer");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "meshWithBndLayer");
# endif
mesh_.write();
//::exit(EXIT_FAILURE);
//::exit(EXIT_SUCCESS);
# endif
}
......@@ -314,11 +261,8 @@ void cartesianMeshGenerator::optimiseFinalMesh()
optimizer.optimizeMeshFV();
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_,"optimisedMesh");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "optimisedMesh");
#endif
mesh_.write();
//::exit(EXIT_SUCCESS);
# endif
}
......@@ -327,11 +271,8 @@ void cartesianMeshGenerator::replaceBoundaries()
renameBoundaryPatches rbp(mesh_, meshDict_);
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_,"renamedPatchesMesh");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "renamedPatchesMesh");
#endif
mesh_.write();
//::exit(EXIT_SUCCESS);
# endif
}
......@@ -340,11 +281,8 @@ void cartesianMeshGenerator::renumberMesh()
polyMeshGenModifier(mesh_).renumberMesh();
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_,"renumberedMesh");
# elif DEBUGEnsight
writeMeshEnsight(mesh_, "renumberedMesh");
#endif
mesh_.write();
//::exit(EXIT_SUCCESS);
# endif
}
......
......@@ -45,12 +45,6 @@ Description
#include "checkMeshDict.H"
//#define DEBUG
//#define DEBUGfpma
# ifdef DEBUG
#include "writeMeshEnsight.H"
#include "writeMeshFPMA.H"
# endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -67,11 +61,6 @@ void dualMeshGenerator::generateDualMesh()
# ifdef DEBUG
mesh_.write();
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "dualMesh");
# else
writeMeshEnsight(mesh_, "dualMesh");
# endif
//::exit(EXIT_FAILURE);
# endif
}
......@@ -90,11 +79,6 @@ void dualMeshGenerator::surfacePreparation()
# ifdef DEBUG
mesh_.write();
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "afterTopoCleaning");
# else
writeMeshEnsight(mesh_, "afterTopoCleaning");
# endif
//::exit(EXIT_FAILURE);
# endif
}
......@@ -108,11 +92,6 @@ void dualMeshGenerator::mapMeshToSurface()
meshSurfaceMapper(*msePtr, *octreePtr_).mapVerticesOntoSurface();
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "afterMapping");
# else
writeMeshEnsight(mesh_, "afterMapping");
# endif
mesh_.write();
//::exit(EXIT_FAILURE);
# endif
......@@ -121,12 +100,6 @@ void dualMeshGenerator::mapMeshToSurface()
meshSurfaceOptimizer(*msePtr, *octreePtr_).preOptimizeSurface();
# ifdef DEBUG
//meshOptimizer(*octreePtr_, mesh_).preOptimize();
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "afterSurfaceSmoothing");
# else
writeMeshEnsight(mesh_, "afterSurfaceSmoothing");
# endif
mesh_.write();
//::exit(EXIT_FAILURE);
# endif
......@@ -138,11 +111,6 @@ void dualMeshGenerator::mapMeshToSurface()
# ifdef DEBUG
mesh_.write();
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "withEdges");
# else
writeMeshEnsight(mesh_, "withEdges");
#endif
//::exit(EXIT_FAILURE);
# endif
}
......@@ -154,11 +122,6 @@ void dualMeshGenerator::optimiseMeshSurface()
# ifdef DEBUG
mesh_.write();
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "optSurfaceWithEdges");
# else
writeMeshEnsight(mesh_, "optSurfaceWithEdges");
#endif
//::exit(EXIT_FAILURE);
# endif
}
......@@ -175,12 +138,6 @@ void dualMeshGenerator::checkConcaveEdges()
# ifdef DEBUG
mesh_.write();
//meshOptimizer(*octreePtr_, mesh_).preOptimize();
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "correctedEdges");
# else
writeMeshEnsight(mesh_, "correctedEdges");
#endif
//::exit(EXIT_FAILURE);
# endif
}
......@@ -214,11 +171,6 @@ void dualMeshGenerator::generateBoudaryLayers()
}
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_, "meshWithBndLayer");
# else
writeMeshEnsight(mesh_, "meshWithBndLayer");
# endif
mesh_.write();
//::exit(EXIT_FAILURE);
# endif
......@@ -236,11 +188,8 @@ void dualMeshGenerator::optimiseFinalMesh()
optimizer.optimizeMeshFV();
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_,"optimisedMesh");
# else
writeMeshEnsight(mesh_, "optimisedMesh");
#endif
mesh_.write();
//::exit(0);
# endif
}
......@@ -249,11 +198,8 @@ void dualMeshGenerator::replaceBoundaries()
renameBoundaryPatches rbp(mesh_, meshDict_);
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_,"renamedPatchesMesh");
# else
writeMeshEnsight(mesh_, "renamedPatchesMesh");
#endif
mesh_.write();
//::exit(0);
# endif
}
......@@ -262,11 +208,8 @@ void dualMeshGenerator::renumberMesh()
polyMeshGenModifier(mesh_).renumberMesh();
# ifdef DEBUG
# ifdef DEBUGfpma
writeMeshFPMA(mesh_,"renumberedMesh");
# else
writeMeshEnsight(mesh_, "renumberedMesh");
#endif
mesh_.write();
//::exit(0);
# endif
}
......
......@@ -35,7 +35,6 @@ Description
//#define DEBUGEdges
# ifdef DEBUGEdges
#include "writeMeshEnsight.H"
#include "primitiveMesh.H"
# endif
......@@ -43,16 +42,16 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void dualUnfoldConcaveCells::replaceBoundary()
{
const PtrList<boundaryPatch>& boundaries = mesh_.boundaries();
wordList patchNames(boundaries.size());
forAll(boundaries, patchI)
patchNames[patchI] = boundaries[patchI].patchName();