diff --git a/AMDiS/bin/Makefile.am b/AMDiS/bin/Makefile.am index f8d7bfc042c17266299a9879050ff23f5e8c91e5..65a86c99879a034b3dce8a6320d36f27498c193a 100644 --- a/AMDiS/bin/Makefile.am +++ b/AMDiS/bin/Makefile.am @@ -105,6 +105,7 @@ $(SOURCE_DIR)/DOFContainer.h \ $(SOURCE_DIR)/FileWriter.h $(SOURCE_DIR)/FileWriter.hh $(SOURCE_DIR)/FileWriter.cc \ $(SOURCE_DIR)/ElementFileWriter.h $(SOURCE_DIR)/ElementFileWriter.cc \ $(SOURCE_DIR)/ElInfo.cc \ +$(SOURCE_DIR)/ElInfoStack.h $(SOURCE_DIR)/ElInfoStack.cc \ $(SOURCE_DIR)/MatVecMultiplier.h \ $(SOURCE_DIR)/Operator.h $(SOURCE_DIR)/Operator.cc \ $(SOURCE_DIR)/Mesh.cc \ diff --git a/AMDiS/bin/Makefile.in b/AMDiS/bin/Makefile.in index 95c21f6abe9f1699e4e1b2a7ca692f20d4ad4a3b..f970c4cbc88bfda25d05b2b5cf57e0b0d0572c83 100644 --- a/AMDiS/bin/Makefile.in +++ b/AMDiS/bin/Makefile.in @@ -140,6 +140,7 @@ am__libamdis_la_SOURCES_DIST = $(PARALLEL_DIR)/ConditionalEstimator.h \ $(SOURCE_DIR)/FileWriter.h $(SOURCE_DIR)/FileWriter.hh \ $(SOURCE_DIR)/FileWriter.cc $(SOURCE_DIR)/ElementFileWriter.h \ $(SOURCE_DIR)/ElementFileWriter.cc $(SOURCE_DIR)/ElInfo.cc \ + $(SOURCE_DIR)/ElInfoStack.h $(SOURCE_DIR)/ElInfoStack.cc \ $(SOURCE_DIR)/MatVecMultiplier.h $(SOURCE_DIR)/Operator.h \ $(SOURCE_DIR)/Operator.cc $(SOURCE_DIR)/Mesh.cc \ $(SOURCE_DIR)/AMDiS.h $(SOURCE_DIR)/AdaptStationary.h \ @@ -265,8 +266,9 @@ am_libamdis_la_OBJECTS = $(am__objects_1) \ libamdis_la-BoundaryManager.lo libamdis_la-DirichletBC.lo \ libamdis_la-RobinBC.lo libamdis_la-MatVecMultiplier.lo \ libamdis_la-FileWriter.lo libamdis_la-ElementFileWriter.lo \ - libamdis_la-ElInfo.lo libamdis_la-Operator.lo \ - libamdis_la-Mesh.lo libamdis_la-AdaptStationary.lo \ + libamdis_la-ElInfo.lo libamdis_la-ElInfoStack.lo \ + libamdis_la-Operator.lo libamdis_la-Mesh.lo \ + libamdis_la-AdaptStationary.lo \ libamdis_la-AdaptInstationary.lo \ libamdis_la-DiagonalPreconditioner.lo \ libamdis_la-ILUPreconditioner.lo \ @@ -532,6 +534,7 @@ $(SOURCE_DIR)/DOFContainer.h \ $(SOURCE_DIR)/FileWriter.h $(SOURCE_DIR)/FileWriter.hh $(SOURCE_DIR)/FileWriter.cc \ $(SOURCE_DIR)/ElementFileWriter.h $(SOURCE_DIR)/ElementFileWriter.cc \ $(SOURCE_DIR)/ElInfo.cc \ +$(SOURCE_DIR)/ElInfoStack.h $(SOURCE_DIR)/ElInfoStack.cc \ $(SOURCE_DIR)/MatVecMultiplier.h \ $(SOURCE_DIR)/Operator.h $(SOURCE_DIR)/Operator.cc \ $(SOURCE_DIR)/Mesh.cc \ @@ -772,6 +775,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-ElInfo1d.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-ElInfo2d.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-ElInfo3d.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-ElInfoStack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-Element.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-ElementData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-ElementFileWriter.Plo@am__quote@ @@ -1193,6 +1197,13 @@ libamdis_la-ElInfo.lo: $(SOURCE_DIR)/ElInfo.cc @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -c -o libamdis_la-ElInfo.lo `test -f '$(SOURCE_DIR)/ElInfo.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/ElInfo.cc +libamdis_la-ElInfoStack.lo: $(SOURCE_DIR)/ElInfoStack.cc +@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -MT libamdis_la-ElInfoStack.lo -MD -MP -MF "$(DEPDIR)/libamdis_la-ElInfoStack.Tpo" -c -o libamdis_la-ElInfoStack.lo `test -f '$(SOURCE_DIR)/ElInfoStack.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/ElInfoStack.cc; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libamdis_la-ElInfoStack.Tpo" "$(DEPDIR)/libamdis_la-ElInfoStack.Plo"; else rm -f "$(DEPDIR)/libamdis_la-ElInfoStack.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SOURCE_DIR)/ElInfoStack.cc' object='libamdis_la-ElInfoStack.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -c -o libamdis_la-ElInfoStack.lo `test -f '$(SOURCE_DIR)/ElInfoStack.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/ElInfoStack.cc + libamdis_la-Operator.lo: $(SOURCE_DIR)/Operator.cc @am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -MT libamdis_la-Operator.lo -MD -MP -MF "$(DEPDIR)/libamdis_la-Operator.Tpo" -c -o libamdis_la-Operator.lo `test -f '$(SOURCE_DIR)/Operator.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/Operator.cc; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libamdis_la-Operator.Tpo" "$(DEPDIR)/libamdis_la-Operator.Plo"; else rm -f "$(DEPDIR)/libamdis_la-Operator.Tpo"; exit 1; fi diff --git a/AMDiS/src/ElInfoStack.cc b/AMDiS/src/ElInfoStack.cc new file mode 100644 index 0000000000000000000000000000000000000000..56c852ee57477689a75d33b1de4beecce4231445 --- /dev/null +++ b/AMDiS/src/ElInfoStack.cc @@ -0,0 +1,53 @@ +#include "ElInfoStack.h" +#include "Mesh.h" + +namespace AMDiS { + + ElInfoStack::ElInfoStack(Mesh *mesh) + : mesh_(mesh), + stackPosition_(-1) + { + elInfoStack_.resize(20); + for (int i = 0; i < 20; i++) { + elInfoStack_[i] = mesh_->createNewElInfo(); + } + } + + ElInfoStack::~ElInfoStack() + { + for (int i = 0; i < static_cast<int>(elInfoStack_.size()); i++) { + DELETE elInfoStack_[i]; + } + } + + ElInfo* ElInfoStack::getNextElement() + { + // Check if the stack if large enough. If not, the stack is enlarged + // and new elements are created. + if (stackPosition_ + 1 >= static_cast<int>(elInfoStack_.size())) { + int oldSize = elInfoStack_.size(); + elInfoStack_.resize(oldSize + oldSize / 2); + for (int i = oldSize; i < static_cast<int>(elInfoStack_.size()); i++) { + elInfoStack_[i] = mesh_->createNewElInfo(); + } + } + + stackPosition_++; + + return elInfoStack_[stackPosition_]; + } + + void ElInfoStack::getBackElement() + { + TEST_EXIT_DBG(stackPosition_ >= 0)("Invalid stack position!\n"); + + stackPosition_--; + } + + ElInfo* ElInfoStack::getCurrentElement() + { + TEST_EXIT_DBG(stackPosition_ >= 0)("Invalid stack position!\n"); + + return elInfoStack_[stackPosition_]; + } +} diff --git a/AMDiS/src/ElInfoStack.h b/AMDiS/src/ElInfoStack.h new file mode 100644 index 0000000000000000000000000000000000000000..4a9e886275820eb13bae450d9cedf0eec0f7f273 --- /dev/null +++ b/AMDiS/src/ElInfoStack.h @@ -0,0 +1,99 @@ +// ============================================================================ +// == == +// == AMDiS - Adaptive multidimensional simulations == +// == == +// ============================================================================ +// == == +// == crystal growth group == +// == == +// == Stiftung caesar == +// == Ludwig-Erhard-Allee 2 == +// == 53175 Bonn == +// == germany == +// == == +// ============================================================================ +// == == +// == http://www.caesar.de/cg/AMDiS == +// == == +// ============================================================================ + +/** \file ElInfo.h */ + +#ifndef AMDIS_ELINFOSTACK_H +#define AMDIS_ELINFOSTACK_H + +// ============================================================================ +// ===== includes ============================================================= +// ============================================================================ +#include <vector> +#include "ElInfo.h" + +namespace AMDiS { + + // ============================================================================ + // ===== forward declarations ================================================= + // ============================================================================ + + class Mesh; + + + // ============================================================================ + // ===== class ElInfoStack ==================================================== + // ============================================================================ + + /** \ingroup Traverse + * \brief + * Stores a stack of ElInfo object. Is used by meshes for recursive mesh + * traverse. The use of a stack is cheaper than allocating the ElInfo objects + * at every recursive step. + */ + + class ElInfoStack + { + public: + /** \brief + * Constructer, creates the stack. + */ + ElInfoStack(Mesh *mesh); + + /** \brief + * Destructor, deletes all ElInfos on the stack. + */ + ~ElInfoStack(); + + /** \brief + * Get a new element from the stack an increase the stack position. + */ + ElInfo* getNextElement(); + + /** \brief + * Decrease the stack position. + */ + void getBackElement(); + + /** \brief + * Returns a pointer to the currently used element of the stack. + */ + ElInfo* getCurrentElement(); + + protected: + /** \brief + * The mesh on which the traverse is done. + */ + Mesh *mesh_; + + /** \brief + * The stack of pointers to ElInfo objects. + */ + ::std::vector<ElInfo*> elInfoStack_; + + /** \brief + * Current position (depth) of the recursive mesh traverse. + */ + int stackPosition_; + }; + +} + + +#endif // AMDIS_ELINFOSTACK_H diff --git a/AMDiS/src/Mesh.cc b/AMDiS/src/Mesh.cc index 92b5496adf0c10199502be17c9a6a239bbd315e7..3c68e4d7f3cc844ac473a3cd9572a7dfff99736c 100644 --- a/AMDiS/src/Mesh.cc +++ b/AMDiS/src/Mesh.cc @@ -1,3 +1,9 @@ +#include <algorithm> +#include <set> +#include <map> + +#include "time.h" + #include "AdaptStationary.h" #include "AdaptInstationary.h" #include "FiniteElemSpace.h" @@ -15,11 +21,8 @@ #include "MacroWriter.h" #include "PeriodicMap.h" #include "Projection.h" -#include <algorithm> -#include <set> -#include <map> +#include "ElInfoStack.h" -#include "time.h" namespace AMDiS { @@ -131,8 +134,10 @@ namespace AMDiS { int (*el_fct)(ElInfo*)) { FUNCNAME("Mesh::traverse()"); + ::std::deque<MacroElement*>::iterator mel; - ElInfo* elinfo = createNewElInfo(); + ElInfoStack elInfoStack(this); + ElInfo* elinfo = elInfoStack.getNextElement(); Traverse tinfo(this, flag, level, el_fct); int sum = 0; @@ -146,10 +151,10 @@ namespace AMDiS { for (mel = macroElements.begin(); mel != macroElements.end(); mel++) { elinfo->fillMacroInfo(*mel); - sum += tinfo.recursive(elinfo); + sum += tinfo.recursive(&elInfoStack); } - DELETE elinfo; + elInfoStack.getBackElement(); return (flag.isSet(Mesh::FILL_ADD_ALL)) ? sum : 0; } diff --git a/AMDiS/src/Traverse.cc b/AMDiS/src/Traverse.cc index aaf77abeff87e80027632ead3d27bf1bca1be2b1..e82a8c584deaa370eaeb463c3b7ee31f91b6348d 100644 --- a/AMDiS/src/Traverse.cc +++ b/AMDiS/src/Traverse.cc @@ -112,10 +112,13 @@ namespace AMDiS { /* depending on the traverse_info->level variable */ /****************************************************************************/ - int Traverse::recursive(ElInfo *elinfo) + // int Traverse::recursive(ElInfo *elinfo) + int Traverse::recursive(ElInfoStack *elInfoStack) { FUNCNAME("Traverse::recursive()"); + ElInfo *elinfo = elInfoStack->getCurrentElement(); + Element *el = elinfo->getElement(); int mg_level, sum = 0; Parametric *parametric = mesh->getParametric(); @@ -123,164 +126,174 @@ namespace AMDiS { if (flag.isSet(Mesh::CALL_LEAF_EL)) { if (el->getFirstChild()) { - ElInfo* elinfo_new = mesh->createNewElInfo(); + ElInfo* elinfo_new = elInfoStack->getNextElement(); elinfo_new->fillElInfo(0, elinfo); - sum += recursive(elinfo_new); + sum += recursive(elInfoStack); elinfo_new->fillElInfo(1, elinfo); - sum += recursive(elinfo_new); - DELETE elinfo_new; + sum += recursive(elInfoStack); + elInfoStack->getBackElement(); } else { if (el_fct != NULL) { if (parametric) elinfo = parametric->addParametricInfo(elinfo); elinfo->fillDetGrdLambda(); - sum+=el_fct(elinfo); + sum += el_fct(elinfo); if (parametric) elinfo = parametric->removeParametricInfo(elinfo); } } - return (flag.isSet(Mesh::FILL_ADD_ALL))?sum:0;; + return (flag.isSet(Mesh::FILL_ADD_ALL)) ? sum : 0; } if (flag.isSet(Mesh::CALL_LEAF_EL_LEVEL)) { if (el->getFirstChild()) { if ((elinfo->getLevel() >= level)) { - return (flag.isSet(Mesh::FILL_ADD_ALL))?sum:0; + return (flag.isSet(Mesh::FILL_ADD_ALL)) ? sum : 0; } - ElInfo* elinfo_new = mesh->createNewElInfo(); + ElInfo* elinfo_new = elInfoStack->getNextElement(); elinfo_new->fillElInfo(0, elinfo); - sum += recursive(elinfo_new); + sum += recursive(elInfoStack); elinfo->fillElInfo(1, elinfo); - sum += recursive(elinfo_new); - DELETE elinfo_new; - } - else { + sum += recursive(elInfoStack); + elInfoStack->getBackElement(); + } else { if ((elinfo->getLevel() == level) && (el_fct!=NULL)) { if (parametric) elinfo = parametric->addParametricInfo(elinfo); elinfo->fillDetGrdLambda(); - sum+=el_fct(elinfo); + sum += el_fct(elinfo); if (parametric) elinfo = parametric->removeParametricInfo(elinfo); } } - return (flag.isSet(Mesh::FILL_ADD_ALL))?sum:0; + return (flag.isSet(Mesh::FILL_ADD_ALL)) ? sum : 0; } if (flag.isSet(Mesh::CALL_EL_LEVEL)) { if (elinfo->getLevel() == level) { - if (NULL!=el_fct) { - if(parametric) elinfo = parametric->addParametricInfo(elinfo); + if (NULL != el_fct) { + if (parametric) + elinfo = parametric->addParametricInfo(elinfo); elinfo->fillDetGrdLambda(); - sum+=el_fct(elinfo); - if(parametric) elinfo = parametric->removeParametricInfo(elinfo); + sum += el_fct(elinfo); + if (parametric) + elinfo = parametric->removeParametricInfo(elinfo); } - } - else { + } else { if (elinfo->getLevel() > level){ - return(flag.isSet(Mesh::FILL_ADD_ALL))?sum:0; + return (flag.isSet(Mesh::FILL_ADD_ALL)) ? sum : 0; + } else if (el->getFirstChild()) { + ElInfo* elinfo_new = elInfoStack->getNextElement(); + elinfo_new->fillElInfo(0, elinfo); + sum += recursive(elInfoStack); + elinfo_new->fillElInfo(1, elinfo); + sum += recursive(elInfoStack); + elInfoStack->getBackElement(); } - else - if (el->getFirstChild()) { - ElInfo* elinfo_new = mesh->createNewElInfo(); - elinfo_new->fillElInfo(0, elinfo); - sum+=recursive(elinfo_new); - elinfo_new->fillElInfo(1, elinfo); - sum+=recursive(elinfo_new); - DELETE elinfo_new; - } } - return (flag.isSet(Mesh::FILL_ADD_ALL))?sum:0; + return (flag.isSet(Mesh::FILL_ADD_ALL)) ? sum : 0; } if (flag.isSet(Mesh::CALL_MG_LEVEL)) { - mg_level = (static_cast<int>(elinfo->getLevel()) + - mesh->getDim()-1) / mesh->getDim(); + mg_level = (static_cast<int>(elinfo->getLevel()) + mesh->getDim() - 1) / + mesh->getDim(); if (mg_level > static_cast<int>(level)) { return 0; } if (!(el->getFirstChild())) { - if (el_fct!=NULL) { - if(parametric) elinfo = parametric->addParametricInfo(elinfo); + if (el_fct != NULL) { + if (parametric) + elinfo = parametric->addParametricInfo(elinfo); elinfo->fillDetGrdLambda(); - sum+=el_fct(elinfo); - if(parametric) elinfo = parametric->removeParametricInfo(elinfo); + sum += el_fct(elinfo); + if (parametric) + elinfo = parametric->removeParametricInfo(elinfo); } - return (flag.isSet(Mesh::FILL_ADD_ALL))?sum:0; + return (flag.isSet(Mesh::FILL_ADD_ALL)) ? sum : 0; } - if ((mg_level == level) && ((elinfo->getLevel() % mesh->getDim()) == 0)) - { - if (el_fct!=NULL) { - if(parametric) elinfo = parametric->addParametricInfo(elinfo); - elinfo->fillDetGrdLambda(); - sum+=el_fct(elinfo); - if(parametric) elinfo = parametric->removeParametricInfo(elinfo); - } - return(flag.isSet(Mesh::FILL_ADD_ALL))?sum:0;; + if ((mg_level == level) && ((elinfo->getLevel() % mesh->getDim()) == 0)) { + if (el_fct != NULL) { + if (parametric) + elinfo = parametric->addParametricInfo(elinfo); + elinfo->fillDetGrdLambda(); + sum += el_fct(elinfo); + if (parametric) + elinfo = parametric->removeParametricInfo(elinfo); } + return (flag.isSet(Mesh::FILL_ADD_ALL)) ? sum : 0; + } - ElInfo* elinfo_new = mesh->createNewElInfo(); + ElInfo* elinfo_new = elInfoStack->getNextElement(); elinfo_new->fillElInfo(0, elinfo); - sum+=recursive(elinfo_new); + sum += recursive(elInfoStack); elinfo_new->fillElInfo(1, elinfo); - sum+=recursive(elinfo_new); + sum += recursive(elInfoStack); - DELETE elinfo_new; - return(flag.isSet(Mesh::FILL_ADD_ALL))?sum:0; - + elInfoStack->getBackElement(); + + return (flag.isSet(Mesh::FILL_ADD_ALL)) ? sum : 0; } - if (flag.isSet(Mesh::CALL_EVERY_EL_PREORDER)) + if (flag.isSet(Mesh::CALL_EVERY_EL_PREORDER)) { if (el_fct != NULL) { - if(parametric) elinfo = parametric->addParametricInfo(elinfo); + if (parametric) + elinfo = parametric->addParametricInfo(elinfo); elinfo->fillDetGrdLambda(); - sum+=el_fct(elinfo); - if(parametric) elinfo = parametric->removeParametricInfo(elinfo); + sum += el_fct(elinfo); + if (parametric) + elinfo = parametric->removeParametricInfo(elinfo); } - if (el->getFirstChild()) { - ElInfo* elinfo_new = mesh->createNewElInfo(); + } + if (el->getFirstChild()) { + ElInfo* elinfo_new = elInfoStack->getNextElement(); + elinfo_new->fillElInfo(0, elinfo); - sum+= recursive(elinfo_new); + sum += recursive(elInfoStack); if (flag.isSet(Mesh::CALL_EVERY_EL_INORDER)) if (el_fct!=NULL) { - if(parametric) elinfo = parametric->addParametricInfo(elinfo); + if (parametric) + elinfo = parametric->addParametricInfo(elinfo); elinfo->fillDetGrdLambda(); - sum+=el_fct(elinfo); - if(parametric) elinfo = parametric->removeParametricInfo(elinfo); + sum += el_fct(elinfo); + if (parametric) + elinfo = parametric->removeParametricInfo(elinfo); } elinfo_new->fillElInfo(1, elinfo); - sum+= recursive(elinfo_new); + sum += recursive(elInfoStack); - DELETE elinfo_new; - } - else { + elInfoStack->getBackElement(); + } else { if (flag.isSet(Mesh::CALL_EVERY_EL_INORDER)) - if (el_fct!=NULL) { - if(parametric) elinfo = parametric->addParametricInfo(elinfo); + if (el_fct != NULL) { + if (parametric) + elinfo = parametric->addParametricInfo(elinfo); elinfo->fillDetGrdLambda(); - sum+=el_fct(elinfo); - if(parametric) elinfo = parametric->removeParametricInfo(elinfo); + sum += el_fct(elinfo); + if (parametric) + elinfo = parametric->removeParametricInfo(elinfo); } } if (flag.isSet(Mesh::CALL_EVERY_EL_POSTORDER)) - if (el_fct!=NULL) { - if(parametric) elinfo = parametric->addParametricInfo(elinfo); + if (el_fct != NULL) { + if (parametric) + elinfo = parametric->addParametricInfo(elinfo); elinfo->fillDetGrdLambda(); - sum+=el_fct(elinfo); - if(parametric) elinfo = parametric->removeParametricInfo(elinfo); + sum += el_fct(elinfo); + if (parametric) + elinfo = parametric->removeParametricInfo(elinfo); } - return(flag.isSet(Mesh::FILL_ADD_ALL))?sum:0; + return (flag.isSet(Mesh::FILL_ADD_ALL)) ? sum : 0; } void TraverseStack::enlargeTraverseStack() diff --git a/AMDiS/src/Traverse.h b/AMDiS/src/Traverse.h index b8b7d4be0030f87d5d48ea4486bb563f2e2db89a..ba099231a865cbf393cdd539e357b84e4850b4da 100644 --- a/AMDiS/src/Traverse.h +++ b/AMDiS/src/Traverse.h @@ -32,6 +32,7 @@ #include "Flag.h" #include "Global.h" #include "ElInfo.h" +#include "ElInfoStack.h" #include "MemoryManager.h" #include <vector> #include <deque> @@ -304,7 +305,10 @@ namespace AMDiS { const Flag f, const unsigned char l, int (*ef)(ElInfo*)) - :mesh(m),flag(f),level(l),el_fct(ef) + : mesh(m), + flag(f), + level(l), + el_fct(ef) { TEST_EXIT(m)("No traverse without mesh!\n"); id = ElInfo::traverseIdCounter++; @@ -313,7 +317,8 @@ namespace AMDiS { /** \brief * Performs the recursive traversal */ - int recursive(ElInfo*); + // int recursive(ElInfo*); + int recursive(ElInfoStack*); private: Mesh *mesh;