Commit d57f700c authored by Praetorius, Simon's avatar Praetorius, Simon

some baseproblems extended

parent 0879bc18
...@@ -134,11 +134,11 @@ class RefinementLevel ...@@ -134,11 +134,11 @@ class RefinementLevel
public: public:
RefinementLevel(const FiniteElemSpace *feSpace_, RefinementLevel(const FiniteElemSpace *feSpace_,
MeshRefinementFunction<T,T2>* refineFct_) : MeshRefinementFunction<T,T2>* refineFct_ = NULL) :
feSpace(feSpace_), feSpace(feSpace_),
refineFct(refineFct_), refineFct(refineFct_),
adaptInfo(nullptr), adaptInfo(NULL),
refineOperation(nullptr), refineOperation(NULL),
numRefinements0(15), numRefinements0(15),
globalRefined(false) globalRefined(false)
{ {
...@@ -188,7 +188,7 @@ public: ...@@ -188,7 +188,7 @@ public:
{ {
FUNCNAME("RefinementLevel::refine()"); FUNCNAME("RefinementLevel::refine()");
if (!globalRefined) { if (!globalRefined && refineFct) {
MSG("nr of global refinements: %d\n", refineFct->getGlobalSize()); MSG("nr of global refinements: %d\n", refineFct->getGlobalSize());
refinementManager->globalRefine(mesh, refineFct->getGlobalSize()); refinementManager->globalRefine(mesh, refineFct->getGlobalSize());
globalRefined = true; globalRefined = true;
...@@ -473,7 +473,7 @@ public: ...@@ -473,7 +473,7 @@ public:
{ {
bool elMarkRefine = false, elMarkCoarsen = false; bool elMarkRefine = false, elMarkCoarsen = false;
Flag traverseFlag = Mesh::CALL_LEAF_EL; Flag traverseFlag = Mesh::CALL_LEAF_EL | Mesh::FILL_COORDS;
TraverseStack stack; TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(mesh, -1, traverseFlag); ElInfo *elInfo = stack.traverseFirst(mesh, -1, traverseFlag);
while(elInfo) { while(elInfo) {
......
...@@ -23,6 +23,42 @@ ...@@ -23,6 +23,42 @@
using namespace AMDiS; using namespace AMDiS;
class RefinementLevelSimple : public RefinementLevel<WorldVector<double>, int >
{
public:
RefinementLevelSimple(const FiniteElemSpace *feSpace_, int level_) :
RefinementLevel<WorldVector<double>, int >(feSpace_), refineLevel(level_) { }
~RefinementLevelSimple() {}
void markElements(Flag &markFlag)
{
bool elMarkRefine = false, elMarkCoarsen = false;
Flag traverseFlag = Mesh::CALL_LEAF_EL;
TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(mesh, -1, traverseFlag);
while (elInfo) {
int oldLevel = elInfo->getLevel();
elInfo->getElement()->setMark( calcMark(refineLevel, oldLevel) );
elMarkRefine |= elInfo->getElement()->getMark() == 1;
elMarkCoarsen |= elInfo->getElement()->getMark() == -1;
elInfo = stack.traverseNext(elInfo);
}
markFlag = 0;
if (elMarkRefine)
markFlag = 1;
if (elMarkCoarsen)
markFlag |= 2;
}
protected:
int refineLevel;
};
/** \brief /** \brief
* Refinement structure to perform local anisotropic refinement depending * Refinement structure to perform local anisotropic refinement depending
* on a refineFunction that defines the local refinement level to given * on a refineFunction that defines the local refinement level to given
......
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