Commit c396867c authored by Praetorius, Simon's avatar Praetorius, Simon

kdtree

parent c0dbb2af
......@@ -37,6 +37,7 @@
#include "AMDiS.h"
#include "ElementFunction.h"
#include "GeometryTools.h"
using namespace nanoflann;
using namespace AMDiS;
......@@ -220,22 +221,22 @@ typedef std::vector<DataType> VectorOfDataType;
DimVec<double> lambda(dim, NO_INIT);
if (dim == 1) {
double lendth = abs(elInfo->getCoord(1) - elInfo->getCoord(0));
double length = abs(elInfo->getCoord(1)[0] - elInfo->getCoord(0)[0]);
for (int i = 0; i < dim+1; i++)
lambda[i] = abs(p - elInfo->getCoord((i+1)%2))/length;
lambda[i] = abs(x[0] - elInfo->getCoord((i+1)%2)[0])/length;
}
else if (dim == 2) {
double area = meshconv::triangle_area_3d(elInfo->getCoord(0).begin(),
elInfo->getCoord(1).begin(), elInfo->getCoord(2).begin())
elInfo->getCoord(1).begin(), elInfo->getCoord(2).begin());
for (int i = 0; i < dim+1; i++)
lambda[i] = meshconv::triangle_area_3d(p.begin(),
lambda[i] = meshconv::triangle_area_3d(x.begin(),
elInfo->getCoord((i+1)%3).begin(), elInfo->getCoord((i+2)%3).begin())/area;
}
else if (dim == 3) {
double volume = meshconv::volume_tetrahedron(elInfo->getCoord(0).begin(),
elInfo->getCoord(1).begin(), elInfo->getCoord(2).begin(), elInfo->getCoord(3).begin())
elInfo->getCoord(1).begin(), elInfo->getCoord(2).begin(), elInfo->getCoord(3).begin());
for (int i = 0; i < dim+1; i++)
lambda[i] = meshconv::volume_tetrahedron(p.begin(),
lambda[i] = meshconv::volume_tetrahedron(x.begin(),
elInfo->getCoord((i+1)%3).begin(), elInfo->getCoord((i+2)%3).begin(), elInfo->getCoord((i+3)%3).begin())/volume;
}
......
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