Commit 8014716b authored by Franjo's avatar Franjo
Browse files

Merge branch 'development' into release

parents 5cc5c1c2 944c8360
...@@ -1344,6 +1344,8 @@ void extrudeLayer::updateBoundary() ...@@ -1344,6 +1344,8 @@ void extrudeLayer::updateBoundary()
PtrList<boundaryPatch>& boundaries = meshModifier.boundariesAccess(); PtrList<boundaryPatch>& boundaries = meshModifier.boundariesAccess();
forAll(boundaries, patchI) forAll(boundaries, patchI)
boundaries[patchI].patchType() = patchTypes[patchI]; boundaries[patchI].patchType() = patchTypes[patchI];
meshModifier.clearAll();
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
...@@ -1375,6 +1377,8 @@ extrudeLayer::extrudeLayer ...@@ -1375,6 +1377,8 @@ extrudeLayer::extrudeLayer
updateBoundary(); updateBoundary();
mesh_.clearAddressingData();
# ifdef DEBUGExtrudeLayer # ifdef DEBUGExtrudeLayer
polyMeshGenChecks::checkMesh(mesh_, true); polyMeshGenChecks::checkMesh(mesh_, true);
# endif # endif
......
...@@ -107,7 +107,7 @@ void meshOctree::findNearestSurfacePoint ...@@ -107,7 +107,7 @@ void meshOctree::findNearestSurfacePoint
if( !found ) if( !found )
sizeVec *= 2.0; sizeVec *= 2.0;
} while( !found && (iterationI++ < 5) ); } while( !found && (iterationI++ < 100) );
# ifdef DEBUGSearch # ifdef DEBUGSearch
forAll(surface_, triI) forAll(surface_, triI)
......
...@@ -54,6 +54,14 @@ label meshOctree::findLeafContainingVertex ...@@ -54,6 +54,14 @@ label meshOctree::findLeafContainingVertex
# ifdef OCTREE_DEBUG # ifdef OCTREE_DEBUG
Info << "Vertex " << p << " is not in the initial cube" << endl; Info << "Vertex " << p << " is not in the initial cube" << endl;
# endif # endif
FatalErrorIn
(
"label meshOctree::findLeafContainingVertex(const point&) const"
) << "Point " << p << " is not inside the initial cube" << endl;
throw "Found invalid locations of points";
return -1; return -1;
} }
......
...@@ -36,7 +36,11 @@ Description ...@@ -36,7 +36,11 @@ Description
#include <omp.h> #include <omp.h>
# endif # endif
// #define DEBUGSearch //#define DEBUGSheets
# ifdef DEBUGSheets
#include "helperFunctions.H"
# endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...@@ -69,8 +73,6 @@ void createFundamentalSheetsJFS::createInitialSheet() ...@@ -69,8 +73,6 @@ void createFundamentalSheetsJFS::createInitialSheet()
boundaries[boundaries.size()-1].patchSize() boundaries[boundaries.size()-1].patchSize()
); );
faceListPMG::subList bFaces(mesh_.faces(), end-start, start);
const labelList& owner = mesh_.owner(); const labelList& owner = mesh_.owner();
LongList<labelPair> extrudeFaces(end-start); LongList<labelPair> extrudeFaces(end-start);
...@@ -99,8 +101,43 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges() ...@@ -99,8 +101,43 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges()
); );
faceListPMG::subList bFaces(mesh_.faces(), end-start, start); faceListPMG::subList bFaces(mesh_.faces(), end-start, start);
labelList facePatch(bFaces.size());
forAll(boundaries, patchI)
{
const label patchStart = boundaries[patchI].patchStart();
const label patchEnd = patchStart + boundaries[patchI].patchSize();
labelList patchCell(mesh_.cells().size()); for(label faceI=patchStart;faceI<patchEnd;++faceI)
{
facePatch[faceI-start] = patchI;
}
}
List<DynList<label, 3> > patchCell(mesh_.cells().size());
forAll(facePatch, bfI)
patchCell[owner[start+bfI]].appendIfNotIn(facePatch[bfI]);
# ifdef DEBUGSheets
labelList patchSheetId(boundaries.size());
forAll(patchSheetId, patchI)
patchSheetId[patchI] =
mesh_.addCellSubset("sheetPatch_"+help::labelToText(patchI));
forAll(patchCell, cellI)
{
if( patchCell[cellI].size() > 1 )
Warning << "Cell " << cellI
<< " is in patches " << patchCell[cellI] << endl;
forAll(patchCell[cellI], patchI)
mesh_.addCellToSubset
(
patchSheetId[patchCell[cellI][patchI]],
cellI
);
}
# endif
LongList<labelPair> front; LongList<labelPair> front;
...@@ -129,10 +166,13 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges() ...@@ -129,10 +166,13 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges()
# ifdef USE_OMP # ifdef USE_OMP
# pragma omp for # pragma omp for
# endif # endif
for(label faceI=start;faceI<end;++faceI) forAll(facePatch, bfI)
{ {
const cell& c = cells[owner[faceI]]; const label faceI = start + bfI;
const label patchI = mesh_.faceIsInPatch(faceI); const label cellI = owner[faceI];
const cell& c = cells[cellI];
const label patchI = facePatch[bfI];
forAll(c, fI) forAll(c, fI)
{ {
...@@ -140,11 +180,11 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges() ...@@ -140,11 +180,11 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges()
continue; continue;
label nei = owner[c[fI]]; label nei = owner[c[fI]];
if( nei == owner[faceI] ) if( nei == cellI )
nei = neighbour[c[fI]]; nei = neighbour[c[fI]];
if( patchCell[nei] != patchI ) if( !patchCell[nei].contains(patchI) )//patchCell[nei] != patchI )
localFront.append(labelPair(c[fI], owner[faceI])); localFront.append(labelPair(c[fI], cellI));
} }
} }
...@@ -166,6 +206,19 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges() ...@@ -166,6 +206,19 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges()
front[frontStart+lfI] = localFront[lfI]; front[frontStart+lfI] = localFront[lfI];
} }
# ifdef DEBUGSheets
const label fId = mesh_.addFaceSubset("facesForFundamentalSheets");
const label cId = mesh_.addCellSubset("cellsForFundamentalSheets");
forAll(front, fI)
{
mesh_.addFaceToSubset(fId, front[fI].first());
mesh_.addCellToSubset(cId, front[fI].second());
}
mesh_.write();
# endif
//- extrude the layer //- extrude the layer
extrudeLayer(mesh_, front); extrudeLayer(mesh_, front);
} }
......
...@@ -876,6 +876,7 @@ void edgeExtractor::distributeBoundaryFaces() ...@@ -876,6 +876,7 @@ void edgeExtractor::distributeBoundaryFaces()
} }
else else
{ {
pointPatch_[bpI] = nPatches;
FatalErrorIn FatalErrorIn
( (
"void meshSurfaceEdgeExtractorNonTopo::" "void meshSurfaceEdgeExtractorNonTopo::"
...@@ -909,6 +910,8 @@ void edgeExtractor::distributeBoundaryFaces() ...@@ -909,6 +910,8 @@ void edgeExtractor::distributeBoundaryFaces()
} }
else else
{ {
facePatch_[bfI] = nPatches;
FatalErrorIn FatalErrorIn
( (
"void meshSurfaceEdgeExtractorNonTopo::" "void meshSurfaceEdgeExtractorNonTopo::"
......
...@@ -16,7 +16,7 @@ object meshDict; ...@@ -16,7 +16,7 @@ object meshDict;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
maxCellSize 40; maxCellSize 40;
surfaceFile "surfaceMeshes/bunnyWrapped.fms"; surfaceFile "bunnyWrapped.stl";
objectRefinements objectRefinements
{ {
......
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