Gyselalib++
MetricTensor< Mapping, PositionCoordinate > Class Template Reference

An operator for calculating the metric tensor. More...

Public Types

using Matrix_2x2 = std::array< std::array< double, 2 >, 2 >
 The type of the Jacobian matrix and its inverse.
 

Public Member Functions

KOKKOS_FUNCTION MetricTensor (Mapping mapping)
 A constructor for the metric tensor operator. More...
 
KOKKOS_FUNCTION void operator() (Matrix_2x2 &matrix, PositionCoordinate const &coord) const
 Compute the metric tensor assignd to the mapping. More...
 
KOKKOS_FUNCTION void inverse (Matrix_2x2 &matrix, PositionCoordinate const &coord) const
 Compute the inverse metric tensor associated to the mapping. More...
 
KOKKOS_FUNCTION std::array< double, 2 > to_covariant (std::array< double, 2 > const &contravariant_vector, PositionCoordinate const &coord) const
 Compute the covariant vector from the contravariant vector. More...
 

Detailed Description

template<class Mapping, class PositionCoordinate>
class MetricTensor< Mapping, PositionCoordinate >

An operator for calculating the metric tensor.

Template Parameters
MappingThe mapping providing the Jacobian operator.
PositionCoordinateThe coordinate type where the metric tensor can be evaluated.

Constructor & Destructor Documentation

◆ MetricTensor()

template<class Mapping , class PositionCoordinate >
KOKKOS_FUNCTION MetricTensor< Mapping, PositionCoordinate >::MetricTensor ( Mapping  mapping)
inline

A constructor for the metric tensor operator.

Parameters
[in]mappingThe mapping which can be used to calculate the Jacobian.

Member Function Documentation

◆ operator()()

template<class Mapping , class PositionCoordinate >
KOKKOS_FUNCTION void MetricTensor< Mapping, PositionCoordinate >::operator() ( Matrix_2x2 matrix,
PositionCoordinate const &  coord 
) const
inline

Compute the metric tensor assignd to the mapping.

The metric tensor matrix is defined as: \( G = (J_{\mathcal{F}})^T J_{\mathcal{F}} \). with \( J_{\mathcal{F}} \) the Jacobian matrix.

Parameters
[in]coordThe coordinate where we evaluate the metric tensor.
[out]matrixThe metric tensor matrix.

◆ inverse()

template<class Mapping , class PositionCoordinate >
KOKKOS_FUNCTION void MetricTensor< Mapping, PositionCoordinate >::inverse ( Matrix_2x2 matrix,
PositionCoordinate const &  coord 
) const
inline

Compute the inverse metric tensor associated to the mapping.

Parameters
[in]coordThe coordinate where we evaluate the metric tensor.
[out]matrixThe metric tensor matrix.

◆ to_covariant()

template<class Mapping , class PositionCoordinate >
KOKKOS_FUNCTION std::array<double, 2> MetricTensor< Mapping, PositionCoordinate >::to_covariant ( std::array< double, 2 > const &  contravariant_vector,
PositionCoordinate const &  coord 
) const
inline

Compute the covariant vector from the contravariant vector.

Parameters
[in]contravariant_vectorThe metric tensor matrix.
[in]coordThe coordinate where we want to compute the convariant vector.
Returns
A vector of the covariant

The documentation for this class was generated from the following file: