Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Feel::CRBModelTrilinear< ModelType > Class Template Reference

#include <crbmodeltrilinear.hpp>

Detailed Description

template<typename ModelType>
class Feel::CRBModelTrilinear< ModelType >

Certified Reduced Basis Model trilinear class.

This class implements the requirements over a model to be usable by the certified reduced basis method.

Template Parameters
ModelTypethe type of the finite element method model

The FEM model type should derive from this class and fill the vector of matrices M_Aq and vector of vectors M_Fq

Author
Christophe Prud'homme
See Also
crb

Public Member Functions

bool isSteady ()
 
bool isSteady (mpl::bool_< true >)
 
bool isSteady (mpl::bool_< false >)
 
model_type::funs_type scalarContinuousEim ()
 
model_type::funsd_type scalarDiscontinuousEim ()
 
Constructors, destructor
 CRBModelTrilinear ()
 
 CRBModelTrilinear (po::variables_map const &vm, CRBModelMode mode=CRBModelMode::PFEM)
 
 CRBModelTrilinear (model_ptrtype &model)
 
 CRBModelTrilinear (CRBModelTrilinear const &o)
 
virtual ~CRBModelTrilinear ()
 destructor
 
FEELPP_DONT_INLINE void init ()
 initialize the model (mesh, function space, operators, matrices, ...)
 
Operator overloads
CRBModelTrilinearoperator= (CRBModelTrilinear const &o)
 copy operator
 
Accessors
po::variables_map vm () const
 
virtual sparse_matrix_ptrtype newMatrix () const
 
virtual vector_ptrtype newVector () const
 
functionspace_ptrtype functionSpace () const
 Returns the function space.
 
size_type Qa () const
 return the number of $\mu$ independent terms for the bilinear form
 
size_type QaTri () const
 return the number of $\mu$ independent terms for the trilinear form
 
sparse_matrix_ptrtype computeTrilinearForm (element_type const &xi)
 
sparse_matrix_ptrtype jacobian (element_type const &xi)
 
vector_ptrtype residual (element_type const &xi)
 
vectorN_type computeStatistics (Eigen::VectorXd vector, std::string name)
 
size_type Nl () const
 return the number of outputs
 
size_type Ql (int l) const
 return the number of $\mu$ independent terms for the right hand side
 
parameterspace_ptrtype parameterSpace () const
 return the parameter space
 
parameter_type refParameter ()
 
Mutators
void setMeshSize (double s)
 

Static Public Attributes

Constants
static const uint16_type ParameterSpaceDimension = ModelType::ParameterSpaceDimension
 
static const bool is_time_dependent = ModelType::is_time_dependent
 

Protected Attributes

std::vector< std::vector
< sparse_matrix_ptrtype > > 
M_Aqm
 affine decomposition terms for the left hand side ( bilinear )
 
std::vector< std::vector
< std::vector< vector_ptrtype > > > 
M_Fqm
 affine decomposition terms for the right hand side
 

Typedefs

typedef ModelType model_type
 model type
 
typedef boost::shared_ptr
< ModelType > 
model_ptrtype
 
typedef model_type::value_type value_type
 value_type
 
typedef ModelType::mesh_type mesh_type
 mesh type
 
typedef ModelType::mesh_ptrtype mesh_ptrtype
 mesh shared_ptr
 
typedef ModelType::space_type space_type
 space_type
 
typedef
model_type::functionspace_type 
functionspace_type
 function space type
 
typedef
model_type::functionspace_ptrtype 
functionspace_ptrtype
 
typedef model_type::element_type element_type
 element of the functionspace type
 
typedef model_type::element_ptrtype element_ptrtype
 
typedef model_type::backend_type backend_type
 
typedef boost::shared_ptr
< backend_type > 
backend_ptrtype
 
typedef
model_type::sparse_matrix_ptrtype 
sparse_matrix_ptrtype
 
typedef model_type::vector_ptrtype vector_ptrtype
 
typedef model_type::vector_type vector_type
 
typedef
model_type::eigen_matrix_type 
eigen_matrix_type
 
typedef
model_type::parameterspace_type 
parameterspace_type
 
typedef
model_type::parameterspace_ptrtype 
parameterspace_ptrtype
 
typedef model_type::parameter_type parameter_type
 
