v0.14.0
Public Member Functions | Private Attributes | List of all members
FTensor::Tensor1< T, Tensor_Dim > Class Template Reference

#include <src/ftensor/src/FTensor/Tensor1/Tensor1_value.hpp>

Inheritance diagram for FTensor::Tensor1< T, Tensor_Dim >:
[legend]
Collaboration diagram for FTensor::Tensor1< T, Tensor_Dim >:
[legend]

Public Member Functions

template<class... U>
constexpr Tensor1 (U... d)
 
constexpr Tensor1 ()
 
T & operator() (const int N)
 
operator() (const int N) const
 
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor1_Expr< Tensor1< T, Tensor_Dim >, T, Dim, i > >::type operator() (const Index< i, Dim > &)
 
template<char i, int Dim>
std::enable_if<(Tensor_Dim >=Dim), Tensor1_Expr< const Tensor1< T, Tensor_Dim >, T, Dim, i > >::type operator() (const Index< i, Dim > &) const
 
Tensor1< T, Tensor_Dim > normalize ()
 
l2 () const
 
template<int Current_Dim>
l2_squared (const Number< Current_Dim > &) const
 
l2_squared (const Number< 1 > &) const
 

Private Attributes

data [Tensor_Dim]
 

Detailed Description

template<class T, int Tensor_Dim>
class FTensor::Tensor1< T, Tensor_Dim >

Examples
ADOLCPlasticity.hpp, ContactOps.hpp, continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, dynamic_first_order_con_law.cpp, elasticity.cpp, ElasticityMixedFormulation.hpp, EshelbianOperators.cpp, field_blas.cpp, hanging_node_approx.cpp, hcurl_check_approx_in_2d.cpp, hdiv_check_approx_in_3d.cpp, HenckyOps.hpp, higher_derivatives.cpp, HookeElement.cpp, HookeElement.hpp, HookeInternalStressElement.hpp, level_set.cpp, lorentz_force.cpp, MagneticElement.hpp, matrix_function.cpp, mixed_poisson.cpp, mortar_contact_thermal.cpp, NavierStokesElement.cpp, PlasticOpsGeneric.hpp, PlasticOpsSmallStrains.hpp, plot_base.cpp, poisson_2d_dis_galerkin.cpp, PoissonDiscontinousGalerkin.hpp, Remodeling.cpp, scalar_check_approximation.cpp, shallow_wave.cpp, simple_contact_thermal.cpp, and simple_elasticity.cpp.

Definition at line 8 of file Tensor1_value.hpp.

Constructor & Destructor Documentation

◆ Tensor1() [1/2]

template<class T , int Tensor_Dim>
template<class... U>
constexpr FTensor::Tensor1< T, Tensor_Dim >::Tensor1 ( U...  d)
inlineconstexpr

Definition at line 14 of file Tensor1_value.hpp.

14  : data{d...}
15  {
16  static_assert(sizeof...(d) == sizeof(data) / sizeof(T),
17  "Incorrect number of Arguments. Constructor should "
18  "initialize the entire Tensor");
19  };

◆ Tensor1() [2/2]

template<class T , int Tensor_Dim>
constexpr FTensor::Tensor1< T, Tensor_Dim >::Tensor1 ( )
inlineconstexpr

Definition at line 21 of file Tensor1_value.hpp.

21 {}

Member Function Documentation

◆ l2()

template<class T , int Tensor_Dim>
T FTensor::Tensor1< T, Tensor_Dim >::l2 ( ) const
inline

Definition at line 84 of file Tensor1_value.hpp.

84 { return sqrt(l2_squared(Number<Tensor_Dim>())); }

◆ l2_squared() [1/2]

template<class T , int Tensor_Dim>
T FTensor::Tensor1< T, Tensor_Dim >::l2_squared ( const Number< 1 > &  ) const
inline

Definition at line 91 of file Tensor1_value.hpp.

91 { return data[0] * data[0]; }

◆ l2_squared() [2/2]

