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

Updates + bug fixes in createFundamentalSheetsJFS

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