Flow123d  DF_patch_fe_mechanics-c13f069
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ArenaVec< T > Class Template Reference

#include <arena_vec.hh>

Inheritance diagram for ArenaVec< T >:
Inheritance graph
[legend]
Collaboration diagram for ArenaVec< T >:
Collaboration graph
[legend]

Public Types

typedef Eigen::Matrix< T, Eigen::Dynamic, 1 > VecData
 Type definition. More...
 
typedef Eigen::Array< T, Eigen::Dynamic, 1 > ArrayData
 

Public Member Functions

 ArenaVec ()
 Default constructor, set invalid data pointer. More...
 
 ArenaVec (T scalar_val)
 
 ArenaVec (size_t data_size, PatchArena &arena)
 
 ArenaVec (const ArenaVec< T > &other)
 Copy constructor. More...
 
Eigen::Map< VecDataeigen_map ()
 
const Eigen::Map< VecDataeigen_map () const
 Smae as previous but with const modifier. More...
 
Eigen::Map< ArrayDataarray_map ()
 
const Eigen::Map< ArrayDataarray_map () const
 Smae as previous but with const modifier. More...
 
T * data_ptr ()
 Return data pointer (development method) More...
 
const T * data_ptr () const
 Smae as previous but return const pointer. More...
 
size_t data_size () const
 Getter for data_size_. More...
 
PatchArenaarena ()
 Getter for arena_. More...
 
scalar_val () const
 Getter for scalar_val_. More...
 
void set_patch_arena (PatchArena &arena)
 Set pointer to PatchArena. More...
 
ArenaVec< T > sqrt () const
 Returns copied vector of square root values. More...
 
ArenaVec< T > inverse () const
 Returns copied vector of inverse values. More...
 
ArenaVec< T > abs () const
 Returns copied vector of absolute values. More...
 
T & operator() (std::size_t item)
 For development only. TODO remove. More...
 
const T & operator() (std::size_t item) const
 For development only. TODO remove. More...
 
ArenaVec< T > & operator= (const ArenaVec< T > &other)
 Assignment operator. More...
 
ArenaVec< T > operator+ (const ArenaVec< T > &other) const
 
ArenaVec< T > operator- (const ArenaVec< T > &other) const
 
ArenaVec< T > operator* (T multi) const
 
ArenaVec< T > operator* (const ArenaVec< T > &other) const
 
ArenaVec< T > operator/ (T div_by) const
 
ArenaVec< T > operator/ (const ArenaVec< T > &other) const
 

Protected Member Functions

 ArenaVec (T *data_ptr, size_t data_size, PatchArena &arena)
 Constructor. Allows create ArenaVec from ArenaOVec. More...
 

Protected Attributes

T * data_ptr_
 Pointer to data array. More...
 
size_t data_size_
 Length of data array. More...
 
PatchArenaarena_
 Pointer to Arena where intermediate calculations and results are stored, should be changed by set_patch_arena. More...
 
scalar_val_
 Scalar value of T type. More...
 

Friends

class ArenaOVec< T >
 

Detailed Description

template<class T>
class ArenaVec< T >

Define vector allocated in ArenaResource and aligned to SIMD size.

Definition at line 35 of file arena_vec.hh.

Member Typedef Documentation

◆ ArrayData

template<class T >
typedef Eigen::Array<T, Eigen::Dynamic, 1> ArenaVec< T >::ArrayData

Definition at line 39 of file arena_vec.hh.

◆ VecData

template<class T >
typedef Eigen::Matrix<T, Eigen::Dynamic, 1> ArenaVec< T >::VecData

Type definition.

Definition at line 38 of file arena_vec.hh.

Constructor & Destructor Documentation

◆ ArenaVec() [1/5]

template<class T >
ArenaVec< T >::ArenaVec ( )
inline

Default constructor, set invalid data pointer.

Definition at line 42 of file arena_vec.hh.

◆ ArenaVec() [2/5]

template<class T >
ArenaVec< T >::ArenaVec ( scalar_val)
inline

Constructor. Set scalar value

Definition at line 48 of file arena_vec.hh.

◆ ArenaVec() [3/5]

template<class T >
ArenaVec< T >::ArenaVec ( size_t  data_size,
PatchArena arena 
)
inline

Constructor. Set sizes and allocate data pointer

Definition at line 54 of file arena_vec.hh.

◆ ArenaVec() [4/5]

template<class T >
ArenaVec< T >::ArenaVec ( const ArenaVec< T > &  other)
inline

Copy constructor.

Definition at line 60 of file arena_vec.hh.

◆ ArenaVec() [5/5]

template<class T >
ArenaVec< T >::ArenaVec ( T *  data_ptr,
size_t  data_size,
PatchArena arena 
)
inlineprotected

Constructor. Allows create ArenaVec from ArenaOVec.

Definition at line 266 of file arena_vec.hh.

Member Function Documentation

◆ abs()

template<class T >
ArenaVec<T> ArenaVec< T >::abs ( ) const
inline

Returns copied vector of absolute values.

Definition at line 143 of file arena_vec.hh.

◆ arena()

template<class T >
PatchArena& ArenaVec< T >::arena ( )
inline

Getter for arena_.

Definition at line 109 of file arena_vec.hh.

Here is the caller graph for this function:

◆ array_map() [1/2]

template<class T >
Eigen::Map<ArrayData> ArenaVec< T >::array_map ( )
inline

Maps data pointer to Eigen Map of dimensions given data_size_ and returns it.

Definition at line 82 of file arena_vec.hh.

Here is the caller graph for this function:

◆ array_map() [2/2]

