Liebe Gitlab-Nutzerin, lieber Gitlab-Nutzer,
es ist nun möglich sich mittels des ZIH-Logins/LDAP an unserem Dienst anzumelden. Die Konten der externen Nutzer:innen sind über den Reiter "Standard" erreichbar.
Die Administratoren


Dear Gitlab user,
it is now possible to log in to our service using the ZIH login/LDAP. The accounts of external users can be accessed via the "Standard" tab.
The administrators

RefinementManager.cc 1.98 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
#include "RefinementManager.h"
#include "Mesh.h"
#include "Traverse.h"
#include "ElInfo.h"
#include "DOFAdmin.h"
#include "AdaptStationary.h"
#include "AdaptInstationary.h"
#include "FixVec.h"
#include "RCNeighbourList.h"
#include "ProblemStatBase.h"
#include "PeriodicBC.h"

namespace AMDiS {

  RefinementManager* RefinementManager::traversePtr = NULL;
  bool RefinementManager::doMoreRecursiveRefine = false;
  int RefinementManager::callRefineInterpol = 0;
  RCNeighbourList* RefinementManager3d::refList = NULL;
  int RefinementManager::globalMark = 0;

  int RefinementManager::globalRefineFct(ElInfo* elinfo)
  {
    FUNCNAME("RefineManager::globalRefineFct");

    elinfo->getElement()->setMark(globalMark);
    return 0;
  }

  Flag RefinementManager::globalRefine(Mesh *aMesh, int mark)
  {
    FUNCNAME("RefinementManager::globalRefine()");

33 34 35
    if (mark <= 0) 
      return static_cast<Flag>(0);

36
    globalMark = mark;
37 38
    aMesh->traverse(-1,
		    Mesh::CALL_LEAF_EL | Mesh::FILL_COORDS | Mesh::FILL_BOUND, 
39 40 41 42 43 44 45 46 47 48 49 50 51
		    globalRefineFct);
    return refineMesh(aMesh);
  }




  Flag RefinementManager::refineMesh(Mesh *aMesh)
  {
    FUNCNAME("RefinementManager::refineMesh()");

    mesh = aMesh;
    int n_elements = mesh->getNumberOfLeaves();
52
    ElInfo *elInfo;
53
    newCoords = false;
54 55
    stack = NEW TraverseStack;
    doMoreRecursiveRefine = true;
56

57 58
    while (doMoreRecursiveRefine) {
      doMoreRecursiveRefine = false;
59 60 61 62
      elInfo = stack->traverseFirst(mesh, -1, 
				    Mesh::CALL_LEAF_EL | Mesh::FILL_NEIGH | Mesh::FILL_BOUND);
      while (elInfo) {
	if (elInfo->getElement()->getMark() > 0) {
63
	  doMoreRecursiveRefine = doMoreRecursiveRefine || 
64 65 66 67
	    (elInfo->getElement()->getMark() > 1);
	  elInfo = refineFunction(elInfo);
	}	
	elInfo = stack->traverseNext(elInfo);
68
      }
69
    }
70
  
71
    if (newCoords) {
72 73 74 75 76 77 78 79 80 81 82
      setNewCoords(); // call of sub-class method  
    }

    DELETE stack;

    n_elements = mesh->getNumberOfLeaves() - n_elements;

    return(n_elements ? MESH_REFINED : Flag(0));
  }

}