deal.II version GIT relicensing-2287-g6548a49e0a 2024-12-20 18:30:00+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Related Symbols | List of all members
DerivativeForm< order, dim, spacedim, Number > Class Template Reference

#include <deal.II/base/derivative_form.h>

Inheritance diagram for DerivativeForm< order, dim, spacedim, Number >:
Inheritance graph
[legend]

Public Member Functions

 DerivativeForm ()=default
 
 DerivativeForm (const Tensor< order+1, dim, Number > &)
 
 DerivativeForm (const Tensor< 1, spacedim, Tensor< order, dim, Number > > &)
 
Tensor< order, dim, Number > & operator[] (const unsigned int i)
 
const Tensor< order, dim, Number > & operator[] (const unsigned int i) const
 
DerivativeFormoperator= (const Tensor< order+1, dim, Number > &)
 
DerivativeFormoperator= (const Tensor< order, spacedim, Tensor< 1, dim, Number > > &)
 
DerivativeFormoperator= (const Tensor< 1, dim, Number > &)
 
template<typename OtherNumber >
DerivativeFormoperator= (const DerivativeForm< order, dim, spacedim, OtherNumber > &df)
 
 operator Tensor< order+1, dim, Number > () const
 
 operator Tensor< 1, dim, Number > () const
 
DerivativeForm< 1, spacedim, dim, Number > transpose () const
 
numbers::NumberTraits< Number >::real_type norm () const
 
Number determinant () const
 
DerivativeForm< 1, dim, spacedim, Number > covariant_form () const
 

Static Public Member Functions

static std::size_t memory_consumption ()
 
static ::ExceptionBaseExcInvalidTensorIndex (int arg1)
 

Private Member Functions

DerivativeForm< 1, dim, spacedim, Number > times_T_t (const Tensor< 2, dim, Number > &T) const
 

Private Attributes

Tensor< order, dim, Number > tensor [spacedim]
 

Related Symbols

(Note that these are not member symbols.)

template<int order, int dim, int spacedim, typename Number >
std::ostream & operator<< (std::ostream &out, const DerivativeForm< order, dim, spacedim, Number > &df)
 
template<int spacedim, int dim, typename Number1 , typename Number2 >
Tensor< 1, spacedim, typename ProductType< Number1, Number2 >::type > apply_transformation (const DerivativeForm< 1, dim, spacedim, Number1 > &grad_F, const Tensor< 1, dim, Number2 > &d_x)
 
template<int spacedim, int dim, typename Number1 , typename Number2 >
DerivativeForm< 1, spacedim, dim, typename ProductType< Number1, Number2 >::type > apply_transformation (const DerivativeForm< 1, dim, spacedim, Number1 > &grad_F, const Tensor< 2, dim, Number2 > &D_X)
 
template<int dim, typename Number1 , typename Number2 >
Tensor< 2, dim, typename ProductType< Number1, Number2 >::type > apply_transformation (const DerivativeForm< 1, dim, dim, Number1 > &grad_F, const Tensor< 2, dim, Number2 > &D_X)
 
template<int spacedim, int dim, int n_components, typename Number1 , typename Number2 >
Tensor< 1, n_components, Tensor< 1, spacedim, typename ProductType< Number1, Number2 >::type > > apply_transformation (const DerivativeForm< 1, dim, spacedim, Number1 > &grad_F, const Tensor< 1, n_components, Tensor< 1, dim, Number2 > > &D_X)
 
template<int spacedim, int dim, typename Number1 , typename Number2 >
Tensor< 2, spacedim, typename ProductType< Number1, Number2 >::type > apply_transformation (const DerivativeForm< 1, dim, spacedim, Number1 > &DF1, const DerivativeForm< 1, dim, spacedim, Number2 > &DF2)
 
template<int dim, int spacedim, typename Number >
DerivativeForm< 1, spacedim, dim, Number > transpose (const DerivativeForm< 1, dim, spacedim, Number > &DF)
 
template<int spacedim, int dim, typename Number1 , typename Number2 >
Tensor< 1, spacedim, typename ProductType< Number1, Number2 >::type > apply_diagonal_transformation (const DerivativeForm< 1, dim, spacedim, Number1 > &grad_F, const Tensor< 1, dim, Number2 > &d_x)
 
