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

error in evalAtPoint corrected

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