template<class T , int Tensor_Dim>
template<int Current_Dim>
T FTensor::Tensor1< T, Tensor_Dim >::l2_squared ( const Number< Current_Dim > &  ) const
inline

Definition at line 86 of file Tensor1_value.hpp.

87  {
88  return data[Current_Dim - 1] * data[Current_Dim - 1]
89  + l2_squared(Number<Current_Dim - 1>());
90  }

◆ normalize()

template<class T , int Tensor_Dim>
Tensor1<T, Tensor_Dim> FTensor::Tensor1< T, Tensor_Dim >::normalize ( )
inline

Definition at line 77 of file Tensor1_value.hpp.

78  {
80  (*this)(a) /= l2();
81  return *this;
82  }

◆ operator()() [1/4]

template<class T , int Tensor_Dim>
template<char i, int Dim>
std::enable_if< (Tensor_Dim >= Dim), Tensor1_Expr<Tensor1<T, Tensor_Dim>, T, Dim, i> >::type FTensor::Tensor1< T, Tensor_Dim >::operator() ( const Index< i, Dim > &  )
inline

Definition at line 61 of file Tensor1_value.hpp.

62  {
63  return Tensor1_Expr<Tensor1<T, Tensor_Dim>, T, Dim, i>(*this);
64  }

◆ operator()() [2/4]

template<class T , int Tensor_Dim>
template<char i, int Dim>
std::enable_if< (Tensor_Dim >= Dim), Tensor1_Expr<const Tensor1<T, Tensor_Dim>, T, Dim, i> >::type FTensor::Tensor1< T, Tensor_Dim >::operator() ( const Index< i, Dim > &  ) const
inline

Definition at line 70 of file Tensor1_value.hpp.

71  {
72  return Tensor1_Expr<const Tensor1<T, Tensor_Dim>, T, Dim, i>(*this);
73  }

◆ operator()() [3/4]

template<class T , int Tensor_Dim>
T& FTensor::Tensor1< T, Tensor_Dim >::operator() ( const int  N)
inline

Definition at line 26 of file Tensor1_value.hpp.

27  {
28 #ifdef FTENSOR_DEBUG
29  if(N >= Tensor_Dim || N < 0)
30  {
31  std::stringstream s;
32  s << "Bad index in Tensor1<T," << Tensor_Dim << ">.operator(" << N
33  << ")" << std::endl;
34  throw std::out_of_range(s.str());
35  }
36 #endif
37  return data[N];
38  }

◆ operator()() [4/4]

template<class T , int Tensor_Dim>
T FTensor::Tensor1< T, Tensor_Dim >::operator() ( const int  N) const
inline

Definition at line 39 of file Tensor1_value.hpp.

40  {
41 #ifdef FTENSOR_DEBUG
42  if(N >= Tensor_Dim || N < 0)
43  {
44  std::stringstream s;
45  s << "Bad index in Tensor1<T," << Tensor_Dim << ">.operator(" << N
46  << ") const" << std::endl;
47  throw std::out_of_range(s.str());
48  }
49 #endif
50  return data[N];
51  }

Member Data Documentation

◆ data

template<class T , int Tensor_Dim>
T FTensor::Tensor1< T, Tensor_Dim >::data[Tensor_Dim]
private

Definition at line 10 of file Tensor1_value.hpp.


The documentation for this class was generated from the following file:
FTensor::Tensor1::l2
T l2() const
Definition: Tensor1_value.hpp:84
FTensor::d
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: dTensor0.hpp:27
Index
Definition: single.cpp:3
FTensor::Tensor1::data
T data[Tensor_Dim]
Definition: Tensor1_value.hpp:10
a
constexpr double a
Definition: approx_sphere.cpp:30
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
N
const int N
Definition: speed_test.cpp:3
Tensor1_Expr
Definition: single.cpp:11
FTensor::Tensor1::l2_squared
T l2_squared(const Number< Current_Dim > &) const
Definition: Tensor1_value.hpp:86