Commit 1f69e33b authored by Franjo's avatar Franjo
Browse files

Updates + bug fixes in createFundamentalSheetsJFS

parent d5405537
...@@ -36,7 +36,11 @@ Description ...@@ -36,7 +36,11 @@ Description
#include <omp.h> #include <omp.h>
# endif # endif
#define DEBUGSheets //#define DEBUGSheets
# ifdef DEBUGSheets
#include "helperFunctions.H"
# endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...@@ -98,6 +102,7 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges() ...@@ -98,6 +102,7 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges()
faceListPMG::subList bFaces(mesh_.faces(), end-start, start); faceListPMG::subList bFaces(mesh_.faces(), end-start, start);
labelList facePatch(bFaces.size()); labelList facePatch(bFaces.size());
forAll(boundaries, patchI) forAll(boundaries, patchI)
{ {
const label patchStart = boundaries[patchI].patchStart(); const label patchStart = boundaries[patchI].patchStart();
...@@ -105,16 +110,34 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges() ...@@ -105,16 +110,34 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges()
for(label faceI=patchStart;faceI<patchEnd;++faceI) for(label faceI=patchStart;faceI<patchEnd;++faceI)
{ {
# ifdef USE_OMP facePatch[faceI-start] = patchI;
# pragma omp task firstprivate(faceI) shared(facePatch)
# endif
{
facePatch[faceI] = patchI;
}
} }
} }
labelList patchCell(mesh_.cells().size()); 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;
...@@ -143,10 +166,13 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges() ...@@ -143,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 = facePatch[faceI - start]; const label cellI = owner[faceI];
const cell& c = cells[cellI];
const label patchI = facePatch[bfI];
forAll(c, fI) forAll(c, fI)
{ {
...@@ -154,11 +180,11 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges() ...@@ -154,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));
} }
} }
......
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