v0.7.2
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>

Public Member Functions

 Tensor1 (T d0)
 
 Tensor1 (T d0, T d1)
 
 Tensor1 (T d0, T d1, T d2)
 
 Tensor1 (T d0, T d1, T d2, T d3)
 
 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:
analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, analytical_poisson_field_split.cpp, MagneticElement.hpp, PoissonOperators.hpp, simple_elasticity.cpp, and simple_interface.cpp.

Definition at line 9 of file Tensor1_value.hpp.

Constructor & Destructor Documentation

◆ Tensor1() [1/5]

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

Definition at line 17 of file Tensor1_value.hpp.

18  {
19  Tensor1_constructor<T,Tensor_Dim>(data,d0);
20  }
T data[Tensor_Dim]

◆ Tensor1() [2/5]

template<class T, int Tensor_Dim>
FTensor::Tensor1< T, Tensor_Dim >::Tensor1 ( d0,
d1 
)

Definition at line 21 of file Tensor1_value.hpp.

22  {
23  Tensor1_constructor<T,Tensor_Dim>(data,d0,d1);
24  }
T data[Tensor_Dim]

◆ Tensor1() [3/5]

template<class T, int Tensor_Dim>
FTensor::Tensor1< T, Tensor_Dim >::Tensor1 ( d0,
d1,
d2 
)

Definition at line 25 of file Tensor1_value.hpp.

26  {
27  Tensor1_constructor<T,Tensor_Dim>(data,d0,d1,d2);
28  }
T data[Tensor_Dim]

◆ Tensor1() [4/5]

template<class T, int Tensor_Dim>
FTensor::Tensor1< T, Tensor_Dim >::Tensor1 ( d0,
d1,
d2,
d3 
)

Definition at line 29 of file Tensor1_value.hpp.

30  {
31  Tensor1_constructor<T,Tensor_Dim>(data,d0,d1,d2,d3);
32  }
T data[Tensor_Dim]

◆ Tensor1() [5/5]

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

Definition at line 34 of file Tensor1_value.hpp.

34 {}

Member Function Documentation

◆ l2()

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

Definition at line 96 of file Tensor1_value.hpp.

97  {
98  return sqrt(l2_squared(Number<Tensor_Dim>()));
99  }
T l2_squared(const Number< Current_Dim > &) const

◆ l2_squared() [1/2]

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

Definition at line 102 of file Tensor1_value.hpp.

103  {
104  return data[Current_Dim-1]*data[Current_Dim-1]
105  + l2_squared(Number<Current_Dim-1>());
106  }
T data[Tensor_Dim]
T l2_squared(const Number< Current_Dim > &) const

◆ l2_squared() [2/2]

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

Definition at line 107 of file Tensor1_value.hpp.

108  {
109  return data[0]*data[0];
110  }
T data[Tensor_Dim]

◆ normalize()

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

Definition at line 89 of file Tensor1_value.hpp.

90  {
91  const Index<'a',Tensor_Dim> a;
92  (*this)(a) /= l2();
93  return *this;
94  }
Definition: single.cpp:4

◆ operator()() [1/4]

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

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
46  << ">.operator(" << N << ")" << std::endl;
47  throw std::runtime_error(s.str());
48  }
49 #endif
50  return data[N];
51  }
T data[Tensor_Dim]
const int N
Definition: speed_test.cpp:3

◆ operator()() [2/4]

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

Definition at line 52 of file Tensor1_value.hpp.

53  {
54 #ifdef FTENSOR_DEBUG
55  if(N>=Tensor_Dim || N<0)
56  {
57  std::stringstream s;
58  s << "Bad index in Tensor1<T," << Tensor_Dim
59  << ">.operator(" << N << ") const" << std::endl;
60  throw std::runtime_error(s.str());
61  }
62 #endif
63  return data[N];
64  }
T data[Tensor_Dim]
const int N
Definition: speed_test.cpp:3

◆ operator()() [3/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 > &  )

Definition at line 74 of file Tensor1_value.hpp.

75  {
76  return Tensor1_Expr<Tensor1<T,Tensor_Dim>,T,Dim,i>(*this);
77  }

◆ operator()() [4/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

Definition at line 82 of file Tensor1_value.hpp.

83  {
84  return Tensor1_Expr<const Tensor1<T,Tensor_Dim>,T,Dim,i>(*this);
85  }

Member Data Documentation

◆ data

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

Definition at line 11 of file Tensor1_value.hpp.


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