41 namespace SpatialDomains
93 const Array<
OneD, Array<OneD, NekDouble> > &coords) :
95 m_expDim(xmap->GetShapeDimension()),
111 m_expDim(S.m_expDim),
112 m_coordDim(S.m_coordDim),
149 const Array<OneD, const NekDouble> jac_lhs =
151 const Array<OneD, const NekDouble> jac_rhs =
153 if(!(jac_lhs == jac_rhs))
174 "Dimension of target point distribution does not match "
175 "expansion dimension.");
179 int nqtot_tbasis = 1;
187 map_points[i] =
m_xmap->GetBasis(i)->GetPointsKey();
188 nqtot_map *= map_points[i].GetNumPoints();
189 nqtot_tbasis *= keyTgt[i].GetNumPoints();
190 deriv[i] = Array<OneD, Array<OneD,NekDouble> >(
m_coordDim);
191 d_map[i] = Array<OneD, Array<OneD,NekDouble> >(
m_coordDim);
197 Array<OneD, NekDouble> tmp(nqtot_map);
205 d_map[j][i] = Array<OneD,NekDouble>(nqtot_map);
206 deriv[j][i] = Array<OneD,NekDouble>(nqtot_tbasis);
207 m_xmap->StdPhysDeriv(j, tmp, d_map[j][i]);
220 same = same && (map_points[j] == keyTgt[j]);
226 deriv[j][i] = d_map[j][i];
233 Interp(map_points, d_map[j][i], keyTgt, deriv[j][i]);
257 "Dimension of target point distribution does not match "
258 "expansion dimension.");
260 int i = 0, j = 0, k = 0, l = 0;
268 ptsTgt *= keyTgt[i].GetNumPoints();
276 Array<TwoD, NekDouble> gmat(m_expDim*m_expDim, ptsTgt, 0.0);
277 Array<OneD, NekDouble> jac (ptsTgt, 0.0);
280 for (i = 0, l = 0; i <
m_expDim; ++i)
300 Vmath::Vvtvp(ptsTgt, &tmp[i][0], 1, &gmat[i*m_expDim][0], 1,
301 &jac[0], 1, &jac[0], 1);
337 "Dimension of target point distribution does not match "
338 "expansion dimension.");
340 int i = 0, j = 0, k = 0, l = 0;
348 ptsTgt *= keyTgt[i].GetNumPoints();
356 Array<TwoD, NekDouble> gmat(m_expDim*m_expDim, ptsTgt, 0.0);
357 Array<OneD, NekDouble> jac (ptsTgt, 0.0);
360 for (i = 0, l = 0; i <
m_expDim; ++i)
380 Vmath::Vvtvp(ptsTgt, &tmp[i][0], 1, &gmat[i*m_expDim][0], 1,
381 &jac[0], 1, &jac[0], 1);
384 for (i = 0; i < m_expDim*
m_expDim; ++i)
386 Vmath::Vdiv(ptsTgt, &gmat[i][0], 1, &jac[0], 1, &gmat[i][0], 1);
402 "Dimension of target point distribution does not match "
403 "expansion dimension.");
405 int i = 0, j = 0, k = 0, l = 0;
413 ptsTgt *= keyTgt[i].GetNumPoints();
421 Array<TwoD, NekDouble> gmat(m_expDim*m_expDim, ptsTgt, 0.0);
422 Array<OneD, NekDouble> jac (ptsTgt, 0.0);
423 Array<TwoD, NekDouble> factors(m_expDim*
m_coordDim, ptsTgt, 0.0);
426 for (i = 0, l = 0; i <
m_expDim; ++i)
446 Vmath::Vvtvp(ptsTgt, &tmp[i][0], 1, &gmat[i*m_expDim][0], 1,
447 &jac[0], 1, &jac[0], 1);
450 for (i = 0; i < m_expDim*
m_expDim; ++i)
452 Vmath::Vdiv(ptsTgt, &gmat[i][0], 1, &jac[0], 1, &gmat[i][0], 1);
466 &gmat[m_expDim*i+j][0], 1,
495 p[i] =
m_xmap->GetBasis(i)->GetPointsKey();
496 nqtot *= p[i].GetNumPoints();
500 Array<OneD, NekDouble> jac(pts, 0.0);
509 &deriv[1][0][0], 1, &deriv[0][1][0], 1,
515 Array<OneD, NekDouble> tmp(pts, 0.0);
518 &deriv[2][1][0], 1, &deriv[1][2][0], 1,
521 &jac[0], 1, &jac[0], 1);
524 &deriv[0][1][0], 1, &deriv[2][2][0], 1,
527 &jac[0], 1, &jac[0], 1);
530 &deriv[1][1][0], 1, &deriv[0][2][0], 1,
533 &jac[0], 1, &jac[0], 1);
554 const Array<OneD, const NekDouble> &src,
556 Array<OneD, NekDouble> &tgt)
const
558 ASSERTL1(src_points.size() == tgt_points.size(),
559 "Dimension of target point distribution does not match "
560 "expansion dimension.");
570 tgt_points[0], tgt_points[1], tgt);
575 tgt_points[0], tgt_points[1],
590 const Array<TwoD, const NekDouble>& src,
591 Array<TwoD, NekDouble>& tgt)
const
593 ASSERTL1(src.num_elements() == tgt.num_elements(),
594 "Source matrix is of different size to destination"
595 "matrix for computing adjoint.");
597 int n = src[0].num_elements();
605 Vmath::Smul (n, -1.0, &src[1][0], 1, &tgt[1][0], 1);
606 Vmath::Smul (n, -1.0, &src[2][0], 1, &tgt[2][0], 1);
611 int a, b, c, d, e, i, j;
618 a = ((i+1)%m_expDim) * m_expDim + ((j+1)%m_expDim);
619 b = ((i+1)%m_expDim) * m_expDim + ((j+2)%m_expDim);
620 c = ((i+2)%m_expDim) * m_expDim + ((j+1)%m_expDim);
621 d = ((i+2)%m_expDim) * m_expDim + ((j+2)%m_expDim);
624 &src[b][0], 1, &src[c][0], 1,