improved elementmapping for non-curved trigs

This commit is contained in:
Joachim Schoeberl 2012-06-07 18:51:36 +00:00
parent 97630292e2
commit 4e3be67517

View File

@ -3270,6 +3270,21 @@ namespace netgen
if (x)
{
if (info.order == 1 && type == TRIG)
{
for (int j = 0; j < npts; j++)
{
Point<2> vxi(xi[j*sxi], xi[j*sxi+1]);
Point<DIM_SPACE> val (coefs[2]);
val += vxi(0) * (coefs[0]-coefs[2]);
val += vxi(1) * (coefs[1]-coefs[2]);
for (int k = 0; k < DIM_SPACE; k++)
x[j*sx+k] = val(k);
}
}
else
for (int j = 0; j < npts; j++)
{
Point<2> vxi(xi[j*sxi], xi[j*sxi+1]);
@ -3285,6 +3300,26 @@ namespace netgen
}
if (dxdxi)
{
if (info.order == 1 && type == TRIG)
{
Point<2> xij(xi[0], xi[1]);
CalcElementDShapes (info, xij, dshapes);
Mat<3,2> dxdxij;
dxdxij = 0.0;
for (int i = 0; i < coefs.Size(); i++)
for (int j = 0; j < DIM_SPACE; j++)
for (int k = 0; k < 2; k++)
dxdxij(j,k) += dshapes(i,k) * coefs[i](j);
for (int ip = 0; ip < npts; ip++)
for (int j = 0; j < DIM_SPACE; j++)
for (int k = 0; k < 2; k++)
dxdxi[ip*sdxdxi+2*j+k] = dxdxij(j,k);
}
else
{
for (int j = 0; j < npts; j++)
{
@ -3304,6 +3339,7 @@ namespace netgen
}
}
}
}