template<class T >
const Eigen::Map<ArrayData> ArenaVec< T >::array_map ( ) const
inline

Smae as previous but with const modifier.

Definition at line 88 of file arena_vec.hh.

◆ data_ptr() [1/2]

template<class T >
T* ArenaVec< T >::data_ptr ( )
inline

Return data pointer (development method)

Definition at line 94 of file arena_vec.hh.

Here is the caller graph for this function:

◆ data_ptr() [2/2]

template<class T >
const T* ArenaVec< T >::data_ptr ( ) const
inline

Smae as previous but return const pointer.

Definition at line 99 of file arena_vec.hh.

◆ data_size()

template<class T >
size_t ArenaVec< T >::data_size ( ) const
inline

Getter for data_size_.

Definition at line 104 of file arena_vec.hh.

Here is the caller graph for this function:

◆ eigen_map() [1/2]

template<class T >
Eigen::Map<VecData> ArenaVec< T >::eigen_map ( )
inline

Maps data pointer to Eigen Map of dimensions given data_size_ and returns it.

Definition at line 68 of file arena_vec.hh.

Here is the caller graph for this function:

◆ eigen_map() [2/2]

template<class T >
const Eigen::Map<VecData> ArenaVec< T >::eigen_map ( ) const
inline

Smae as previous but with const modifier.

Definition at line 74 of file arena_vec.hh.

◆ inverse()

template<class T >
ArenaVec<T> ArenaVec< T >::inverse ( ) const
inline

Returns copied vector of inverse values.

Definition at line 134 of file arena_vec.hh.

◆ operator()() [1/2]

template<class T >
T& ArenaVec< T >::operator() ( std::size_t  item)
inline

For development only. TODO remove.

Definition at line 152 of file arena_vec.hh.

◆ operator()() [2/2]

template<class T >
const T& ArenaVec< T >::operator() ( std::size_t  item) const
inline

For development only. TODO remove.

Definition at line 159 of file arena_vec.hh.

◆ operator*() [1/2]

template<class T >
ArenaVec<T> ArenaVec< T >::operator* ( const ArenaVec< T > &  other) const
inline

Multiplication operator

Product of two ArenaVec objects, checks if one ofe them is define as scalar

Definition at line 223 of file arena_vec.hh.

◆ operator*() [2/2]

template<class T >
ArenaVec<T> ArenaVec< T >::operator* ( multi) const
inline

Multiplication operator

Product Scalar x ArenaVec

Definition at line 210 of file arena_vec.hh.

Here is the caller graph for this function:

◆ operator+()

template<class T >
ArenaVec<T> ArenaVec< T >::operator+ ( const ArenaVec< T > &  other) const
inline

Addition operator

Sums two ArenaVec objects TODO If ASSERT_PTR is thrown needs to implement tests of scalar values (see multiplication operator).

Definition at line 179 of file arena_vec.hh.

◆ operator-()

template<class T >
ArenaVec<T> ArenaVec< T >::operator- ( const ArenaVec< T > &  other) const
inline

Subtraction operator

Subtracts two ArenaVec objects TODO If ASSERT_PTR is thrown needs to implement tests of scalar values (see multiplication operator).

Definition at line 195 of file arena_vec.hh.

◆ operator/() [1/2]

template<class T >
ArenaVec<T> ArenaVec< T >::operator/ ( const ArenaVec< T > &  other) const
inline

Division operator

Divides two ArenaVec objects TODO If ASSERT_PTR is thrown needs to implement tests of scalar values (see multiplication operator).

Definition at line 254 of file arena_vec.hh.

◆ operator/() [2/2]

template<class T >
ArenaVec<T> ArenaVec< T >::operator/ ( div_by) const
inline

Division operator

Divides ArenaVec / Scalar

Definition at line 240 of file arena_vec.hh.

◆ operator=()

template<class T >
ArenaVec<T>& ArenaVec< T >::operator= ( const ArenaVec< T > &  other)
inline

Assignment operator.

Definition at line 165 of file arena_vec.hh.

Here is the caller graph for this function:

◆ scalar_val()

template<class T >
T ArenaVec< T >::scalar_val ( ) const
inline

Getter for scalar_val_.

Definition at line 114 of file arena_vec.hh.

Here is the caller graph for this function:

◆ set_patch_arena()

template<class T >
void ArenaVec< T >::set_patch_arena ( PatchArena arena)
inline

Set pointer to PatchArena.

Definition at line 119 of file arena_vec.hh.

◆ sqrt()

template<class T >
ArenaVec<T> ArenaVec< T >::sqrt ( ) const
inline

Returns copied vector of square root values.

Definition at line 125 of file arena_vec.hh.

Friends And Related Function Documentation

◆ ArenaOVec< T >

template<class T >
friend class ArenaOVec< T >
friend

Definition at line 272 of file arena_vec.hh.

Member Data Documentation

◆ arena_

template<class T >
PatchArena* ArenaVec< T >::arena_
protected

Pointer to Arena where intermediate calculations and results are stored, should be changed by set_patch_arena.

Definition at line 271 of file arena_vec.hh.

◆ data_ptr_

template<class T >
T* ArenaVec< T >::data_ptr_
protected

Pointer to data array.

Definition at line 269 of file arena_vec.hh.

◆ data_size_

template<class T >
size_t ArenaVec< T >::data_size_
protected

Length of data array.

Definition at line 270 of file arena_vec.hh.

◆ scalar_val_

template<class T >
T ArenaVec< T >::scalar_val_
protected

Scalar value of T type.

Definition at line 272 of file arena_vec.hh.


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