Commit d5d69f23 authored by Franjo's avatar Franjo
Browse files

Current status

parent 033a99f3
......@@ -165,10 +165,10 @@ void cartesianMeshGenerator::mapMeshToSurface()
//- untangle surface faces
meshSurfaceOptimizer(*msePtr, *octreePtr_).untangleSurface();
# ifdef DEBUG
//# ifdef DEBUG
mesh_.write();
//::exit(EXIT_SUCCESS);
# endif
::exit(EXIT_SUCCESS);
//# endif
deleteDemandDrivenData(msePtr);
}
......
......@@ -387,6 +387,13 @@ void partTriMesh::updateVertices(const labelLongList& movedPoints)
List<direction> updateType(pts.size(), direction(0));
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
Pout << "Creating FACECEntre flags" << endl;
returnReduce(1, sumOp<label>());
}
//- update coordinates of vertices which exist in the surface
//- of the volume mesh
# ifdef USE_OMP
......@@ -398,6 +405,9 @@ void partTriMesh::updateVertices(const labelLongList& movedPoints)
const label pointI = bPoints[bpI];
const label triPointI = meshSurfacePointLabelInTriMesh_[bpI];
if( triPointI < 0 )
continue;
pts[triPointI] = points[pointI];
updateType[triPointI] |= SMOOTH;
......@@ -410,6 +420,13 @@ void partTriMesh::updateVertices(const labelLongList& movedPoints)
}
}
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
Pout << "Created FACECEntre flags" << endl;
returnReduce(1, sumOp<label>());
}
//- update coordinates of buffer layer points
if( Pstream::parRun() )
{
......@@ -469,6 +486,13 @@ void partTriMesh::updateVertices(const labelLongList& movedPoints)
}
}
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
Pout << "Updating coordinates" << endl;
returnReduce(1, sumOp<label>());
}
//- update coordinates of FACECENTRE vertices
# ifdef USE_OMP
# pragma omp parallel for schedule(dynamic, 20)
......
......@@ -282,9 +282,31 @@ void meshSurfaceOptimizer::smoothSurfaceOptimizer
const labelLongList& selectedPoints
)
{
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
Pout << "Starting optimizer" << endl;
returnReduce(1, sumOp<label>());
}
this->triMesh();
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
Pout << "Updating tri mesh" << endl;
returnReduce(1, sumOp<label>());
}
updateTriMesh(selectedPoints);
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
Pout << "Created triMesh" << endl;
returnReduce(1, sumOp<label>());
}
pointField newPositions(selectedPoints.size());
# ifdef USE_OMP
......@@ -297,6 +319,13 @@ void meshSurfaceOptimizer::smoothSurfaceOptimizer
newPositions[i] = newPositionSurfaceOptimizer(bpI);
}
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
Pout << "Calculated new posiions" << endl;
returnReduce(1, sumOp<label>());
}
meshSurfaceEngineModifier surfaceModifier(surfaceEngine_);
# ifdef USE_OMP
......@@ -310,7 +339,20 @@ void meshSurfaceOptimizer::smoothSurfaceOptimizer
}
//- update geometry addressing for moved points
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
Pout << "Updating geometry" << endl;
returnReduce(1, sumOp<label>());
}
surfaceModifier.updateGeometry(selectedPoints);
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
Pout << "Updated geometry" << endl;
returnReduce(1, sumOp<label>());
}
}
bool meshSurfaceOptimizer::untangleSurface
......@@ -321,6 +363,13 @@ bool meshSurfaceOptimizer::untangleSurface
{
Info << "Starting untangling the surface of the volume mesh" << endl;
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
Pout << "0.Here" << endl;
returnReduce(1, sumOp<label>());
}
bool changed(false);
const labelList& bPoints = surfaceEngine_.boundaryPoints();
......@@ -347,6 +396,13 @@ bool meshSurfaceOptimizer::untangleSurface
forAll(selectedBoundaryPoints, i)
smoothVertex[selectedBoundaryPoints[i]] = true;
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
Pout << "1.Here" << endl;
returnReduce(1, sumOp<label>());
}
meshSurfaceEngineModifier surfaceModifier(surfaceEngine_);
meshSurfaceMapper mapper(surfaceEngine_, meshOctree_);
......@@ -370,6 +426,17 @@ bool meshSurfaceOptimizer::untangleSurface
nInvertedTria =
findInvertedVertices(smoothVertex, nAdditionalLayers);
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
{
Pout << "Num inverted points " << nInvertedTria << endl;
Pout << "Min num inverted " << minNumInverted << endl;
}
returnReduce(1, sumOp<label>());
}
if( nInvertedTria == 0 ) break;
//- find the min number of inverted points and
......@@ -435,26 +502,79 @@ bool meshSurfaceOptimizer::untangleSurface
}
//- smooth edge vertices
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
{
Pout << "Smoothing edges" << endl;
}
returnReduce(1, sumOp<label>());
}
smoothEdgePoints(movedEdgePoints, procEdgePoints);
if( remapVertex )
mapper.mapEdgeNodes(movedEdgePoints);
surfaceModifier.updateGeometry(movedEdgePoints);
//- use laplacian smoothing
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
{
Pout << "Smoothing using laplace" << endl;
}
returnReduce(1, sumOp<label>());
}
smoothLaplacianFC(movedPoints, procBndPoints);
surfaceModifier.updateGeometry(movedPoints);
//- use surface optimizer
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
{
Pout << "Smoothing surface optimizer" << endl;
}
returnReduce(1, sumOp<label>());
}
smoothSurfaceOptimizer(movedPoints);
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
{
Pout << "Remapping vertices" << endl;
}
returnReduce(1, sumOp<label>());
}
if( remapVertex )
mapper.mapVerticesOntoSurface(movedPoints);
//- update normals and other geometric data
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
{
Pout << "Updating points" << endl;
}
returnReduce(1, sumOp<label>());
}
surfaceModifier.updateGeometry(movedPoints);
} while( nInvertedTria && (++nIter < 20) );
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
Pout << "2.Here" << endl;
returnReduce(1, sumOp<label>());
}
if( nInvertedTria > 0 )
{
//- use the combination with the minimu number of inverted points
......@@ -501,6 +621,9 @@ bool meshSurfaceOptimizer::untangleSurface
bool meshSurfaceOptimizer::untangleSurface(const label nAdditionalLayers)
{
Pout << "Selecting all points " << endl;
returnReduce(1, sumOp<label>());
labelLongList selectedPts(surfaceEngine_.boundaryPoints().size());
forAll(selectedPts, i)
selectedPts[i] = i;
......
......@@ -2391,6 +2391,9 @@ void edgeExtractor::extractEdges()
distributeBoundaryFacesNormalAlignment();
Pout << "aaaabbcc" << endl;
returnReduce(1, sumOp<label>());
# ifdef DEBUGEdgeExtractor
const triSurf* sPtr = surfaceWithPatches();
sPtr->writeSurface("initialDistributionOfPatches.stl");
......
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