Commit af1268e7 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

extensions extended by unit-vector/-matrix; FixVec,Vector and Matrix corrected...

extensions extended by unit-vector/-matrix; FixVec,Vector and Matrix corrected and extended; lots of other changes
parent 92775cf7
...@@ -122,6 +122,7 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc ...@@ -122,6 +122,7 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
${SOURCE_DIR}/MacroElement.cc ${SOURCE_DIR}/MacroElement.cc
${SOURCE_DIR}/Marker.cc ${SOURCE_DIR}/Marker.cc
${SOURCE_DIR}/MatrixVector.cc ${SOURCE_DIR}/MatrixVector.cc
# ${SOURCE_DIR}/Test_MatrixVectorOperations.cc
${SOURCE_DIR}/Mesh.cc ${SOURCE_DIR}/Mesh.cc
${SOURCE_DIR}/MeshStructure.cc ${SOURCE_DIR}/MeshStructure.cc
${SOURCE_DIR}/Operator.cc ${SOURCE_DIR}/Operator.cc
...@@ -175,6 +176,7 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc ...@@ -175,6 +176,7 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
${SOURCE_DIR}/io/detail/Arh2Writer.cc ${SOURCE_DIR}/io/detail/Arh2Writer.cc
${SOURCE_DIR}/io/DofWriter.cc ${SOURCE_DIR}/io/DofWriter.cc
${SOURCE_DIR}/io/ElementFileWriter.cc ${SOURCE_DIR}/io/ElementFileWriter.cc
${SOURCE_DIR}/io/FileWriterInterface.cc
${SOURCE_DIR}/io/FileWriter.cc ${SOURCE_DIR}/io/FileWriter.cc
${SOURCE_DIR}/io/GNUPlotWriter.cc ${SOURCE_DIR}/io/GNUPlotWriter.cc
${SOURCE_DIR}/io/MacroInfo.cc ${SOURCE_DIR}/io/MacroInfo.cc
...@@ -433,9 +435,7 @@ if(ENABLE_EXTENSIONS) ...@@ -433,9 +435,7 @@ if(ENABLE_EXTENSIONS)
${EXTENSIONS_DIR}/POperators.cc ${EXTENSIONS_DIR}/POperators.cc
${EXTENSIONS_DIR}/SingularDirichletBC2.cc ${EXTENSIONS_DIR}/SingularDirichletBC2.cc
${EXTENSIONS_DIR}/time/ExtendedRosenbrockStationary.cc ${EXTENSIONS_DIR}/time/ExtendedRosenbrockStationary.cc
${EXTENSIONS_DIR}/pugixml/src/pugixml.cpp ${EXTENSIONS_DIR}/pugixml/src/pugixml.cpp)
${EXTENSIONS_DIR}/preconditioner/PhaseFieldCrystal_.cc
${EXTENSIONS_DIR}/preconditioner/CahnHilliard_.cc)
if(ENABLE_SEQ_PETSC) if(ENABLE_SEQ_PETSC)
list(APPEND EXTENSIONS_SRC list(APPEND EXTENSIONS_SRC
...@@ -510,11 +510,15 @@ if(ENABLE_EXTENSIONS) ...@@ -510,11 +510,15 @@ if(ENABLE_EXTENSIONS)
${EXTENSIONS_DIR}/base_problems/CahnHilliard.cc ${EXTENSIONS_DIR}/base_problems/CahnHilliard.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliard_RB.cc ${EXTENSIONS_DIR}/base_problems/CahnHilliard_RB.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes.cc ${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes.cc
# ${EXTENSIONS_DIR}/base_problems/DiffuseDomainFsi.cc ${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes_RB.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes_TwoPhase.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes_TwoPhase_RB.cc
${EXTENSIONS_DIR}/base_problems/DiffuseDomainFsi.cc
${EXTENSIONS_DIR}/base_problems/LinearElasticity.cc ${EXTENSIONS_DIR}/base_problems/LinearElasticity.cc
${EXTENSIONS_DIR}/base_problems/LinearElasticityPhase.cc ${EXTENSIONS_DIR}/base_problems/LinearElasticityPhase.cc
# ${EXTENSIONS_DIR}/base_problems/NavierStokes_Chorin.cc # ${EXTENSIONS_DIR}/base_problems/NavierStokes_Chorin.cc
${EXTENSIONS_DIR}/base_problems/NavierStokesCahnHilliard.cc ${EXTENSIONS_DIR}/base_problems/NavierStokesCahnHilliard.cc
# ${EXTENSIONS_DIR}/base_problems/NavierStokesPhase_Chorin.cc
${EXTENSIONS_DIR}/base_problems/NavierStokesPhase_TaylorHood.cc ${EXTENSIONS_DIR}/base_problems/NavierStokesPhase_TaylorHood.cc
${EXTENSIONS_DIR}/base_problems/NavierStokes_TaylorHood.cc ${EXTENSIONS_DIR}/base_problems/NavierStokes_TaylorHood.cc
${EXTENSIONS_DIR}/base_problems/NavierStokes_TaylorHood_RB.cc ${EXTENSIONS_DIR}/base_problems/NavierStokes_TaylorHood_RB.cc
...@@ -524,7 +528,10 @@ if(ENABLE_EXTENSIONS) ...@@ -524,7 +528,10 @@ if(ENABLE_EXTENSIONS)
${EXTENSIONS_DIR}/base_problems/PhaseFieldCrystal_Phase.cc ${EXTENSIONS_DIR}/base_problems/PhaseFieldCrystal_Phase.cc
${EXTENSIONS_DIR}/base_problems/PhaseFieldCrystal_RB.cc ${EXTENSIONS_DIR}/base_problems/PhaseFieldCrystal_RB.cc
${EXTENSIONS_DIR}/base_problems/PolarizationField.cc ${EXTENSIONS_DIR}/base_problems/PolarizationField.cc
${EXTENSIONS_DIR}/base_problems/QuasiCrystal.cc) ${EXTENSIONS_DIR}/base_problems/QuasiCrystal.cc
${EXTENSIONS_DIR}/base_problems/QuasiCrystal_RB.cc
# ${EXTENSIONS_DIR}/base_problems/VacancyPhaseFieldCrystal.cc
)
list(APPEND COMPILEFLAGS "-DHAVE_BASE_PROBLEMS=1") list(APPEND COMPILEFLAGS "-DHAVE_BASE_PROBLEMS=1")
list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}/base_problems) list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}/base_problems)
if(WIN32) if(WIN32)
...@@ -635,6 +642,11 @@ INSTALL(FILES ${HEADERS} ...@@ -635,6 +642,11 @@ INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/) DESTINATION include/amdis/)
list(APPEND deb_add_dirs "include/amdis") list(APPEND deb_add_dirs "include/amdis")
FILE(GLOB HEADERS "${SOURCE_DIR}/config/*.h*")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/config/)
list(APPEND deb_add_dirs "include/amdis/config")
FILE(GLOB HEADERS "${SOURCE_DIR}/*.hh") FILE(GLOB HEADERS "${SOURCE_DIR}/*.hh")
INSTALL(FILES ${HEADERS} INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/) DESTINATION include/amdis/)
......
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
#include "Marker.h" #include "Marker.h"
// #include "MathFunctions.h" // #include "MathFunctions.h"
#include "MatrixVector.h" #include "MatrixVector.h"
#include "MatrixVectorOperations.h"
#include "Mesh.h" #include "Mesh.h"
#include "MeshStructure.h" #include "MeshStructure.h"
#include "ComponentTraverseInfo.h" #include "ComponentTraverseInfo.h"
......
...@@ -64,7 +64,7 @@ namespace AMDiS { ...@@ -64,7 +64,7 @@ namespace AMDiS {
Element *el = elInfo->getElement(); Element *el = elInfo->getElement();
if (el != lastMatEl || !operat->isOptimized()) { if (el != lastMatEl || !operat->isOptimized()) {
initElement(elInfo); initElement(elInfo, elInfo);
if (rememberElMat) if (rememberElMat)
set_to_zero(elementMatrix); set_to_zero(elementMatrix);
...@@ -125,10 +125,12 @@ namespace AMDiS { ...@@ -125,10 +125,12 @@ namespace AMDiS {
ElementMatrix& mat = rememberElMat ? elementMatrix : userMat; ElementMatrix& mat = rememberElMat ? elementMatrix : userMat;
if (secondOrderAssembler) { if (secondOrderAssembler) {
// calculate element matrices always on smallest element
secondOrderAssembler->calculateElementMatrix(smallElInfo, mat); secondOrderAssembler->calculateElementMatrix(smallElInfo, mat);
// smallElInfo stores refinement-relation to largeElInfo
ElementMatrix &m = ElementMatrix &m =
smallElInfo->getSubElemGradCoordsMat(rowFeSpace->getBasisFcts()->getDegree()); smallElInfo->getSubElemGradCoordsMat(rowFeSpace->getBasisFcts()->getDegree()); // muste be moved to next if-else block when generalized for multiple polynomial degrees
if (!rowColFeSpaceEqual) { if (!rowColFeSpaceEqual) {
if (smallElInfo == colElInfo) if (smallElInfo == colElInfo)
...@@ -321,14 +323,7 @@ namespace AMDiS { ...@@ -321,14 +323,7 @@ namespace AMDiS {
calculateElementMatrix(elInfo, elementMatrix); calculateElementMatrix(elInfo, elementMatrix);
} }
// vec += elementMatrix*uhOldLoc; vec += elementMatrix*uhOldLoc;
for (int i = 0; i < nRow; i++) {
double val = 0.0;
for (int j = 0; j < nCol; j++)
val += elementMatrix[i][j] * uhOldLoc[j];
vec[i] += val;
}
} }
...@@ -358,15 +353,10 @@ namespace AMDiS { ...@@ -358,15 +353,10 @@ namespace AMDiS {
if (mainElInfo->getElement() != lastMatEl) { if (mainElInfo->getElement() != lastMatEl) {
set_to_zero(elementMatrix); set_to_zero(elementMatrix);
calculateElementMatrix(mainElInfo, auxElInfo, smallElInfo, largeElInfo, calculateElementMatrix(mainElInfo, auxElInfo, smallElInfo, largeElInfo,
false, elementMatrix); rowFeSpace == operat->uhOld->getFeSpace(), elementMatrix);
} }
for (int i = 0; i < nBasFcts; i++) { vec += elementMatrix * uhOldLoc;
double val = 0.0;
for (int j = 0; j < nBasFcts; j++)
val += elementMatrix[i][j] * uhOldLoc[j];
vec[i] += val;
}
} }
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#ifndef AMDIS_BALLPROJECT_H #ifndef AMDIS_BALLPROJECT_H
#define AMDIS_BALLPROJECT_H #define AMDIS_BALLPROJECT_H
#include "MatrixVectorOperations.h"
namespace AMDiS { namespace AMDiS {
/** \brief /** \brief
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "Cholesky.h" #include "Cholesky.h"
#include "MatrixVectorOperations.h"
namespace AMDiS { namespace AMDiS {
......
#pragma once
/** \brief current AMDiS version */
#ifndef AMDIS_VERSION
#define AMDIS_VERSION "AMDiS: Version 0.9.1"
#endif
#include <boost/config.hpp>
#define CACHE_LINE 16
#if defined(__clang__) // Clang/LLVM.
#include "config/Config_clang.h"
#elif defined(__ICC) || defined(__INTEL_COMPILER) // Intel ICC/ICPC.
#include "config/Config_intel.h"
#elif defined(__GNUC__) || defined(__GNUG__) // GNU GCC/G++.
#include "config/Config_gcc.h"
#elif defined(__HP_cc) || defined(__HP_aCC)
error: not supported compiler
#elif defined(__IBMC__) || defined(__IBMCPP__)
error: not supported compiler
#elif defined(_MSC_VER) // Microsoft Visual Studio.
#include "config/Config_msc.h"
#elif defined(__PGI) // Portland Group PGCC/PGCPP.
error: not supported compiler
// #include "Config_pgi.h"
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
error: not supported compiler
#endif
#include "config/Config_defaults.h"
\ No newline at end of file
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#ifndef AMDIS_CYLINDERPROJECT_H #ifndef AMDIS_CYLINDERPROJECT_H
#define AMDIS_CYLINDERPROJECT_H #define AMDIS_CYLINDERPROJECT_H
#include "MatrixVectorOperations.h"
namespace AMDiS { namespace AMDiS {
/** \brief /** \brief
......
...@@ -350,10 +350,10 @@ namespace AMDiS { ...@@ -350,10 +350,10 @@ namespace AMDiS {
{} {}
/// Constructs a DOFVector with name n belonging to FiniteElemSpace f /// Constructs a DOFVector with name n belonging to FiniteElemSpace f
DOFVector(const FiniteElemSpace* f, std::string n, bool addToSynch = true); DOFVector(const FiniteElemSpace* f, std::string n, bool addToSynch = false);
/// Initialization. /// Initialization.
void init(const FiniteElemSpace* f, std::string n, bool addToSynch = true); void init(const FiniteElemSpace* f, std::string n, bool addToSynch = false);
/// Copy Constructor /// Copy Constructor
DOFVector(const DOFVector& rhs) : DOFVectorBase<T>() DOFVector(const DOFVector& rhs) : DOFVectorBase<T>()
......
...@@ -130,7 +130,7 @@ namespace AMDiS { ...@@ -130,7 +130,7 @@ namespace AMDiS {
(this->feSpace->getAdmin())->addDOFIndexed(this); (this->feSpace->getAdmin())->addDOFIndexed(this);
this->boundaryManager = new BoundaryManager(f); this->boundaryManager = new BoundaryManager(f);
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
if ( Parallel::MeshDistributor::globalMeshDistributor != NULL) if (addToSynch && Parallel::MeshDistributor::globalMeshDistributor != NULL)
Parallel::MeshDistributor::globalMeshDistributor->addInterchangeVector(this); Parallel::MeshDistributor::globalMeshDistributor->addInterchangeVector(this);
#endif #endif
} }
......
...@@ -37,10 +37,10 @@ namespace AMDiS { ...@@ -37,10 +37,10 @@ namespace AMDiS {
*/ */
struct DualElInfo struct DualElInfo
{ {
ElInfo *rowElInfo; ElInfo *rowElInfo; ///< elInfo related to testfunction
ElInfo *colElInfo; ElInfo *colElInfo; ///< elInfo related to trialfunction
ElInfo *smallElInfo; ElInfo *smallElInfo; ///< the smaller element of (rowElInfo, colElInfo) with refinementPath relative to largeElInfo
ElInfo *largeElInfo; ElInfo *largeElInfo; ///< the larger element of (rowElInfo, colElInfo)
}; };
/// Parallel traversal of two meshes. /// Parallel traversal of two meshes.
......
...@@ -252,7 +252,7 @@ namespace AMDiS { ...@@ -252,7 +252,7 @@ namespace AMDiS {
virtual mtl::dense2D<double>& getSubElemGradCoordsMat(int degree) const virtual mtl::dense2D<double>& getSubElemGradCoordsMat(int degree) const
{ {
return subElemGradMatrices[degree][std::make_pair(refinementPathLength, refinementPath)]; return getSubElemCoordsMat(degree);
} }
/** \} */ /** \} */
......
...@@ -367,22 +367,7 @@ namespace AMDiS { ...@@ -367,22 +367,7 @@ namespace AMDiS {
mtl::dense2D<double>& ElInfo1d::getSubElemGradCoordsMat(int degree) const mtl::dense2D<double>& ElInfo1d::getSubElemGradCoordsMat(int degree) const
{ {
FUNCNAME("ElInfo1d::getSubElemGradCoordsMat()"); return getSubElemCoordsMat(degree);
TEST_EXIT(degree == 1)("Not supported for basis functions with degree > 1!\n");
using namespace mtl;
if (subElemGradMatrices[degree].count(std::make_pair(refinementPathLength, refinementPath)) == 0) {
dense2D<double> mat(mat_d1);
for (int i = 0; i < refinementPathLength; i++)
mat *= 0.5;
subElemGradMatrices[1][std::make_pair(refinementPathLength, refinementPath)] = mat;
}
return subElemGradMatrices[degree][std::make_pair(refinementPathLength, refinementPath)];
} }
......
...@@ -66,63 +66,63 @@ namespace AMDiS { ...@@ -66,63 +66,63 @@ namespace AMDiS {
double ElInfo2d::mat_d3_left_val[10][10] = {{0.0, 1.0, -0.0625, 0.3125, 0.0, 0.0, 0.0625, 0.0, 0.0, -0.0625}, double ElInfo2d::mat_d3_left_val[10][10] = {{0.0, 1.0, -6.25e-02, 3.125e-01, 0.0, 0.0, 6.25e-02, 0.0, 0.0, -6.25e-02},
{0.0, 0.0, -0.0625, 0.0625, 0.0, 0.0, 0.0625, 0.0, 0.0, 0.0625}, {0.0, 0.0, -6.25e-02, 6.25e-02, 0.0, 0.0, 6.25e-02, 0.0, 0.0, 6.25e-02},
{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.25, 0.0, 0.0, -0.125}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.5e-01, 0.0, 0.0, -0.125},
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 1.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.25, 0.0, 1.0, 0.375}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.5e-01, 0.0, 1.0, 0.375},
{0.0, 0.0, 0.5625, 0.9375, 1.0, 0.0, -0.0625, 0.0, 0.0, 0.1875}, {0.0, 0.0, 5.625e-01, 9.375e-01, 1.0, 0.0, -6.25e-02, 0.0, 0.0, 1.875e-01},
{0.0, 0.0, 0.5625, -0.3125, 0.0, 0.0, -0.0625, 0.0, 0.0, 0.0}, {0.0, 0.0, 5.625e-01, -3.125e-01, 0.0, 0.0, -6.25e-02, 0.0, 0.0, -1.875e-01},
{0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.5, 0.0, 0.0, 0.75}}; {0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.5, 0.0, 0.0, 7.5e-01}};
mtl::dense2D<double> ElInfo2d::mat_d3_left(mat_d3_left_val); mtl::dense2D<double> ElInfo2d::mat_d3_left(mat_d3_left_val);
double ElInfo2d::mat_d3_right_val[10][10] = {{0.0, 0.0, -0.0625, 0.0625, 0.0, 0.0, 0.0625, 0.0, 0.0, 0.0625}, double ElInfo2d::mat_d3_right_val[10][10] = {{0.0, 0.0, -6.25e-02, 6.25e-02, 0.0, 0.0, 6.25e-02, 0.0, 0.0, 6.25e-02},
{1.0, 0.0, -0.0625, 0.0625, 0.0, 0.0, 0.3125, 0.0, 0.0, -0.0625}, {1.0, 0.0, -6.25e-02, 6.25e-02, 0.0, 0.0, 3.125e-01, 0.0, 0.0, -6.25e-02},
{0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, -0.25, 0.0, 0.0, 0.0, 1.0, 0.0, 0.375}, {0.0, 0.0, 0.0, -2.5e-01, 0.0, 0.0, 0.0, 1.0, 0.0, 0.375},
{0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0},
{0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, -0.25, 0.0, 0.0, 0.0, 0.0, 0.0, -0.125}, {0.0, 0.0, 0.0, -2.5e-01, 0.0, 0.0, 0.0, 0.0, 0.0, -0.125},
{0.0, 0.0, 0.5625, -0.0625, 0.0, 0.0, -0.3125, 0.0, 0.0, -0.1875}, {0.0, 0.0, 5.625e-01, -6.25e-02, 0.0, 0.0, -3.125e-01, 0.0, 0.0, -1.875e-01},
{0.0, 0.0, 0.5625, -0.0625, 0.0, 1.0, 0.9375, 0.0, 0.0, 0.1875}, {0.0, 0.0, 5.625e-01, -6.25e-02, 0.0, 1.0, 9.375e-01, 0.0, 0.0, 1.875e-01},
{0.0, 0.0, 0.0, 0.5, 1.0, 0.0, 0.0, 0.0, 0.0, 0.75}}; {0.0, 0.0, 0.0, 0.5, 1.0, 0.0, 0.0, 0.0, 0.0, 7.5e-01}};
mtl::dense2D<double> ElInfo2d::mat_d3_right(mat_d3_right_val); mtl::dense2D<double> ElInfo2d::mat_d3_right(mat_d3_right_val);
double ElInfo2d::mat_d4_left_val[15][15] = {{0.0, 1.0, 0.0, 2.734375e-01, 0.0, -3.90625e-02, 2.34375e-02, 0.0, -3.90625e-02, 0.0, 0.0, 0.0, 2.34375e-02, -3.90625e-02, 0.0}, double ElInfo2d::mat_d4_left_val[15][15] = {{0.0, 1.0, 0.0, 2.734375e-01, 0.0, -3.906250e-02, 2.343750e-02, 0.0, -3.906250e-02, 0.0, 0.0, 0.0, 2.343750e-02, -3.906250e-02, 0.0},
{0.0, 0.0, 0.0, -3.90625e-02, 0.0, 2.34375e-02, 2.34375e-02, 0.0, -3.90625e-02, 0.0, 0.0, 0.0, -3.90625e-02, -3.90625e-02, 0.0}, {0.0, 0.0, 0.0, -3.906250e-02, 0.0, 2.343750e-02, 2.343750e-02, 0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, 0.0, -6.25e-02, 0.0, 1.875e-01, 0.0, 0.0, 1.0, -1.25e-01, 3.125e-01, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -6.25e-02, 0.0, 1.875e-01, 0.0, 0.0, 1.0, -0.125, 3.125e-01, 0.0},
{0.0, 0.0, 0.0, 1.09375e+00, 1.0, 4.6875e-01, -9.375e-02, 0.0, 3.125e-02, 0.0, 0.0, 0.0, -3.125e-02, 1.5625e-01, 0.0}, {0.0, 0.0, 0.0, 1.093750e+00, 1.0, 4.687500e-01, -9.375e-02, 0.0, 3.125e-02, 0.0, 0.0, 0.0, -3.125e-02, 1.562500e-01, 0.0},
{0.0, 0.0, 1.0, -5.46875e-01, 0.0, 7.03125e-01, 1.40625e-01, 0.0, 1.5625e-02, 0.0, 0.0, 0.0, -4.6875e-02, -2.34375e-01, 0.0}, {0.0, 0.0, 1.0, -5.468750e-01, 0.0, 7.031250e-01, 1.406250e-01, 0.0, 1.562500e-02, 0.0, 0.0, 0.0, -4.687500e-02, -2.343750e-01, 0.0},
{0.0, 0.0, 0.0, 2.1875e-01, 0.0, -1.5625e-01, -9.375e-02, 0.0, 3.125e-02, 0.0, 0.0, 0.0, 9.375e-02, 1.5625e-01, 0.0}, {0.0, 0.0, 0.0, 2.187500e-01, 0.0, -1.562500e-01, -9.375e-02, 0.0, 3.125e-02, 0.0, 0.0, 0.0, 9.375e-02, 1.562500e-01, 0.0},
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5.625e-01, 0.0, -1.875e-01, 0.0, 0.0, 0.0, 3.75e-01, 9.375e-01, 1.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5.625e-01, 0.0, -1.875e-01, 0.0, 0.0, 0.0, 0.375, 9.375e-01, 1.0},
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5.625e-01, 0.0, -1.875e-01, 0.0, 0.0, 0.0, -3.75e-01, -3.125e-01, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5.625e-01, 0.0, -1.875e-01, 0.0, 0.0, 0.0, -0.375, -3.125e-01, 0.0},
{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 7.5e-01, 0.0, 0.0, 0.0, 7.5e-01, 0.0, 0.0}}; {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 7.5e-01, 0.0, 0.0, 0.0, 7.5e-01, 0.0, 0.0}};
mtl::dense2D<double> ElInfo2d::mat_d4_left(mat_d4_left_val); mtl::dense2D<double> ElInfo2d::mat_d4_left(mat_d4_left_val);
double ElInfo2d::mat_d4_right_val[15][15] = {{0.0, 0.0, 0.0, -3.90625e-02, 0.0, 2.34375e-02, 2.34375e-02, 0.0, -3.90625e-02, 0.0, 0.0, 0.0, -3.90625e-02, -3.90625e-02, 0.0}, double ElInfo2d::mat_d4_right_val[15][15] = {{0.0, 0.0, 0.0, -3.906250e-02, 0.0, 2.343750e-02, 2.343750e-02, 0.0, -3.906250e-02, 0.0, 0.0, 0.0, -3.906250e-02, -3.906250e-02, 0.0},
{1.0, 0.0, 0.0, -3.90625e-02, 0.0, 2.34375e-02, -3.90625e-02, 0.0, 2.734375e-01, 0.0, 0.0, 0.0, -3.90625e-02, 2.34375e-02, 0.0}, {1.0, 0.0, 0.0, -3.906250e-02, 0.0, 2.343750e-02, -3.906250e-02, 0.0, 2.734375e-01, 0.0, 0.0, 0.0, -3.906250e-02, 2.343750e-02, 0.0},
{0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 1.875e-01, 0.0, -6.25e-02, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 3.125e-01, -1.25e-01, 0.0}, {0.0, 0.0, 0.0, 1.875e-01, 0.0, -6.25e-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562500e-01, 9.375e-02, 0.0},
{0.0, 0.0, 1.0, 1.5625e-02, 0.0, 1.40625e-01, 7.03125e-01, 0.0, -5.46875e-01, 0.0, 0.0, 0.0, -2.34375e-01, -4.6875e-02, 0.0}, {0.0, 0.0, 1.0, 1.562500e-02, 0.0, 1.406250e-01, 7.031250e-01, 0.0, -5.468750e-01, 0.0, 0.0, 0.0, -2.343750e-01, -4.687500e-02, 0.0},
{0.0, 0.0, 0.0, 3.125e-02, 0.0, -9.375e-02, 4.6875e-01, 1.0, 1.09375e+00, 0.0, 0.0, 0.0, 1.5625e-01, -3.125e-02, 0.0}, {0.0, 0.0, 0.0, 3.125e-02, 0.0, -9.375e-02, 4.687500e-01, 1.0, 1.093750e+00, 0.0, 0.0, 0.0, 1.562500e-01, -3.125e-02, 0.0},
{0.0, 0.0, 0.0, -1.875e-01, 0.0, 5.625e-01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -3.125e-01, -3.75e-01, 0.0}, {0.0, 0.0, 0.0, -1.875e-01, 0.0, 5.625e-01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -3.125e-01, -0.375, 0.0},
{0.0, 0.0, 0.0, -1.875e-01, 0.0, 5.625e-01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9.375e-01, 3.75e-01, 1.0}, {0.0, 0.0, 0.0, -1.875e-01, 0.0, 5.625e-01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9.375e-01, 0.375, 1.0},
{0.0, 0.0, 0.0, 7.5e-01, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7.5e-01, 0.0}}; {0.0, 0.0, 0.0, 7.5e-01, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7.5e-01, 0.0}};
mtl::dense2D<double> ElInfo2d::mat_d4_right(mat_d4_right_val); mtl::dense2D<double> ElInfo2d::mat_d4_right(mat_d4_right_val);
...@@ -873,39 +873,6 @@ namespace AMDiS { ...@@ -873,39 +873,6 @@ namespace AMDiS {
mtl::dense2D<double>& ElInfo2d::getSubElemGradCoordsMat(int degree) const mtl::dense2D<double>& ElInfo2d::getSubElemGradCoordsMat(int degree) const
{ {
FUNCNAME("ElInfo2d::getSubElemGradCoordsMat()"); return getSubElemCoordsMat(degree);
TEST_EXIT(degree == 1)("Not supported for basis functions with degree > 1!\n");
using namespace mtl;
if (subElemGradMatrices[degree].count(std::make_pair(refinementPathLength, refinementPath)) == 0) {
dense2D<double> mat(3, 3), tmpMat(3, 3);
mat = 1;
double test_left[3][3] = {{0.0, 0.0, 0.5},
{-0.5, -0.5, 0.0},
{1.0, 0.0, 0.0}};
double test_right[3][3] = {{0.0, 0.0, 0.5},
{0.5, -0.5, 0.0},
{0.0, 1.0, 0.0}};
mtl::dense2D<double> mat_left(test_left);
mtl::dense2D<double> mat_right(test_right);
for (int i = 0; i < refinementPathLength; i++)
if (refinementPath & (1 << i)) {
tmpMat = mat_right * mat;
mat = tmpMat;
} else {
tmpMat = mat_left * mat;
mat = tmpMat;
}
subElemGradMatrices[1][std::make_pair(refinementPathLength, refinementPath)] = mat;
}
return subElemGradMatrices[degree][std::make_pair(refinementPathLength, refinementPath)];
} }
} }
...@@ -824,11 +824,7 @@ namespace AMDiS { ...@@ -824,11 +824,7 @@ namespace AMDiS {
mtl::dense2D<double>& ElInfo3d::getSubElemGradCoordsMat(int degree) const mtl::dense2D<double>& ElInfo3d::getSubElemGradCoordsMat(int degree) const
{ {
FUNCNAME("ElInfo3d::getSubElemGradCoordsMat()"); return getSubElemCoordsMat(degree);
ERROR_EXIT("Not yet implemented!\n");
return subElemGradMatrices[degree][std::make_pair(refinementPathLength, refinementPath)];
} }
} }
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "AMDiS_fwd.h" #include "AMDiS_fwd.h"
#include "OperatorTerm.h" #include "OperatorTerm.h"
#include "Functors.h" #include "Functors.h"
#include "MatrixVectorOperations.h"