Commit 8a0380ea authored by Martin Alkämper's avatar Martin Alkämper

decision rule for samelength edges in Longest edge bisection

parent ca520a6f
Pipeline #21985 failed with stage
in 60 minutes and 1 second
......@@ -1642,13 +1642,6 @@ namespace ALUGrid
_faceRules[ 1 ] = face3rule_t::e01;
_caller = new CallSplitImpl< myrule_t::e01 > ();
break ;
case myrule_t::e12 :
_faces[ 0 ] = 0 ;
_faces[ 1 ] = 3 ;
_faceRules[ 0 ] = face3rule_t::e12;
_faceRules[ 1 ] = face3rule_t::e01;
_caller = new CallSplitImpl< myrule_t::e12 > ();
break ;
case myrule_t::e02 :
_faces[ 0 ] = 0 ;
_faces[ 1 ] = 2 ;
......@@ -1656,13 +1649,6 @@ namespace ALUGrid
_faceRules[ 1 ] = face3rule_t::e01;
_caller = new CallSplitImpl< myrule_t::e02 > ();
break ;
case myrule_t::e23 :
_faces[ 0 ] = 2 ;
_faces[ 1 ] = 3 ;
_faceRules[ 0 ] = face3rule_t::e12;
_faceRules[ 1 ] = face3rule_t::e12;
_caller = new CallSplitImpl< myrule_t::e23 > ();
break ;
case myrule_t::e03 :
_faces[ 0 ] = 1 ;
_faces[ 1 ] = 2 ;
......@@ -1670,6 +1656,13 @@ namespace ALUGrid
_faceRules[ 1 ] = face3rule_t::e02;
_caller = new CallSplitImpl< myrule_t::e03 > ();
break ;
case myrule_t::e12 :
_faces[ 0 ] = 0 ;
_faces[ 1 ] = 3 ;
_faceRules[ 0 ] = face3rule_t::e12;
_faceRules[ 1 ] = face3rule_t::e01;
_caller = new CallSplitImpl< myrule_t::e12 > ();
break ;
case myrule_t::e13 :
_faces[ 0 ] = 1 ;
_faces[ 1 ] = 3 ;
......@@ -1677,6 +1670,13 @@ namespace ALUGrid
_faceRules[ 1 ] = face3rule_t::e02;
_caller = new CallSplitImpl< myrule_t::e13 > ();
break ;
case myrule_t::e23 :
_faces[ 0 ] = 2 ;
_faces[ 1 ] = 3 ;
_faceRules[ 0 ] = face3rule_t::e12;
_faceRules[ 1 ] = face3rule_t::e12;
_caller = new CallSplitImpl< myrule_t::e23 > ();
break ;
default :
std::cerr << "**FEHLER (FATAL) beim unbedingten Verfeinern mit unbekannter Regel: " ;
std::cerr << "[" << r << "]. In " << __FILE__ << __LINE__ << std::endl ;
......
......@@ -521,8 +521,8 @@ namespace ALUGrid
// implementation of longest edge refinement
if(longest)
{
double max =0;
myrule_t rule = myrule_t :: e01;
myrule_t rule = myrule_t::e01;
std::multimap<double, myrule_t> rules;
int i = (this->is2d()) ? 1 : 0;
int rulenumber = (this->is2d()) ? 5 : 2 ;
......@@ -540,14 +540,22 @@ namespace ALUGrid
double diff = p0[k] - p1[k];
sum += (diff * diff );
}
if (sum > max)
{
max = sum;
rule = static_cast<myrule_t>(rulenumber);
}
rules.insert(std::make_pair(sum, static_cast<myrule_t>(rulenumber)));
rulenumber++;
}
}
// if there are multiple edges of largest size, take the one with bigger rule number
auto rIt = rules.rbegin();
double maxLength = rIt->first;
rule = (rules.rbegin())->second;
rIt++;
while( std::abs( rIt->first - maxLength ) < 1e-8 )
{
if(rIt->second < rule )
rule = rIt->second;
rIt++;
}
//std::cout << rule <<std::endl;
alugrid_assert( rule.bisection() );
return rule;
......
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