Commit f99dda6c authored by Franjo's avatar Franjo
Browse files

Merge branch 'enhancement-lockPointsAfterLayerRefinement' into developmentPublicRepo

parents 09f6c276 d38bc54c
......@@ -153,7 +153,12 @@ void cartesianMeshGenerator::refBoundaryLayers()
refLayers.refineLayers();
meshOptimizer(mesh_).untangleBoundaryLayer();
labelLongList pointsInLayer;
refLayers.pointsInBndLayer(pointsInLayer);
meshOptimizer mOpt(mesh_);
mOpt.lockPoints(pointsInLayer);
mOpt.untangleBoundaryLayer();
}
}
......
......@@ -157,12 +157,12 @@ void tetMeshGenerator::optimiseFinalMesh()
optimizer.optimizeSurface(*octreePtr_);
deleteDemandDrivenData(octreePtr_);
optimizer.optimizeMeshFV();
optimizer.optimizeLowQualityFaces();
optimizer.optimizeBoundaryLayer(false);
optimizer.optimizeMeshFV();
optimizer.untangleMeshFV();
deleteDemandDrivenData(octreePtr_);
mesh_.clearAddressingData();
......@@ -214,7 +214,12 @@ void tetMeshGenerator::refBoundaryLayers()
refLayers.refineLayers();
meshOptimizer(mesh_).untangleBoundaryLayer();
labelLongList pointsInLayer;
refLayers.pointsInBndLayer(pointsInLayer);
meshOptimizer opt(mesh_);
opt.lockPoints(pointsInLayer);
opt.untangleBoundaryLayer();
}
}
......
......@@ -372,6 +372,36 @@ void refineBoundaryLayers::refineLayers()
Info << "Finished refining boundary layers" << endl;
}
void refineBoundaryLayers::pointsInBndLayer(labelLongList& layerPoints)
{
layerPoints.clear();
boolList pointInLayer(mesh_.points().size(), false);
forAll(newVerticesForSplitEdge_, seI)
{
forAllRow(newVerticesForSplitEdge_, seI, i)
pointInLayer[newVerticesForSplitEdge_(seI, i)] = true;
}
forAll(pointInLayer, pointI)
if( pointInLayer[pointI] )
layerPoints.append(pointI);
}
void refineBoundaryLayers::pointsInBndLayer(const word subsetName)
{
label sId = mesh_.pointSubsetIndex(subsetName);
if( sId < 0 )
sId = mesh_.addPointSubset(subsetName);
forAll(newVerticesForSplitEdge_, seI)
{
forAllRow(newVerticesForSplitEdge_, seI, i)
mesh_.addPointToSubset(sId, newVerticesForSplitEdge_(seI, i));
}
}
void refineBoundaryLayers::readSettings
(
const dictionary& meshDict,
......
......@@ -401,6 +401,13 @@ public:
//- performs refinement based on the given settings
void refineLayers();
// Post information
//- provide the list of points in the boundary layer
void pointsInBndLayer(labelLongList&);
//- create a subset containing points in the boundary layer
void pointsInBndLayer(const word subsetName="pointsInBndLayer");
// Static member functions
//- read the settings from dictionary
static void readSettings(const dictionary&, refineBoundaryLayers&);
......
......@@ -461,6 +461,7 @@ void meshOptimizer::untangleBoundaryLayer()
else
{
optimizeLowQualityFaces();
removeUserConstraints();
untangleMeshFV(2, 50, 1, true);
}
}
......
......@@ -73,16 +73,12 @@ void voronoiMeshGenerator::createVoronoiMesh()
void voronoiMeshGenerator::surfacePreparation()
{
//- removes unnecessary cells and morph the boundary
//- such that there is only one boundary face per cell
//- It also checks topology of cells after morphing is performed
do
{
surfaceMorpherCells* cmPtr = new surfaceMorpherCells(mesh_);
cmPtr->morphMesh();
deleteDemandDrivenData(cmPtr);
}
while( topologicalCleaner(mesh_).cleanTopology() );
//- removes unnecessary cells and morphs the boundary
//- such that there exists only one boundary face per cell
surfaceMorpherCells* cmPtr = new surfaceMorpherCells(mesh_);
cmPtr->morphMesh();
deleteDemandDrivenData(cmPtr);
# ifdef DEBUG
mesh_.write();
......@@ -149,16 +145,6 @@ void voronoiMeshGenerator::optimiseMeshSurface()
# endif
}
void voronoiMeshGenerator::decomposeConcaveCells()
{
//decomposeCellsNearConcaveEdges dm(mesh_);
# ifdef DEBUG
mesh_.write();
//::exit(EXIT_FAILURE);
# endif
}
void voronoiMeshGenerator::generateBoudaryLayers()
{
boundaryLayers bl(mesh_);
......@@ -203,7 +189,12 @@ void voronoiMeshGenerator::refBoundaryLayers()
refLayers.refineLayers();
meshOptimizer(mesh_).untangleBoundaryLayer();
labelLongList pointsInLayer;
refLayers.pointsInBndLayer(pointsInLayer);
meshOptimizer mOpt(mesh_);
mOpt.lockPoints(pointsInLayer);
mOpt.untangleBoundaryLayer();
}
}
......
......@@ -99,9 +99,6 @@ class voronoiMeshGenerator
//- optimise surface mesh
void optimiseMeshSurface();
//- decompose concave cells
void decomposeConcaveCells();
//- add boundary layers
void generateBoudaryLayers();
......
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