diff --git a/AMDiS/CMakeLists.txt b/AMDiS/CMakeLists.txt index 82db8adeee927bd778e27aaf774280005109abd6..333d3e7a1d618eb15636673b6ea6b17d3d192ddb 100644 --- a/AMDiS/CMakeLists.txt +++ b/AMDiS/CMakeLists.txt @@ -28,7 +28,7 @@ endif() if(NOT AMDIS_MINOR) set(AMDIS_MINOR "9") endif() -set(COMPILEFLAGS "-DAMDIS_VERSION=${CurrentRevision}") +list(APPEND COMPILEFLAGS "-DAMDIS_VERSION=${CurrentRevision}") #define the build type, empty can be everything and nothing if(CMAKE_BUILD_TYPE STREQUAL "") @@ -37,7 +37,7 @@ endif() if(CMAKE_CXX_COMPILER MATCHES ".*icpc") Message("Compiler: Intel") - set(CMAKE_CXX_FLAGS "-diag-disable 654 -diag-disable 858") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -diag-disable 654 -diag-disable 858") endif() diff --git a/AMDiS/src/Expressions.hh b/AMDiS/src/Expressions.hh index a45bf1a66bf809fb31e673572045fb20a5b59a77..5f8df0bee08bf47804d4a83f4555d06ddd674f0f 100644 --- a/AMDiS/src/Expressions.hh +++ b/AMDiS/src/Expressions.hh @@ -133,7 +133,7 @@ transformDOF(Term term, DOFVector<T>* result) std::vector<DegreeOfFreedom> localIndices(nBasisFcts); TraverseStack stack; ElInfo *elInfo = stack.traverseFirst(mesh, -1, - Mesh::CALL_LEAF_EL | + Mesh::CALL_LEAF_EL | Mesh::FILL_BOUND | Mesh::FILL_COORDS | Mesh::FILL_GRD_LAMBDA); term.initElement(&ot, elInfo, NULL, NULL, basisFcts); diff --git a/AMDiS/src/ProblemStat.cc b/AMDiS/src/ProblemStat.cc index 36e10401f670856671c9b5e54714ff18401c759a..bbb0540d72d349bf79fc7fb14dc67b46296a51c2 100644 --- a/AMDiS/src/ProblemStat.cc +++ b/AMDiS/src/ProblemStat.cc @@ -243,6 +243,7 @@ namespace AMDiS { feSpaces = adoptProblem->getFeSpaces(); traverseInfo = adoptProblem->traverseInfo; + componentSpaces.clear(); if (feSpaces.size() == 1) componentSpaces.resize(nComponents, feSpaces[0]); else if (adoptProblem->getNumComponents() >= nComponents) { diff --git a/AMDiS/src/config/Config_intel.h b/AMDiS/src/config/Config_intel.h index 71d2bc0ecd1381b78facf2288b9e4be399a35f81..c4623f0f49de5857ed38778a45f4c043ba18b4c5 100644 --- a/AMDiS/src/config/Config_intel.h +++ b/AMDiS/src/config/Config_intel.h @@ -55,7 +55,7 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t; // workaround needed to test for -std=c++11 enabled, since __cplusplus gives wrong values #include <vector> #include <functional> -#if defined(_GLIBCXX_TUPLE) || defined(_GLIBCXX_TYPE_TRAITS) || defined(_GLIBCXX_ARRAY) +#if defined(_GLIBCXX_TUPLE) || defined(_GLIBCXX_TYPE_TRAITS) || defined(_GLIBCXX_ARRAY) || (__cplusplus > 199711L) #define HAS_CXX11 1 diff --git a/AMDiS/src/expressions/coords_expr.hpp b/AMDiS/src/expressions/coords_expr.hpp index f8efe5d2bbcce034f117d27b4b52ba8cfac28da7..c4167969025caf76568895525964f344816a83e5 100644 --- a/AMDiS/src/expressions/coords_expr.hpp +++ b/AMDiS/src/expressions/coords_expr.hpp @@ -191,6 +191,7 @@ namespace AMDiS const BasisFunction *basisFct = NULL) { int dim = elInfo->getMesh()->getDim(); + normal.set(0.0); for (int side = 0; side < dim+1; ++side) { if (elInfo->getBoundary(side) == boundary) { elInfo->getNormal(side, normal); diff --git a/AMDiS/src/io/MacroInfo.cc b/AMDiS/src/io/MacroInfo.cc index 6e1a73874ed633c2f6b4f57449748936c3fbd74c..5f1072142f0bb696529d699e0f03de27b710c884 100644 --- a/AMDiS/src/io/MacroInfo.cc +++ b/AMDiS/src/io/MacroInfo.cc @@ -167,7 +167,7 @@ namespace AMDiS { int nElements, nVertices; int j, k; double dbl; - char line[256]; + char line[1024]; int line_no, n_keys, sort_key[N_KEYS], nv_key, ne_key; int key_def[N_KEYS] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; const char *key; @@ -183,7 +183,7 @@ namespace AMDiS { // === Looking for all keys in the macro file. === line_no = n_keys = 0; - while (fgets(line, 255, file)) { + while (fgets(line, 1023, file)) { line_no++; if (!strchr(line, ':')) continue; diff --git a/extensions/ExtendedProblemStat.h b/extensions/ExtendedProblemStat.h index 1e42e1aee89bfabbe534d01e498b5855893f6aa8..24f5f25b2d9c460c6ebb23643aa6356d57bdd6ef 100644 --- a/extensions/ExtendedProblemStat.h +++ b/extensions/ExtendedProblemStat.h @@ -124,7 +124,20 @@ public: { FUNCNAME_DBG("ExtendedProblemStat::buildAfterCoarsen()"); ProblemStat_::buildAfterCoarsen(adaptInfo, flag, asmMatrix, asmVector); - + + bool addPBC = insertPeriodicBC(flag, asmMatrix, asmVector); + bool addDBC = insertDirichletBC(flag, asmMatrix, asmVector); + + // update solverMatrix + if (asmMatrix && (addPBC || addDBC)) + solverMatrix.setMatrix(*getSystemMatrix()); + + bc_dof.clear(); + } + + + virtual bool insertPeriodicBC(Flag flag, bool asmMatrix, bool asmVector) + { // update periodic data if (oldMeshChangeIdx != getMesh()->getChangeIndex() || flag.isSet(UPDATE_PERIODIC_BC) @@ -138,7 +151,13 @@ public: // apply periodic boundary conditions for (size_t k = 0; k < manualPeriodicBC.size(); k++) applyPeriodicBC(manualPeriodicBC[k], asmMatrix, asmVector); - + + return (manualPeriodicBC.size() > 0); + } + + + virtual bool insertDirichletBC(Flag flag, bool asmMatrix, bool asmVector) + { // update dirichlet data if (oldMeshChangeIdx != getMesh()->getChangeIndex() || flag.isSet(UPDATE_DIRICHLET_BC) @@ -160,14 +179,8 @@ public: MSG("DBC applied at %d DOFs\n", num_dbc); #endif - // update solverMatrix - if (asmMatrix && (singularDirichletBC.size() > 0 || manualPeriodicBC.size() > 0)) { - solverMatrix.setMatrix(*getSystemMatrix()); - } - - bc_dof.clear(); + return (singularDirichletBC.size() > 0); } - ////////////////////////////////////////////////////////////////////////////// void solve(AdaptInfo *adaptInfo, diff --git a/extensions/pugixml/src/pugixml.hpp b/extensions/pugixml/src/pugixml.hpp index 4360996282234d5b917c8955b9d024e58533ac73..0953824f5892d00bd8fed0fb55e31ecaa0eaf6d3 100644 --- a/extensions/pugixml/src/pugixml.hpp +++ b/extensions/pugixml/src/pugixml.hpp @@ -15,6 +15,7 @@ #define HEADER_PUGIXML_HPP #include "pugiconfig.hpp" +#include <string> #ifndef PUGIXML_NO_STL namespace std @@ -34,7 +35,7 @@ namespace std template <class _Ty> struct char_traits; template <class _Elem, class _Traits> class basic_istream; template <class _Elem, class _Traits> class basic_ostream; - template <class _Elem, class _Traits, class _Ax> class basic_string; +// template <class _Elem, class _Traits, class _Ax> class basic_string; #endif // Digital Mars compiler has a bug which requires a forward declaration for explicit instantiation (otherwise type selection is messed up later, producing link errors)