Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
memorized_disarray.h
Go to the documentation of this file.
1#ifndef _RHEOLEF_MEMORIZED_DISARRAY_H
2#define _RHEOLEF_MEMORIZED_DISARRAY_H
23//
24// utility:
25// internal data area accessor: return
26// _scalar_val
27// _vector_val
28// _tensor_val
29// depending upon Value template parameter
30// => allows generic programmation vs Value
31//
32// implementation note:
33// template specialized accessor: use class-specialization
34// since specialization is neither available for func and class-member
35//
36// ----------------------------------------------------------------------------
37#include "rheolef/compiler_eigen.h"
38
39namespace rheolef { namespace details {
40
41// ----------------------------------------------------------------------------
42// disarray-valued data
43// ----------------------------------------------------------------------------
44template <class T, class Value> struct memorized_disarray {};
45
46#define _RHEOLEF_class_specialization(VALUE,MEMBER) \
47template <class T> \
48struct memorized_disarray<T,VALUE> { \
49 template <class Object> \
50 disarray<VALUE,typename Object::memory_type>& \
51 get (const Object& obj) const { \
52 return obj.MEMBER; \
53 } \
54}; \
55
57_RHEOLEF_class_specialization(point_basic<T>,_vector_val)
58_RHEOLEF_class_specialization(tensor_basic<T>,_tensor_val)
59_RHEOLEF_class_specialization(tensor3_basic<T>,_tensor3_val)
60_RHEOLEF_class_specialization(tensor4_basic<T>,_tensor4_val)
61#undef _RHEOLEF_class_specialization
62
63}} // namespace rheolef::details
64#endif // _RHEOLEF_MEMORIZED_DISARRAY_H
Expr1::float_type T
Definition field_expr.h:230
#define _RHEOLEF_class_specialization(VALUE, MEMBER)
This file is part of Rheolef.