template<int dim, typename Number1 , typename Number2 >
Tensor< 2, dim, typename ProductType< Number1, Number2 >::type > apply_diagonal_transformation (const DerivativeForm< 1, dim, dim, Number1 > &grad_F, const Tensor< 2, dim, Number2 > &D_X)
 
template<int spacedim, int dim, int n_components, typename Number1 , typename Number2 >
Tensor< 1, n_components, Tensor< 1, spacedim, typename ProductType< Number1, Number2 >::type > > apply_diagonal_transformation (const DerivativeForm< 1, dim, spacedim, Number1 > &grad_F, const Tensor< 1, n_components, Tensor< 1, dim, Number2 > > &D_X)
 
template<int spacedim, int dim, typename Number1 , typename Number2 >
DerivativeForm< 1, spacedim, dim, typename ProductType< Number1, Number2 >::type > apply_diagonal_transformation (const DerivativeForm< 1, dim, spacedim, Number1 > &grad_F, const Tensor< 2, dim, Number2 > &D_X)
 

Detailed Description

template<int order, int dim, int spacedim, typename Number = double>
class DerivativeForm< order, dim, spacedim, Number >

This class represents the (tangential) derivatives of a function \( \mathbf F: {\mathbb R}^{\text{dim}} \rightarrow {\mathbb R}^{\text{spacedim}}\). Such functions are always used to map the reference dim-dimensional cell into spacedim-dimensional space. For such objects, the first derivative of the function is a linear map from \({\mathbb R}^{\text{dim}}\) to \({\mathbb R}^{\text{spacedim}}\), i.e., it can be represented as a matrix in \({\mathbb R}^{\text{spacedim}\times \text{dim}}\). This makes sense since one would represent the first derivative, \(\nabla \mathbf F(\mathbf x)\) with \(\mathbf x\in {\mathbb R}^{\text{dim}}\), in such a way that the directional derivative in direction \(\mathbf d\in {\mathbb R}^{\text{dim}}\) so that

\begin{align*} \nabla \mathbf F(\mathbf x) \mathbf d = \lim_{\varepsilon\rightarrow 0} \frac{\mathbf F(\mathbf x + \varepsilon \mathbf d) - \mathbf F(\mathbf x)}{\varepsilon}, \end{align*}

i.e., one needs to be able to multiply the matrix \(\nabla \mathbf F(\mathbf x)\) by a vector in \({\mathbb R}^{\text{dim}}\), and the result is a difference of function values, which are in \({\mathbb R}^{\text{spacedim}}\). Consequently, the matrix must be of size \(\text{spacedim}\times\text{dim}\).

Similarly, the second derivative is a bilinear map from \({\mathbb R}^{\text{dim}} \times {\mathbb R}^{\text{dim}}\) to \({\mathbb R}^{\text{spacedim}}\), which one can think of a rank-3 object of size \(\text{spacedim}\times\text{dim}\times\text{dim}\).

In deal.II we represent these derivatives using objects of type DerivativeForm<1,dim,spacedim,Number>, DerivativeForm<2,dim,spacedim,Number> and so on.

Definition at line 57 of file derivative_form.h.

Constructor & Destructor Documentation

◆ DerivativeForm() [1/3]

template<int order, int dim, int spacedim, typename Number = double>
DerivativeForm< order, dim, spacedim, Number >::DerivativeForm ( )
default

Constructor. Initialize all entries to zero.

◆ DerivativeForm() [2/3]

template<int order, int dim, int spacedim, typename Number = double>
DerivativeForm< order, dim, spacedim, Number >::DerivativeForm ( const Tensor< order+1, dim, Number > &  )

Constructor from a tensor.

◆ DerivativeForm() [3/3]

template<int order, int dim, int spacedim, typename Number = double>
DerivativeForm< order, dim, spacedim, Number >::DerivativeForm ( const Tensor< 1, spacedim, Tensor< order, dim, Number > > &  )

Constructor. This constructor initializes the data stored by this object from a spacedim x dim^order array that is represented by a Tensor with spacedim components each of which is a Tensor of rank order and size dim.

Member Function Documentation

◆ operator[]() [1/2]