typedef
model_type::parameter_ptrtype 
parameter_ptrtype
 
typedef model_type::sampling_type sampling_type
 
typedef
model_type::sampling_ptrtype 
sampling_ptrtype
 
typedef Eigen::VectorXd vectorN_type
 
typedef std::vector
< std::vector< double > > 
beta_vector_type
 
typedef boost::tuple
< sparse_matrix_ptrtype,
sparse_matrix_ptrtype,
std::vector< vector_ptrtype > > 
offline_merge_type
 
typedef boost::tuple
< std::vector< std::vector
< sparse_matrix_ptrtype >
>, std::vector< std::vector
< sparse_matrix_ptrtype >
>, std::vector< std::vector
< std::vector< vector_ptrtype > > > > 
affine_decomposition_type
 
typedef boost::tuple
< beta_vector_type,
beta_vector_type, std::vector
< beta_vector_type > > 
betaqm_type
 
typedef mpl::if_
< boost::is_same< mpl::int_
< nb_spaces >, mpl::int_
< 2 > >, fusion::vector
< mpl::int_< 0 >, mpl::int_
< 1 > >, typename mpl::if_
< boost::is_same< mpl::int_
< nb_spaces >, mpl::int_
< 3 > >, fusion::vector
< mpl::int_< 0 >, mpl::int_
< 1 >, mpl::int_
< 2 > >, typename mpl::if_
< boost::is_same< mpl::int_
< nb_spaces >, mpl::int_
< 4 > >, fusion::vector
< mpl::int_< 0 >, mpl::int_
< 1 >, mpl::int_
< 2 >, mpl::int_
< 3 > >, fusion::vector
< mpl::int_< 0 >, mpl::int_
< 1 >, mpl::int_
< 2 >, mpl::int_
< 3 >, mpl::int_
< 4 > > >::type >::type >
::type 
index_vector_type
 
static const int nb_spaces = functionspace_type::nSpaces
 

Methods

offline_merge_type result_offline_merge_type
 
betaqm_type computeBetaQm (parameter_type const &mu, double time=0)
 compute the betaqm given mu
 
betaqm_type computeBetaQm (parameter_type const &mu, mpl::bool_< true >, double time=0)
 
betaqm_type computeBetaQm (parameter_type const &mu, mpl::bool_< false >, double time=0)
 
affine_decomposition_type computeAffineDecomposition ()
 Compute the affine decomposition of the various forms. More...
 
sparse_matrix_ptrtype Aqm (uint16_type q, uint16_type m, bool transpose=false) const
 Returns the matrix Aq[q][m] of the affine decomposition of the bilinear form. More...
 
value_type Aqm (uint16_type q, uint16_type m, element_type const &xi_i, element_type const &xi_j, bool transpose=false)
 the inner product $a_{qm}(\xi_i, \xi_j) = \xi_j^T A_{qm} \xi_i$ More...
 
vector_ptrtype Fqm (uint16_type l, uint16_type q, int m) const
 the vector Fq[q][m] of the affine decomposition of the right hand side More...
 
value_type Fqm (uint16_type l, uint16_type q, uint16_type m, element_type const &xi)
 the inner product $f_{qm}(\xi) = \xi^T F_{qm} $ More...
 
value_type Fqm (uint16_type l, uint16_type q, uint16_type m, element_ptrtype const &xi)
 the inner product $f_{qm}(\xi) = \xi^T F_{qm} $ More...
 
double scalarProduct (vector_type const &X, vector_type const &Y)
 
double scalarProduct (vector_ptrtype const &X, vector_ptrtype const &Y)
 
double scalarProductForMassMatrix (vector_type const &X, vector_type const &Y)
 
double scalarProductForMassMatrix (vector_ptrtype const &X, vector_ptrtype const &Y)
 
double scalarProductForPod (vector_ptrtype const &X, vector_ptrtype const &Y)
 
double scalarProductForPod (vector_ptrtype const &X, vector_ptrtype const &Y, mpl::bool_< true >)
 
double scalarProductForPod (vector_ptrtype const &X, vector_ptrtype const &Y, mpl::bool_< false >)
 
element_type solve (parameter_type const &mu)
 
void l2solve (vector_ptrtype &u, vector_ptrtype const &f)
 
void run (const double *X, unsigned long N, double *Y, unsigned long P)
 
value_type output (int output_index, parameter_type const &mu, element_type &u, bool need_to_solve=false)
 
double timeStep ()
 
double timeStep (mpl::bool_< true >)
 
double timeStep (mpl::bool_< false >)
 
double timeInitial ()
 
double timeInitial (mpl::bool_< true >)
 
double timeInitial (mpl::bool_< false >)
 
double timeFinal ()
 
double timeFinal (mpl::bool_< true >)
 
double timeFinal (mpl::bool_< false >)
 
element_type solveFemUsingAffineDecompositionFixedPoint (parameter_type const &mu)
 
element_type solveFemDualUsingAffineDecompositionFixedPoint (parameter_type const &mu)
 
element_type solveFemUsingOfflineEim (parameter_type const &mu)
 
offline_merge_type update (parameter_type const &mu, double time=0)
 
sparse_matrix_ptrtype const & innerProduct () const
 
sparse_matrix_ptrtype const & innerProductForMassMatrix () const
 
sparse_matrix_ptrtype Mqm (uint16_type q, uint16_type m, bool transpose=false) const
 
value_type Mqm (uint16_type q, uint16_type m, element_type const &xi_i, element_type const &xi_j, bool transpose=false) const
 
size_type Qm () const
 
int mMaxA (int q)
 
int mMaxM (int q)
 
int mMaxMF (int q)
 
int mMaxF (int output_index, int q)
 

Constructor & Destructor Documentation

template<typename ModelType >
Feel::CRBModelTrilinear< ModelType >::CRBModelTrilinear ( model_ptrtype &  model)
inline
Parameters
modelthe model to be used

References Feel::CRBModelTrilinear< ModelType >::init().

template<typename ModelType >
Feel::CRBModelTrilinear< ModelType >::CRBModelTrilinear ( CRBModelTrilinear< ModelType > const &  o)
inline

copy constructor

References Feel::CRBModelTrilinear< ModelType >::init().

Member Function Documentation

template<typename ModelType >
sparse_matrix_ptrtype Feel::CRBModelTrilinear< ModelType >::Aqm ( uint16_type  q,
uint16_type  m,
bool  transpose = false 
) const
inline

Returns the matrix Aq[q][m] of the affine decomposition of the bilinear form.

Parameters
qand m are index of the component in the affine decomposition
transposetranspose A_q
Returns
the matrix Aq[q][m] of the affine decomposition of the bilinear form

References Feel::CRBModelTrilinear< ModelType >::M_Aqm.

template<typename ModelType >
value_type Feel::CRBModelTrilinear< ModelType >::Aqm ( uint16_type  q,
uint16_type  m,
element_type const &  xi_i,
element_type const &  xi_j,
bool  transpose = false 
)
inline

the inner product $a_{qm}(\xi_i, \xi_j) = \xi_j^T A_{qm} \xi_i$

Parameters
qand m index of the component in the affine decomposition
xi_ian element of the function space
xi_jan element of the function space
transposetranspose A_{qm}
Returns
the inner product $a_qm(\xi_i, \xi_j) = \xi_j^T A_{qm} \xi_i$

References Feel::CRBModelTrilinear< ModelType >::M_Aqm.

template<typename ModelType >
affine_decomposition_type Feel::CRBModelTrilinear< ModelType >::computeAffineDecomposition ( )
inline

Compute the affine decomposition of the various forms.

This function defined in the M_model assembles the parameter independant part of the affine decomposition of the bilinear and linear forms.

References Feel::CRBModelTrilinear< ModelType >::M_Aqm, and Feel::CRBModelTrilinear< ModelType >::M_Fqm.

template<typename ModelType >
vector_ptrtype Feel::CRBModelTrilinear< ModelType >::Fqm ( uint16_type  l,
uint16_type  q,
int  m 
) const
inline

the vector Fq[q][m] of the affine decomposition of the right hand side

Returns
the vector associated with $F_{qm}$

References Feel::CRBModelTrilinear< ModelType >::M_Fqm.

template<typename ModelType >
value_type Feel::CRBModelTrilinear< ModelType >::Fqm ( uint16_type  l,
uint16_type  q,
uint16_type  m,
element_type const &  xi 
)
inline

the inner product $f_{qm}(\xi) = \xi^T F_{qm} $

Denote $F_{qm}$ the algebraic representation of the linear form associated with the right hand side.

Parameters
qand m index of the component in the affine decomposition
xian element of the function space
Returns
the inner product $f_{qm}(\xi) = \xi^T F_{qm} $

References Feel::inner_product(), and Feel::CRBModelTrilinear< ModelType >::M_Fqm.

template<typename ModelType >
value_type Feel::CRBModelTrilinear< ModelType >::Fqm ( uint16_type  l,
uint16_type  q,
uint16_type  m,
element_ptrtype const &  xi 
)
inline

the inner product $f_{qm}(\xi) = \xi^T F_{qm} $

Denote $F_{qm}$ the algebraic representation of the linear form associated with the right hand side.

Parameters
qand m index of the component in the affine decomposition
xian element of the function space
Returns
the inner product $f_{qm}(\xi) = \xi^T F_{qm} $

References Feel::inner_product(), and Feel::CRBModelTrilinear< ModelType >::M_Fqm.

template<typename ModelType >
void Feel::CRBModelTrilinear< ModelType >::l2solve ( vector_ptrtype &  u,
vector_ptrtype const &  f 
)
inline

solve $M u = f$ where $ M $ is the matrix associated to the $ L_2 $ norm

template<typename ModelType >
virtual sparse_matrix_ptrtype Feel::CRBModelTrilinear< ModelType >::newMatrix ( ) const
inlinevirtual

create a new matrix

Returns
the newly created matrix
template<typename ModelType >
virtual vector_ptrtype Feel::CRBModelTrilinear< ModelType >::newVector ( ) const
inlinevirtual

create a new vector

Returns
the newly created vector
template<typename ModelType >
value_type Feel::CRBModelTrilinear< ModelType >::output ( int  output_index,
parameter_type const &  mu,
element_type u,
bool  need_to_solve = false 
)
inline

Given the output index output_index and the parameter mu, return the value of the corresponding FEM output

template<typename TruthModelType >
void Feel::CRBModelTrilinear< TruthModelType >::run ( const double *  X,
unsigned long  N,
double *  Y,
unsigned long  P 
)

run the model

template<typename ModelType >
model_type::funs_type Feel::CRBModelTrilinear< ModelType >::scalarContinuousEim ( )
inline

returns list of eim objects ( scalar continuous)

template<typename ModelType >
model_type::funsd_type Feel::CRBModelTrilinear< ModelType >::scalarDiscontinuousEim ( )
inline

returns list of eim objects ( scalar discontinuous)

template<typename ModelType >
double Feel::CRBModelTrilinear< ModelType >::scalarProduct ( vector_type const &  X,
vector_type const &  Y 
)
inline

returns the scalar product of the vector x and vector y

template<typename ModelType >
double Feel::CRBModelTrilinear< ModelType >::scalarProduct ( vector_ptrtype const &  X,
vector_ptrtype const &  Y 
)
inline

returns the scalar product of the vector x and vector y

template<typename ModelType >
double Feel::CRBModelTrilinear< ModelType >::scalarProductForMassMatrix ( vector_type const &  X,
vector_type const &  Y 
)
inline

returns the scalar product used for the mass matrix of the vector x and vector y

template<typename ModelType >
double Feel::CRBModelTrilinear< ModelType >::scalarProductForMassMatrix ( vector_ptrtype const &  X,
vector_ptrtype const &  Y 
)
inline

returns the scalar product used for the mass matrix of the vector x and vector y

template<typename ModelType >
double Feel::CRBModelTrilinear< ModelType >::scalarProductForPod ( vector_ptrtype const &  X,
vector_ptrtype const &  Y 
)
inline

returns the scalar product used to assemble POD matrix of the vector x and vector y

template<typename ModelType >
void Feel::CRBModelTrilinear< ModelType >::setMeshSize ( double  s)
inline

set the mesh characteristic length to s

template<typename ModelType >
element_type Feel::CRBModelTrilinear< ModelType >::solve ( parameter_type const &  mu)
inline

solve the model for a given parameter mu

template<typename ModelType >
po::variables_map Feel::CRBModelTrilinear< ModelType >::vm ( ) const
inline
Returns
the variables_map

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

Generated on Fri Oct 25 2013 14:24:28 for Feel++ by doxygen 1.8.4