Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
tensors_and_points_dimension_manipulation.h File Reference
#include <deal.II/base/point.h>
#include <deal.II/base/tensor.h>
Include dependency graph for tensors_and_points_dimension_manipulation.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<int dim>
Tensor< 1, 3 > tensor_nd_to_3d (const Tensor< 1, dim > &tensor)
template<int dim>
Tensor< 1, 2 > tensor_nd_to_2d (const Tensor< 1, dim > &tensor)
template<int dim>
Point< 3 > point_nd_to_3d (const Point< dim > &point)
template<int dim>
Point< 2 > point_nd_to_2d (const Point< dim > &point)
template<int dim, typename Number>
DEAL_II_ALWAYS_INLINE Tensor< 1, dim, Number > tangential_component (const Tensor< 1, dim, Number > &tensor, const Tensor< 1, dim > &normal)

Function Documentation

◆ point_nd_to_2d()

template<int dim>
Point< 2 > point_nd_to_2d ( const Point< dim > & point)
inline

Copies a three-dimensional point in a two-dimensional point. The third element of the three-dimensional point (in z direction) is neglected. If the point given is already two dimensional, do nothing and return the point.

Parameters
pointThree-dimensional input point
Returns
point_2d Two-dimensional output point

Definition at line 94 of file tensors_and_points_dimension_manipulation.h.

◆ point_nd_to_3d()

template<int dim>
Point< 3 > point_nd_to_3d ( const Point< dim > & point)
inline

Copies a two-dimensional point in a three-dimensional point. The third element of the three-dimensional point (in z direction) is set to zero. If the point given is already 3d, do nothing and return the point.

Parameters
pointTwo-dimensional input point
Returns
point_3d Three-dimensional output point

Definition at line 69 of file tensors_and_points_dimension_manipulation.h.

◆ tangential_component()

template<int dim, typename Number>
DEAL_II_ALWAYS_INLINE Tensor< 1, dim, Number > tangential_component ( const Tensor< 1, dim, Number > & tensor,
const Tensor< 1, dim > & normal )
inline

Compute the tangential component of a vector on a surface defined by its unit normal vector, which removes the normal component of the vector. In 3D, it computes:

\[\mathbf{t} = \mathbf{n} \times (\mathbf{v} \times \mathbf{n}) \]

In 2D, the unit tangent \(\boldsymbol{\tau}\) is the unit normal rotated by 90 degrees (cross_product_2d), and it computes:

\[\mathbf{t} = (\mathbf{v} \cdot \boldsymbol{\tau}) \boldsymbol{\tau} \]

Both expressions are equal to \(\mathbf{v} - (\mathbf{v} \cdot \mathbf{n}) \mathbf{n}\).

Note
This operation gives the tangential trace of a field, for instance the traces in \(H^{-1/2}(\mathrm{curl})\), where only the tangential components are continuous across interfaces.
Template Parameters
dimSpatial dimension
NumberType of the vector
Parameters
[in]tensorVector whose tangential component is computed.
[in]normalUnit normal vector of the surface.
Returns
The tangential component of the vector.

Definition at line 131 of file tensors_and_points_dimension_manipulation.h.

◆ tensor_nd_to_2d()

template<int dim>
Tensor< 1, 2 > tensor_nd_to_2d ( const Tensor< 1, dim > & tensor)
inline

Copies a three-dimensional tensor in a two-dimensional tensor. The third element of the three-dimensional point (in z direction) is neglected. If the vector is tensor given is two-dimensional, do nothing and return the tensor.

Parameters
tensorThree-dimensional input tensor
Returns
tensor_2d Three-dimensional output tensor

Definition at line 50 of file tensors_and_points_dimension_manipulation.h.

◆ tensor_nd_to_3d()

template<int dim>
Tensor< 1, 3 > tensor_nd_to_3d ( const Tensor< 1, dim > & tensor)
inline

Copies a two-dimensional tensor in a three-dimensional tensor. The third element of the three-dimensional tensor (in z direction) is set to zero. If the tensor given is already 3d, do nothing and return the tensor.

Parameters
tensorthe tensor that should be transformed in 3d
Returns
tensor_3d Three-dimensional output tensor

Definition at line 24 of file tensors_and_points_dimension_manipulation.h.