template<int order, int dim, int spacedim, typename Number = double>
Tensor< order, dim, Number > & DerivativeForm< order, dim, spacedim, Number >::operator[] ( const unsigned int  i)

Read-Write access operator.

◆ operator[]() [2/2]

template<int order, int dim, int spacedim, typename Number = double>
const Tensor< order, dim, Number > & DerivativeForm< order, dim, spacedim, Number >::operator[] ( const unsigned int  i) const

Read-only access operator.

◆ operator=() [1/4]

template<int order, int dim, int spacedim, typename Number = double>
DerivativeForm & DerivativeForm< order, dim, spacedim, Number >::operator= ( const Tensor< order+1, dim, Number > &  )

Assignment operator.

◆ operator=() [2/4]

template<int order, int dim, int spacedim, typename Number = double>
DerivativeForm & DerivativeForm< order, dim, spacedim, Number >::operator= ( const Tensor< order, spacedim, Tensor< 1, dim, Number > > &  )

Assignment operator.

◆ operator=() [3/4]

template<int order, int dim, int spacedim, typename Number = double>
DerivativeForm & DerivativeForm< order, dim, spacedim, Number >::operator= ( const Tensor< 1, dim, Number > &  )

Assignment operator.

◆ operator=() [4/4]

template<int order, int dim, int spacedim, typename Number = double>
template<typename OtherNumber >
DerivativeForm & DerivativeForm< order, dim, spacedim, Number >::operator= ( const DerivativeForm< order, dim, spacedim, OtherNumber > &  df)

Number conversion operator.

◆ operator Tensor< order+1, dim, Number >()

template<int order, int dim, int spacedim, typename Number = double>
DerivativeForm< order, dim, spacedim, Number >::operator Tensor< order+1, dim, Number > ( ) const

Converts a DerivativeForm <order, dim, dim, Number> to Tensor<order+1, dim, Number>. In particular, if order == 1 and the derivative is the Jacobian of \(\mathbf F(\mathbf x)\), then Tensor[i] = \(\nabla F_i(\mathbf x)\).

◆ operator Tensor< 1, dim, Number >()

template<int order, int dim, int spacedim, typename Number = double>
DerivativeForm< order, dim, spacedim, Number >::operator Tensor< 1, dim, Number > ( ) const

Converts a DerivativeForm<1, dim, 1, Number> to Tensor<1, dim, Number>.

◆ transpose()

template<int order, int dim, int spacedim, typename Number = double>
DerivativeForm< 1, spacedim, dim, Number > DerivativeForm< order, dim, spacedim, Number >::transpose ( ) const

Return the transpose of a rectangular DerivativeForm, viewed as a two dimensional matrix.

◆ norm()

template<int order, int dim, int spacedim, typename Number = double>
numbers::NumberTraits< Number >::real_type DerivativeForm< order, dim, spacedim, Number >::norm ( ) const

Compute the Frobenius norm of this form, i.e., the expression \(\sqrt{\sum_{ij} |DF_{ij}|^2} = \sqrt{\sum_{ij} |\frac{\partial F_i}{\partial x_j}|^2}\).

◆ determinant()

template<int order, int dim, int spacedim, typename Number = double>
Number DerivativeForm< order, dim, spacedim, Number >::determinant ( ) const

Compute the volume element associated with the Jacobian of the transformation \(\mathbf F\). That is to say if \(DF\) is square, it computes \(\det(DF)\), in case DF is not square returns \(\sqrt{\det(DF^T \,DF)}\).

◆ covariant_form()

template<int order, int dim, int spacedim, typename Number = double>
DerivativeForm< 1, dim, spacedim, Number > DerivativeForm< order, dim, spacedim, Number >::covariant_form ( ) const

Assuming that the current object stores the Jacobian of a mapping \(\mathbf F\), then the current function computes the covariant form of the derivative, namely \((\nabla \mathbf F) {\mathbf G}^{-1}\), where \(\mathbf G = (\nabla \mathbf F)^{T}(\nabla \mathbf F)\). If \(\nabla \mathbf F\) is a square matrix (i.e., \(\mathbf F: {\mathbb R}^n \mapsto {\mathbb R}^n\)), then this function simplifies to computing \(\nabla {\mathbf F}^{-T}\).

◆ memory_consumption()

