Commit 96603477 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

[Rmv-GlobalToLocal-in-DGElement] use global to local of cell

parent fa34b96d
#include "DGElement.hpp"
[[deprecated("Simply Use GlobalToLocal of Cell")]]
Point AcousticDGElement::GlobalToLocal(const Point &z) const {
switch(C.Type()) {
case INTERVAL: {
Point p(z);
p[0] -= C.Corner(0)[0];
double length = abs(C.Corner(0)[0] - C.Corner(1)[0]);
p /= length;
return p;
}
case TRIANGLE: {
Tensor T;
T[0][0] = C.Corner(1)[0] - C.Corner(0)[0];
T[0][1] = C.Corner(2)[0] - C.Corner(0)[0];
T[1][0] = C.Corner(1)[1] - C.Corner(0)[1];
T[1][1] = C.Corner(2)[1] - C.Corner(0)[1];
T[0][2] = 0;
T[1][2] = 0;
T[2][0] = 0;
T[2][1] = 0;
T[2][2] = 1;
Tensor IT = Invert(T);
return IT * (z - C.Corner(0));
}
case TETRAHEDRON: Exit("not implemented");
case QUADRILATERAL: {
if (inverseTensor == false) {
IT = new Tensor;
(*IT)[0][0] = C.Corner(1)[0] - C.Corner(0)[0];
(*IT)[0][1] = C.Corner(3)[0] - C.Corner(0)[0];
(*IT)[1][0] = C.Corner(1)[1] - C.Corner(0)[1];
(*IT)[1][1] = C.Corner(3)[1] - C.Corner(0)[1];
(*IT)[0][2] = 0;
(*IT)[1][2] = 0;
(*IT)[2][0] = 0;
(*IT)[2][1] = 0;
(*IT)[2][2] = 1;
IT->Invert();
inverseTensor = true;
}
return (*IT) * (z - C.Corner(0));
}
case HEXAHEDRON: Exit("not implemented");
default: Exit("not implemented");
}
Exit("Not implemented!");
return Origin;
return C.GlobalToLocal(z);
}
AcousticDGElement::AcousticDGElement(const VectorMatrixBase &base,
......
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