Commit 147d19c0 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Introduced stack for subElemMatrices.

parent a76531aa
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
namespace AMDiS { namespace AMDiS {
std::map<unsigned long, mtl::dense2D<double> > ElInfo::subElemMatrices;
ElInfo::ElInfo(Mesh *aMesh) ElInfo::ElInfo(Mesh *aMesh)
: mesh(aMesh), : mesh(aMesh),
element(NULL), element(NULL),
......
...@@ -544,6 +544,8 @@ namespace AMDiS { ...@@ -544,6 +544,8 @@ namespace AMDiS {
mtl::dense2D<double> subElemCoordsMat_so; mtl::dense2D<double> subElemCoordsMat_so;
public: public:
static std::map<unsigned long, mtl::dense2D<double> > subElemMatrices;
/** \brief /** \brief
* child_vertex[el_type][child][i] = father's local vertex index of new * child_vertex[el_type][child][i] = father's local vertex index of new
* vertex i. 4 stands for the newly generated vertex . * vertex i. 4 stands for the newly generated vertex .
......
...@@ -697,18 +697,25 @@ namespace AMDiS { ...@@ -697,18 +697,25 @@ namespace AMDiS {
switch (degree) { switch (degree) {
case 1: case 1:
{ {
mat = mat_d1; if (subElemMatrices.count(refinementPath) > 0) {
dense2D<double> tmpMat(num_rows(mat), num_rows(mat)); mat = subElemMatrices[refinementPath];
return;
for (int i = 0; i < refinementPathLength; i++) {
if (refinementPath & (1 << i)) {
tmpMat = mat_d1_right * mat;
mat = tmpMat;
} else {
tmpMat = mat_d1_left * mat;
mat = tmpMat;
} }
}
mat = mat_d1;
dense2D<double> tmpMat(num_rows(mat), num_rows(mat));
for (int i = 0; i < refinementPathLength; i++) {
if (refinementPath & (1 << i)) {
tmpMat = mat_d1_right * mat;
mat = tmpMat;
} else {
tmpMat = mat_d1_left * mat;
mat = tmpMat;
}
}
subElemMatrices[refinementPath] = mat;
} }
break; break;
default: default:
......
...@@ -627,6 +627,8 @@ namespace AMDiS { ...@@ -627,6 +627,8 @@ namespace AMDiS {
// printOpenmpTraverseInfo(this, true); // printOpenmpTraverseInfo(this, true);
// std::cout << "ElInfo = " << ElInfo::subElemMatrices.size() << std::endl;
clock_t first = clock(); clock_t first = clock();
#ifdef _OPENMP #ifdef _OPENMP
double wtime = omp_get_wtime(); double wtime = omp_get_wtime();
......
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