template<int order, int dim, int spacedim, typename Number = double>
static std::size_t DerivativeForm< order, dim, spacedim, Number >::memory_consumption ( )
static

Determine an estimate for the memory consumption (in bytes) of this object.

◆ times_T_t()

template<int order, int dim, int spacedim, typename Number = double>
DerivativeForm< 1, dim, spacedim, Number > DerivativeForm< order, dim, spacedim, Number >::times_T_t ( const Tensor< 2, dim, Number > &  T) const
private

Auxiliary function that computes \(A T^{T}\) where A represents the current object.

Friends And Related Symbol Documentation

◆ operator<<()

template<int order, int dim, int spacedim, typename Number >
std::ostream & operator<< ( std::ostream &  out,
const DerivativeForm< order, dim, spacedim, Number > &  df 
)
related

Output operator for DerivativeForm. Print the elements consecutively, with a space in between, two spaces between rank 1 subtensors, three between rank 2 and so on.

Definition at line 438 of file derivative_form.h.

◆ apply_transformation() [1/5]

template<int spacedim, int dim, typename Number1 , typename Number2 >
Tensor< 1, spacedim, typename ProductType< Number1, Number2 >::type > apply_transformation ( const DerivativeForm< 1, dim, spacedim, Number1 > &  grad_F,
const Tensor< 1, dim, Number2 > &  d_x 
)
related

One of the uses of DerivativeForm is to apply it as a linear transformation. This function returns \(\nabla \mathbf F(\mathbf x) \Delta \mathbf x\), which approximates the change in \(\mathbf F(\mathbf x)\) when \(\mathbf x\) is changed by the amount \(\Delta \mathbf x\)

\[ \nabla \mathbf F(\mathbf x) \; \Delta \mathbf x \approx \mathbf F(\mathbf x + \Delta \mathbf x) - \mathbf F(\mathbf x). \]

The transformation corresponds to

\[ [\text{result}]_{i_1,\dots,i_k} = i\sum_{j} \left[\nabla \mathbf F(\mathbf x)\right]_{i_1,\dots,i_k, j} \Delta x_j \]

in index notation and corresponds to \([\Delta \mathbf x] [\nabla \mathbf F(\mathbf x)]^T\) in matrix notation.

Definition at line 478 of file derivative_form.h.

◆ apply_transformation() [2/5]

template<int spacedim, int dim, typename Number1 , typename Number2 >
DerivativeForm< 1, spacedim, dim, typename ProductType< Number1, Number2 >::type > apply_transformation ( const DerivativeForm< 1, dim, spacedim, Number1 > &  grad_F,
const Tensor< 2, dim, Number2 > &  D_X 
)
related

Similar to the previous apply_transformation(). Each row of the result corresponds to one of the rows of D_X transformed by grad_F, equivalent to \(\mathrm{D\_X} \, \mathrm{grad\_F}^T\) in matrix notation.

Definition at line 503 of file derivative_form.h.

◆ apply_transformation() [3/5]

template<int dim, typename Number1 , typename Number2 >
Tensor< 2, dim, typename ProductType< Number1, Number2 >::type > apply_transformation ( const DerivativeForm< 1, dim, dim, Number1 > &  grad_F,
const Tensor< 2, dim, Number2 > &  D_X 
)
related

Similar to the previous apply_transformation(), specialized for the case dim == spacedim where we can return a rank-2 tensor instead of the more general DerivativeForm. Each row of the result corresponds to one of the rows of D_X transformed by grad_F, equivalent to \(\mathrm{D\_X} \, \mathrm{grad\_F}^T\) in matrix notation.

Definition at line 529 of file derivative_form.h.

◆ apply_transformation() [4/5]

template<int spacedim, int dim, int n_components, typename Number1 , typename Number2 >
Tensor< 1, n_components, Tensor< 1, spacedim, typename ProductType< Number1, Number2 >::type > > apply_transformation ( const DerivativeForm< 1, dim, spacedim, Number1 > &  grad_F,
const Tensor< 1, n_components, Tensor< 1, dim, Number2 > > &  D_X 
)
related

Similar to the previous apply_transformation(). Each row of the result corresponds to one of the rows of D_X transformed by grad_F.

Definition at line 556 of file derivative_form.h.

◆ apply_transformation() [5/5]

template<int spacedim, int dim, typename Number1 , typename Number2 >
Tensor< 2, spacedim, typename ProductType< Number1, Number2 >::type > apply_transformation ( const DerivativeForm< 1, dim, spacedim, Number1 > &  DF1,
const DerivativeForm< 1, dim, spacedim, Number2 > &  DF2 
)
related

Similar to the previous apply_transformation(). In matrix notation, it computes \(DF2 \, DF1^{T}\). Moreover, the result of this operation \(\mathbf A\) can be interpreted as a metric tensor in \({\mathbb R}^\text{spacedim}\) which corresponds to the Euclidean metric tensor in \({\mathbb R}^\text{dim}\). For every pair of vectors \(\mathbf u, \mathbf v \in {\mathbb R}^\text{spacedim}\), we have:

\[ \mathbf u \cdot \mathbf A \mathbf v = \text{DF2}^{-1}(\mathbf u) \cdot \text{DF1}^{-1}(\mathbf v) \]

Definition at line 589 of file derivative_form.h.

◆ transpose()

template<int dim, int spacedim, typename Number >
DerivativeForm< 1, spacedim, dim, Number > transpose ( const DerivativeForm< 1, dim, spacedim, Number > &  DF)
related

Transpose of a rectangular DerivativeForm DF, mostly for compatibility reasons.

Definition at line 610 of file derivative_form.h.

◆ apply_diagonal_transformation() [1/4]

template<int spacedim, int dim, typename Number1 , typename Number2 >
Tensor< 1, spacedim, typename ProductType< Number1, Number2 >::type > apply_diagonal_transformation ( const DerivativeForm< 1, dim, spacedim, Number1 > &  grad_F,
const Tensor< 1, dim, Number2 > &  d_x 
)
related

Specialization of apply_transformation() for a diagonal DerivativeForm.

Definition at line 624 of file derivative_form.h.

◆ apply_diagonal_transformation() [2/4]

template<int dim, typename Number1 , typename Number2 >
Tensor< 2, dim, typename ProductType< Number1, Number2 >::type > apply_diagonal_transformation ( const DerivativeForm< 1, dim, dim, Number1 > &  grad_F,
const Tensor< 2, dim, Number2 > &  D_X 
)
related

Similar to the previous apply_diagonal_transformation(), specialized for the case dim == spacedim where we can return a rank-2 tensor instead of the more general DerivativeForm. Each row of the result corresponds to one of the rows of D_X transformed by grad_F, equivalent to \(\mathrm{D\_X} \, \mathrm{grad\_F}^T\) in matrix notation.

Definition at line 649 of file derivative_form.h.

◆ apply_diagonal_transformation() [3/4]

template<int spacedim, int dim, int n_components, typename Number1 , typename Number2 >
Tensor< 1, n_components, Tensor< 1, spacedim, typename ProductType< Number1, Number2 >::type > > apply_diagonal_transformation ( const DerivativeForm< 1, dim, spacedim, Number1 > &  grad_F,
const Tensor< 1, n_components, Tensor< 1, dim, Number2 > > &  D_X 
)
related

Similar to the previous apply_diagonal_transformation(). Each row of the result corresponds to one of the rows of D_X transformed by grad_F.

Definition at line 677 of file derivative_form.h.

◆ apply_diagonal_transformation() [4/4]

template<int spacedim, int dim, typename Number1 , typename Number2 >
DerivativeForm< 1, spacedim, dim, typename ProductType< Number1, Number2 >::type > apply_diagonal_transformation ( const DerivativeForm< 1, dim, spacedim, Number1 > &  grad_F,
const Tensor< 2, dim, Number2 > &  D_X 
)
related

Similar to the previous apply_transformation(). Each row of the result corresponds to one of the rows of D_X transformed by grad_F, equivalent to \(\mathrm{D\_X} \, \mathrm{grad\_F}^T\) in matrix notation.

Definition at line 707 of file derivative_form.h.

Member Data Documentation

◆ tensor

template<int order, int dim, int spacedim, typename Number = double>
Tensor<order, dim, Number> DerivativeForm< order, dim, spacedim, Number >::tensor[spacedim]
private

Array of tensors holding the subelements.

Definition at line 188 of file derivative_form.h.


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