Feel++ 0.111.0-preview.14
Finite Element Embedded Library in C++
Feel::vf::GinacMatrix< M, N, Order, SymbolsExprType > Class Template Reference

Handle Ginac matrix expression. More...

+ Inheritance diagram for Feel::vf::GinacMatrix< M, N, Order, SymbolsExprType >:
+ Collaboration diagram for Feel::vf::GinacMatrix< M, N, Order, SymbolsExprType >:

Classes

struct  FunctorsVariadicExpr
 
struct  HasTestFunction
 
struct  HasTrialFunction
 
struct  Lambda
 
struct  tensor
 
struct  TransformSymbolsExprTupleToAny
 

Typedefs

typedef Feel::vf::GiNaCBase super
 
using symbols_expression_storage_type = SymbolsExprType
 
using symbols_expression_type = typename symbols_expression_storage_type::symbols_expr_type
 
typedef symbols_expression_type::tuple_type symbols_expression_tuple_type
 
using test_basis = std::nullptr_t
 
using trial_basis = std::nullptr_t
 
typedef GiNaC::ex expression_type
 
typedef GinacMatrix< M, N, Order, SymbolsExprType > this_type
 
typedef double value_type
 
typedef mpl::if_< mpl::equal_to< mpl::int_< N >, mpl::int_< 1 > >, mpl::identity< Eigen::Matrix< value_type, M, 1 > >, mpl::identity< Eigen::Matrix< value_type, M, N, Eigen::RowMajor > > >::type::type evaluate_type
 
typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > vec_type
 
static const int nSymbolsExpr = std::decay_t<decltype(hana::size(symbols_expression_tuple_type{}))>::value
 
static const size_type context = vm::DYNAMIC
 
static const bool is_terminal = false
 
template<typename Funct >
static const bool has_test_basis
 
template<typename Funct >
static const bool has_trial_basis
 
template<int __M, int __N, int __Order, typename __SymbolsExprType >
class GinacMatrix
 
template<typename... TheExpr>
Lambda< TheExpr... >::type operator() (TheExpr... e)
 

Methods

const expression_type & expression () const
 
const GiNaC::FUNCP_CUBA & fun () const
 
std::vector< GiNaC::symbol > const & syms () const
 
std::string const & exprDesc () const
 
bool isEvaluable () const
 return true if the expression can be evaluated (TODO : iterate over symbols expression)
 
bool isConstant () const
 
void setNumericValue (double val)
 
const std::vector< std::vector< std::tuple< uint16_type, uint16_type, uint16_type > > > indices () const
 
Eigen::MatrixXd evaluate (std::map< std::string, value_type > const &mp)
 
Eigen::MatrixXd evaluate (bool parallel=true) const
 

Constructors, destructor

 GinacMatrix ()
 
 GinacMatrix (value_type value)
 
template<typename SymbolsExpressionArgType = symbols_expression_type>
 GinacMatrix (GiNaC::matrix const &fun, std::vector< GiNaC::symbol > const &syms, std::string const &exprDesc, std::string filename="", WorldComm const &world=Environment::worldComm(), std::string const &dirLibExpr=Environment::exprRepository(), SymbolsExpressionArgType const &expr=SymbolsExpressionArgType())
 
template<typename SymbolsExpressionArgType = symbols_expression_type>
 GinacMatrix (GiNaC::ex const &fun, std::vector< GiNaC::symbol > const &syms, std::string const &exprDesc, std::string filename="", WorldComm const &world=Environment::worldComm(), std::string const &dirLibExpr=Environment::exprRepository(), SymbolsExpressionArgType const &expr=SymbolsExpressionArgType())
 
template<typename SymbolsExpressionArgType >
 GinacMatrix (GiNaC::ex const &fun, std::vector< GiNaC::symbol > const &syms, GiNaC::FUNCP_CUBA const &cfun, std::string const &exprDesc, SymbolsExpressionArgType const &expr)
 
 GinacMatrix (GinacMatrix &&fun)=default
 
 GinacMatrix (GinacMatrix const &fun)=default
 

Operator overloads

this_type & operator= (this_type const &)=default
 
this_type & operator= (this_type &&)=default
 

Accessors

uint16_type polynomialOrder () const
 polynomial order
 
bool isPolynomial () const
 expression is polynomial?
 
symbols_expression_type const & symbolsExpression () const
 
symbols_expression_type & symbolsExpression ()
 
symbols_expression_storage_type const & symbolsExpressionStorage () const
 
std::vector< std::any > const & expandSymbolsExpression () const
 
std::vector< std::any > & expandSymbolsExpression ()
 
void setParameterValues (std::map< std::string, value_type > const &mp) override
 
void updateParameterValues (std::map< std::string, double > &pv) const
 
void renameSymbols (std::map< std::string, std::string > const &old2new)
 
template<typename TheSymbolExprType >
bool hasSymbolDependency (std::string const &symb, TheSymbolExprType const &se) const
 
template<typename TheSymbolExprType >
void dependentSymbols (std::string const &symb, std::map< std::string, std::set< std::string > > &res, TheSymbolExprType const &se) const
 
template<typename ExpandSymbolsExprType >
auto applySymbolsExpr (ExpandSymbolsExprType const &se) const
 
template<int diffOrder, typename TheSymbolExprType >
auto diff (std::string const &diffVariable, WorldComm const &world, std::string const &dirLibExpr, TheSymbolExprType const &se) const
 
template<int Dim>
auto grad (std::vector< std::string > const &diffVariables, WorldComm const &world, std::string const &dirLibExpr) const
 

Additional Inherited Members

- Public Types inherited from Feel::vf::GiNaCBase
typedef double value_type
 
typedef Eigen::Matrix< value_type, Eigen::Dynamic, 1 > vec_type
 
- Public Member Functions inherited from Feel::vf::GiNaCBase
size_type dynamicContext () const
 
void eraseParameterValues (std::set< std::string > const &symbNames)
 
 GiNaCBase (GiNaCBase const &g)=default
 
 GiNaCBase (std::vector< GiNaC::symbol > const &syms)
 
bool hasAnySymbolGeom () const
 
bool hasAnySymbolN () const
 
bool hasAnySymbolXYZ () const
 
bool hasSymbol (std::string const &symb) const
 
uint16_type index (std::string const &sname) const
 
std::set< std::pair< uint16_type, uint16_type > > const & indexSymbolGeom () const
 
std::set< std::pair< uint16_type, uint16_type > > const & indexSymbolN () const
 
std::set< std::pair< uint16_type, uint16_type > > const & indexSymbolXYZ () const
 
bool isNumericExpression () const
 return true if the expression is numeric (i.e. not a symbolic expression)
 
vec_type const & parameterValue () const
 
value_type parameterValue (int p) const
 
virtual void setParameterValues (std::map< std::string, value_type > const &mp)
 
void setParameterValues (vec_type const &p)
 
std::map< std::string, value_type > const & symbolNameToValue () const
 
const std::vector< GiNaC::symbol > & symbols () const
 
- Public Member Functions inherited from Feel::vf::ExprDynamicBase
size_type dynamicContext () const
 
 ExprDynamicBase (size_type c)
 
- Protected Attributes inherited from Feel::vf::GiNaCBase
size_type M_context
 
std::set< std::pair< uint16_type, uint16_type > > M_indexSymbolGeom
 
std::set< std::pair< uint16_type, uint16_type > > M_indexSymbolN
 
std::set< std::pair< uint16_type, uint16_type > > M_indexSymbolXYZ
 
bool M_isNumericExpression
 
vec_type M_params
 
std::map< std::string, value_type > M_symbolNameToValue
 
std::vector< GiNaC::symbol > M_syms
 

Detailed Description

template<int M = 1, int N = 1, int Order = 2, typename SymbolsExprType = symbols_expression_empty_t>
class Feel::vf::GinacMatrix< M, N, Order, SymbolsExprType >

Handle Ginac matrix expression.

Member Function Documentation

◆ setParameterValues()

template<int M = 1, int N = 1, int Order = 2, typename SymbolsExprType = symbols_expression_empty_t>
void Feel::vf::GinacMatrix< M, N, Order, SymbolsExprType >::setParameterValues ( std::map< std::string, value_type > const &  mp)
overridevirtual

Reimplemented from Feel::vf::GiNaCBase.

Member Data Documentation

◆ has_test_basis

template<int M = 1, int N = 1, int Order = 2, typename SymbolsExprType = symbols_expression_empty_t>
template<typename Funct >
const bool Feel::vf::GinacMatrix< M, N, Order, SymbolsExprType >::has_test_basis
static
Initial value:
= std::decay_t<decltype( hana::fold( symbols_expression_tuple_type{},
typename FunctorsVariadicExpr::template HasTestBasis<Funct>{} ) )>::value

◆ has_trial_basis

template<int M = 1, int N = 1, int Order = 2, typename SymbolsExprType = symbols_expression_empty_t>
template<typename Funct >
const bool Feel::vf::GinacMatrix< M, N, Order, SymbolsExprType >::has_trial_basis
static
Initial value:
= std::decay_t<decltype( hana::fold( symbols_expression_tuple_type{},
typename FunctorsVariadicExpr::template HasTrialBasis<Funct>{} ) )>::value