41 namespace SpatialDomains
95 m_expDim(xmap->GetShapeDimension()),
111 m_expDim(S.m_expDim),
112 m_coordDim(S.m_coordDim),
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();
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();
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();
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();
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();
509 &deriv[1][0][0], 1, &deriv[0][1][0], 1,
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);
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],
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,
Array< OneD, NekDouble > ComputeJac(const LibUtilities::PointsKeyVector &keyTgt) const
Return the Jacobian of the mapping and cache the result.
void Adjoint(const Array< TwoD, const NekDouble > &src, Array< TwoD, NekDouble > &tgt) const
Compute the transpose of the cofactors matrix.
std::vector< PointsKey > PointsKeyVector
GeomType m_type
Type of geometry (e.g. eRegular, eDeformed, eMovingRegular).
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
T Vmin(int n, const T *x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
DerivStorage GetDeriv(const LibUtilities::PointsKeyVector &keyTgt)
Return the derivative of the mapping with respect to the reference coordinates, . ...
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
void CheckIfValid()
Tests if the element is valid and not self-intersecting.
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
int m_coordDim
Dimension of coordinate system.
Array< TwoD, NekDouble > ComputeGmat(const LibUtilities::PointsKeyVector &keyTgt) const
Computes the Laplacian coefficients .
~GeomFactors()
Destructor.
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis...
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > DerivStorage
Storage type for derivative of mapping.
bool m_valid
Validity of element (Jacobian positive)
void Vvtvvtm(int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtm (vector times vector minus vector times vector):
void Interp(const LibUtilities::PointsKeyVector &src_points, const Array< OneD, const NekDouble > &src, const LibUtilities::PointsKeyVector &tgt_points, Array< OneD, NekDouble > &tgt) const
Perform interpolation of data between two point distributions.
int m_expDim
Dimension of expansion.
void Interp3D(const BasisKey &fbasis0, const BasisKey &fbasis1, const BasisKey &fbasis2, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, const BasisKey &tbasis2, Array< OneD, NekDouble > &to)
this function interpolates a 3D function evaluated at the quadrature points of the 3D basis...
Calculation and storage of geometric factors associated with the mapping from StdRegions reference el...
GeomFactors(const GeomType gtype, const int coordim, const StdRegions::StdExpansionSharedPtr &xmap, const Array< OneD, Array< OneD, NekDouble > > &coords)
Constructor for GeomFactors class.
Geometry is straight-sided with constant geometric factors.
bool operator==(const GeomFactors &lhs, const GeomFactors &rhs)
Equivalence test for GeomFactors objects.
void Interp1D(const BasisKey &fbasis0, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, Array< OneD, NekDouble > &to)
this function interpolates a 1D function evaluated at the quadrature points of the basis fbasis0 to ...
Array< TwoD, NekDouble > ComputeDerivFactors(const LibUtilities::PointsKeyVector &keyTgt) const
Return the derivative of the reference coordinates with respect to the mapping, . ...
Array< OneD, Array< OneD, NekDouble > > m_coords
Stores coordinates of the geometry.
StdRegions::StdExpansionSharedPtr m_xmap
Stores information about the expansion.
GeomType
Indicates the type of element geometry.
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Geometry is curved or has non-constant factors.
DerivStorage ComputeDeriv(const LibUtilities::PointsKeyVector &keyTgt) const