Commit 604598da authored by franjo.juretic@c-fields.com's avatar franjo.juretic@c-fields.com
Browse files

Bug fixes + improved handling of boundary layers


git-svn-id: https://pl5.projectlocker.com/igui/meshGeneration/svn@69 fdcce57e-7e00-11e2-b579-49867b4cea03
parent f8aa1261
......@@ -217,8 +217,6 @@ void cartesianMeshGenerator::refBoundaryLayers()
refLayers.refineLayers();
meshOptimizer optimizer(mesh_);
optimizer.optimizeLowQualityFaces();
optimizer.untangleMeshFV();
}
}
......
......@@ -45,6 +45,7 @@ Description
#include "renameBoundaryPatches.H"
#include "checkMeshDict.H"
#include "triSurfacePatchManipulator.H"
#include "refineBoundaryLayers.H"
//#define DEBUG
......@@ -153,29 +154,7 @@ void hexMeshGenerator::generateBoundaryLayers()
{
boundaryLayers bl(mesh_);
if( meshDict_.found("boundaryLayers") )
{
wordList createLayers;
if( meshDict_.isDict("boundaryLayers") )
{
const dictionary& dict = meshDict_.subDict("boundaryLayers");
createLayers = dict.toc();
}
else
{
wordList bndLayers(meshDict_.lookup("boundaryLayers"));
createLayers.transfer(bndLayers);
}
forAll(createLayers, patchI)
bl.addLayerForPatch(createLayers[patchI]);
}
else
{
//bl.createOTopologyLayers();
bl.addLayerForAllPatches();
}
bl.addLayerForAllPatches();
# ifdef DEBUG
mesh_.write();
......@@ -183,6 +162,22 @@ void hexMeshGenerator::generateBoundaryLayers()
# endif
}
void hexMeshGenerator::refBoundaryLayers()
{
if( meshDict_.isDict("boundaryLayers") )
{
refineBoundaryLayers refLayers(mesh_);
refineBoundaryLayers::readSettings(meshDict_, refLayers);
refLayers.refineLayers();
meshOptimizer optimizer(mesh_);
optimizer.untangleMeshFV();
}
}
void hexMeshGenerator::optimiseFinalMesh()
{
//- final optimisation
......
......@@ -94,6 +94,9 @@ class hexMeshGenerator
//- mesh optimisation
void optimiseFinalMesh();
//- refine boundary layers
void refBoundaryLayers();
//- replace boundaries
void replaceBoundaries();
......
......@@ -175,6 +175,8 @@ void tetMeshGenerator::optimiseFinalMesh()
deleteDemandDrivenData(octreePtr_);
optimizer.optimizeMeshFV();
optimizer.optimizeLowQualityFaces();
optimizer.optimizeMeshFV();
# ifdef DEBUG
......@@ -195,7 +197,6 @@ void tetMeshGenerator::refBoundaryLayers()
meshOptimizer optimizer(mesh_);
optimizer.optimizeLowQualityFaces();
optimizer.untangleMeshFV();
}
}
......
......@@ -1127,7 +1127,6 @@ void refineBoundaryLayers::generateNewVertices()
<< " param " << param
<< " new point " << nPoints
<< " has coordinates " << newP << endl;
}
# endif
param += firstThickness * Foam::pow(thicknessRatio[seI], pI);
......
......@@ -249,6 +249,7 @@ void decomposeCells::addNewCells()
);
polyMeshGenModifier(mesh_).removeUnusedVertices();
polyMeshGenModifier(mesh_).clearAll();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
......
......@@ -32,6 +32,10 @@ Description
#include "polyMeshGenFaces.H"
# ifdef USE_OMP
#include <omp.h>
# endif
namespace Foam
{
......@@ -45,7 +49,18 @@ inline const faceListPMG& polyMeshGenFaces::faces() const
inline label polyMeshGenFaces::nInternalFaces() const
{
if( !(ownerPtr_ && neighbourPtr_) )
{
# ifdef USE_OMP
if( omp_in_parallel() )
FatalErrorIn
(
"inline label polyMeshGenFaces::nInternalFaces() const"
) << "Calculating addressing inside a parallel region."
<< " This is not thread safe" << exit(FatalError);
# endif
calculateOwnersAndNeighbours();
}
return nIntFaces_;
}
......@@ -53,7 +68,18 @@ inline label polyMeshGenFaces::nInternalFaces() const
inline const labelList& polyMeshGenFaces::owner() const
{
if( !ownerPtr_ )
{
# ifdef USE_OMP
if( omp_in_parallel() )
FatalErrorIn
(
"inline label polyMeshGenFaces::owner() const"
) << "Calculating addressing inside a parallel region."
<< " This is not thread safe" << exit(FatalError);
# endif
calculateOwnersAndNeighbours();
}
return *ownerPtr_;
}
......@@ -61,7 +87,18 @@ inline const labelList& polyMeshGenFaces::owner() const
inline const labelList& polyMeshGenFaces::neighbour() const
{
if( !neighbourPtr_ )
{
# ifdef USE_OMP
if( omp_in_parallel() )
FatalErrorIn
(
"inline label polyMeshGenFaces::neighbour() const"
) << "Calculating addressing inside a parallel region."
<< " This is not thread safe" << exit(FatalError);
# endif
calculateOwnersAndNeighbours();
}
return *neighbourPtr_;
}
......
......@@ -188,6 +188,7 @@ void checkCellConnectionsOverFaces::findCellGroups()
{
Info << "Checking cell connections" << endl;
mesh_.owner();
nGroups_ =
help::groupMarking
(
......
......@@ -35,13 +35,12 @@ Description
#include "voronoiMeshExtractor.H"
#include "meshSurfaceEngine.H"
#include "meshSurfaceMapper.H"
//#include "meshSurfaceEdgeExtractorNonTopo.H"
//#include "decomposeCellsNearConcaveEdges.H"
#include "surfaceMorpherCells.H"
#include "meshOptimizer.H"
#include "meshSurfaceOptimizer.H"
#include "topologicalCleaner.H"
#include "boundaryLayers.H"
#include "refineBoundaryLayers.H"
#include "renameBoundaryPatches.H"
#include "checkMeshDict.H"
#include "triSurfacePatchManipulator.H"
......@@ -206,6 +205,24 @@ void voronoiMeshGenerator::generateBoudaryLayers()
# endif
}
void voronoiMeshGenerator::refBoundaryLayers()
{
mesh_.write();
if( meshDict_.isDict("boundaryLayers") )
{
refineBoundaryLayers refLayers(mesh_);
refineBoundaryLayers::readSettings(meshDict_, refLayers);
refLayers.refineLayers();
meshOptimizer optimizer(mesh_);
optimizer.untangleMeshFV();
}
}
void voronoiMeshGenerator::optimiseFinalMesh()
{
//- final optimisation
......@@ -255,12 +272,12 @@ void voronoiMeshGenerator::generateMesh()
optimiseMeshSurface();
//decomposeConcaveCells();
generateBoudaryLayers();
optimiseFinalMesh();
refBoundaryLayers();
renumberMesh();
replaceBoundaries();
......
......@@ -100,6 +100,9 @@ class voronoiMeshGenerator
//- mesh optimisation
void optimiseFinalMesh();
//- refine boundary layer
void refBoundaryLayers();
//- replace boundaries
void replaceBoundaries();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment