Commit 09c650f9 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

error in evalAtPoint corrected

parent b00c153a
...@@ -96,8 +96,8 @@ namespace AMDiS { ...@@ -96,8 +96,8 @@ namespace AMDiS {
if (inside) { if (inside) {
basFcts->getLocalIndices(elInfo->getElement(), feSpace->getAdmin(), localIndices); basFcts->getLocalIndices(elInfo->getElement(), feSpace->getAdmin(), localIndices);
ElementVector uh(lambda.size()); ElementVector uh(nBasFcts);
for (int i = 0; i < lambda.size(); i++) for (int i = 0; i < nBasFcts; i++)
uh[i] = operator[](localIndices[i]); uh[i] = operator[](localIndices[i]);
value = basFcts->evalUh(lambda, uh); value = basFcts->evalUh(lambda, uh);
} else } else
...@@ -145,8 +145,8 @@ namespace AMDiS { ...@@ -145,8 +145,8 @@ namespace AMDiS {
if (inside) { if (inside) {
basFcts->getLocalIndices(elInfo->getElement(), feSpace->getAdmin(), localIndices); basFcts->getLocalIndices(elInfo->getElement(), feSpace->getAdmin(), localIndices);
mtl::dense_vector<WorldVector<double> > uh(lambda.size()); mtl::dense_vector<WorldVector<double> > uh(nBasFcts);
for (int i = 0; i < lambda.size(); i++) for (int i = 0; i < nBasFcts; i++)
uh[i] = operator[](localIndices[i]); uh[i] = operator[](localIndices[i]);
*val = basFcts->evalUh(lambda, uh); *val = basFcts->evalUh(lambda, uh);
} else } else
......
...@@ -980,16 +980,20 @@ namespace AMDiS { ...@@ -980,16 +980,20 @@ namespace AMDiS {
return false; return false;
basFcts->getLocalIndices(elInfo->getElement(), this->feSpace->getAdmin(), localIndices); basFcts->getLocalIndices(elInfo->getElement(), this->feSpace->getAdmin(), localIndices);
FixVec<WorldVector<double>, VERTEX> coords = elInfo->getCoords();
WorldVector<double> coord;
int minIdx = -1; int minIdx = -1;
double minDist = 1.e15; double minDist = 1.e15;
for (int i = 0; i < coords.size(); i++) { for (int i = 0; i < numBasFcts; i++) {
WorldVector<double> dist = coords[i] - p; elInfo->coordToWorld(*(basFcts->getCoords(i)), coord);
WorldVector<double> dist = coord - p;
double newDist = norm(dist); double newDist = norm(dist);
if (newDist < minDist) { if (newDist < minDist) {
minIdx = i; minIdx = i;
minDist = newDist; minDist = newDist;
if (minDist < 1.e-10)
break;
} }
} }
......
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