Skip to content
Snippets Groups Projects
Commit 9c12ccd2 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

spetialize xyz2uvw for p1Triangle

parent 221a5428
No related branches found
No related tags found
No related merge requests found
...@@ -91,43 +91,24 @@ double MTriangle::gammaShapeMeasure() ...@@ -91,43 +91,24 @@ double MTriangle::gammaShapeMeasure()
#endif #endif
} }
// void MTriangle::xyz2uvw(double xyz[3], double uvw[3]){ void MTriangle::xyz2uvw(double xyz[3], double uvw[3])
{
// double X[3] = {_v[0]->x(), _v[1]->x(), _v[2]->x()}; const double O[3] = {_v[0]->x(), _v[0]->y(), _v[0]->z()};
// double Y[3] = {_v[0]->y(), _v[1]->y(), _v[2]->y()}; const double d[3] = {xyz[0] - O[0], xyz[1] - O[1], xyz[2] - O[2]};
// double Z[3] = {_v[0]->z(), _v[1]->z(), _v[2]->z()}; const double d1[3] = {_v[1]->x() - O[0], _v[1]->y() - O[1], _v[1]->z() - O[2]};
const double d2[3] = {_v[2]->x() - O[0], _v[2]->y() - O[1], _v[2]->z() - O[2]};
// uvw[0] = uvw[1] = uvw[2] = 0.; const double Jxy = d1[0] * d2[1] - d1[1] * d2[0];
const double Jxz = d1[0] * d2[2] - d1[2] * d2[0];
// double jac[3][3] = {{X[1]-X[0], X[2]-X[Ø], 0},{}, {}}; if (fabs(Jxy) > fabs(Jxz)) {
uvw[0] = (d[0] * d2[1] - d[1] * d2[0]) / Jxy;
uvw[1] = (d[1] * d1[0] - d[0] * d1[1]) / Jxy;
// if(!getJacobian(uvw[0], uvw[1], uvw[2], jac)) break; }
else {
// double xn = 0., yn = 0., zn = 0.; uvw[0] = (d[0] * d2[2] - d[2] * d2[0]) / Jxz;
// double sf[1256]; uvw[1] = (d[2] * d1[0] - d[0] * d1[2]) / Jxz;
// getShapeFunctions(uvw[0], uvw[1], uvw[2], sf); }
// for (int i = 0; i < getNumShapeFunctions(); i++) { uvw[2] = 0.;
// MVertex *v = getShapeFunctionNode(i); }
// xn += v->x() * sf[i];
// yn += v->y() * sf[i];
// zn += v->z() * sf[i];
// }
// double inv[3][3];
// inv3x3(jac, inv);
// double un = uvw[0] + inv[0][0] * (xyz[0] - xn) +
// inv[1][0] * (xyz[1] - yn) + inv[2][0] * (xyz[2] - zn);
// double vn = uvw[1] + inv[0][1] * (xyz[0] - xn) +
// inv[1][1] * (xyz[1] - yn) + inv[2][1] * (xyz[2] - zn);
// double wn = uvw[2] + inv[0][2] * (xyz[0] - xn) +
// inv[1][2] * (xyz[1] - yn) + inv[2][2] * (xyz[2] - zn);
// uvw[0] = un;
// uvw[1] = vn;
// uvw[2] = wn;
//}
const polynomialBasis* MTriangle::getFunctionSpace(int o) const const polynomialBasis* MTriangle::getFunctionSpace(int o) const
{ {
......
...@@ -63,7 +63,7 @@ class MTriangle : public MElement { ...@@ -63,7 +63,7 @@ class MTriangle : public MElement {
static const int map[3] = {0, 2, 1}; static const int map[3] = {0, 2, 1};
return getVertex(map[num]); return getVertex(map[num]);
} }
//virtual void xyz2uvw(double xyz[3], double uvw[3]); virtual void xyz2uvw(double xyz[3], double uvw[3]);
virtual MVertex *getOtherVertex(MVertex *v1, MVertex *v2) virtual MVertex *getOtherVertex(MVertex *v1, MVertex *v2)
{ {
if(_v[0] != v1 && _v[0] != v2) return _v[0]; if(_v[0] != v1 && _v[0] != v2) return _v[0];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment