Commit 025222fa authored by Franjo's avatar Franjo
Browse files

Added surface smoothing

parent fee9c3af
EXE_INC = \ EXE_INC = \
-I../../meshLibrary/lnInclude \ -I../../meshLibrary/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lmeshTools \ -lmeshTools \
-ltriSurface \
-L$(FOAM_USER_LIBBIN) \ -L$(FOAM_USER_LIBBIN) \
-lmeshLibrary -lmeshLibrary
...@@ -31,6 +31,8 @@ Description ...@@ -31,6 +31,8 @@ Description
#include "Time.H" #include "Time.H"
#include "polyMeshGenModifier.H" #include "polyMeshGenModifier.H"
#include "meshOptimizer.H" #include "meshOptimizer.H"
#include "meshSurfaceOptimizer.H"
#include "meshSurfaceEngine.H"
using namespace Foam; using namespace Foam;
...@@ -102,18 +104,49 @@ int main(int argc, char *argv[]) ...@@ -102,18 +104,49 @@ int main(int argc, char *argv[])
} }
else else
{ {
Info << "No constraints pplied on the smoothing procedure" << endl; Info << "No constraints applied on the smoothing procedure" << endl;
} }
//- load the mesh from disk //- load the mesh from disk
polyMeshGen pmg(runTime); polyMeshGen pmg(runTime);
pmg.read(); pmg.read();
//- construct the surface smoother
meshSurfaceEngine mse(pmg);
meshSurfaceOptimizer surfOpt(mse);
//- construct the smoother //- construct the smoother
meshOptimizer mOpt(pmg); meshOptimizer mOpt(pmg);
if( !constrainedCellSet.empty() ) if( !constrainedCellSet.empty() )
mOpt.lockCells(constrainedCellSet); {
//- lock cells in constrainedCellSet
mOpt.lockCellsInSubset(constrainedCellSet);
//- find boundary faces which shall be locked
labelLongList lockedBndFaces, selectedCells;
const label sId = pmg.cellSubsetIndex(constrainedCellSet);
pmg.cellsInSubset(sId, selectedCells);
boolList activeCell(pmg.cells().size(), false);
forAll(selectedCells, i)
activeCell[selectedCells[i]] = true;
const labelList& faceOwner = mse.faceOwners();
forAll(faceOwner, bfI)
if( activeCell[faceOwner[bfI]] )
lockedBndFaces.append(bfI);
//- lock boundary faces
surfOpt.lockBoundaryFaces(lockedBndFaces);
}
//- optimise mesh surface
surfOpt.optimizeSurface(nSurfaceIterations);
//- clear geometry information before volume smoothing
pmg.clearAddressingData();
//- perform optimisation using the laplace smoother and //- perform optimisation using the laplace smoother and
mOpt.optimizeMeshFV mOpt.optimizeMeshFV
......
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