Commit 45000e33 authored by franjo.juretic@c-fields.com's avatar franjo.juretic@c-fields.com
Browse files

Updates of surface morpher + error checking in boundary layer refinement


git-svn-id: https://pl5.projectlocker.com/igui/meshGeneration/svn@71 fdcce57e-7e00-11e2-b579-49867b4cea03
parent 853d2462
......@@ -171,12 +171,25 @@ void refineBoundaryLayers::refineFace
if( (dir0 < 0) && (dir1 < 0) )
{
Pout << "Refining face " << f << endl;
forAll(f, pI)
{
if( splitEdgesAtPoint_.size() >= f[pI] )
Pout << "Split edges at point " << f[pI]
<< " are " << splitEdgesAtPoint_[f[pI]] << endl;
}
Pout << "Splits in direction " << nLayersInDirection << endl;
Pout << "Here " << endl;
Pout << "Dir0 " << dir0 << endl;
Pout << "dir0Edges " << dir0Edges << endl;
Pout << "Dir1 " << dir1 << endl;
Pout << "dir1Edges " << dir1Edges << endl;
FatalErrorIn
(
"void refineBoundaryLayers::refineFace(const face&,"
" const FixedList<label, 2>&, DynList<DynList<label, 4> >&)"
) << "Cannot splitting directions for a face"
<< abort(FatalError);
) << "Cannot find split edges for a face" << abort(FatalError);
}
//- in case of only one refinement direction, it must direction 0
......
......@@ -393,6 +393,26 @@ void refineBoundaryLayers::analyseLayers()
);
}
# ifdef DEBUGLayer
//- write layers to a subset
std::map<label, label> layerId;
for(label i=0;i<nValidLayers;++i)
layerId[i] = mesh_.addFaceSubset("layerFaces_"+help::scalarToText(i));
forAll(layerAtPatch_, i)
{
if( layerAtPatch_[i] < 0 )
continue;
const label start = boundaries[i].patchStart();
const label end = start + boundaries[i].patchSize();
for(label faceI=start;faceI<end;++faceI)
mesh_.addFaceToSubset(layerId[layerAtPatch_[i]], faceI);
}
mesh_.write();
# endif
//- set the number of boundary layers for each patch
labelList nLayersAtPatch(layerAtPatch_.size(), -1);
boolList protectedValue(layerAtPatch_.size(), false);
......
......@@ -229,8 +229,7 @@ bool surfaceMorpherCells::morphInternalFaces()
const face& f = faces[faceI];
boolList removeFaceVertex(f.size(), false);
DynList<edge> removeEdge(f.size());
DynList<bool> removeFaceVertex(f.size(), false);
face newF(f.size());
label i(0);
......@@ -244,9 +243,6 @@ bool surfaceMorpherCells::morphInternalFaces()
{
removeFaceVertex[pI] = true;
removeEdge.appendIfNotIn(f.faceEdge(f.rcIndex(pI)));
removeEdge.appendIfNotIn(f.faceEdge(pI));
# ifdef DEBUGMorph
Info << "Removing vertex " << f[pI] << " from face "
<< f << endl;
......@@ -274,7 +270,7 @@ bool surfaceMorpherCells::morphInternalFaces()
//- create new boundary faces from the removed part
label mat(1);
List<direction> nodeMaterial(f.size(), direction(0));
DynList<direction> nodeMaterial(f.size(), direction(0));
DynList<DynList<edge>, 2> edgeMats;
forAll(nodeMaterial, nI)
if( !nodeMaterial[nI] && removeFaceVertex[nI] )
......@@ -361,8 +357,7 @@ bool surfaceMorpherCells::morphInternalFaces()
const face& f = copy;
boolList removeFaceVertex(f.size(), false);
DynList<edge> removeEdge;
DynList<bool> removeFaceVertex(f.size(), false);
face newF(f.size());
label i(0);
......@@ -376,9 +371,6 @@ bool surfaceMorpherCells::morphInternalFaces()
{
removeFaceVertex[pI] = true;
removeEdge.appendIfNotIn(f.faceEdge(f.rcIndex(pI)));
removeEdge.appendIfNotIn(f.faceEdge(pI));
# ifdef DEBUGMorph
Info << "Removing vertex " << f[pI] << " from face "
<< f << endl;
......@@ -406,7 +398,7 @@ bool surfaceMorpherCells::morphInternalFaces()
//- create new boundary faces from the removed part
label mat(1);
List<direction> nodeMaterial(f.size(), direction(0));
DynList<direction> nodeMaterial(f.size(), direction(0));
DynList< DynList<edge> > edgeMats;
forAll(nodeMaterial, nI)
if( !nodeMaterial[nI] && removeFaceVertex[nI] )
......
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