#include <crbmodel.hpp>
Certified Reduced Basis Model class.
This class implements the requirements over a model to be usable by the certified reduced basis method.
ModelType | the 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
Inherits enable_shared_from_this< CRBModel< ModelType > >.
Public Member Functions | |
Constructors, destructor | |
CRBModel () | |
CRBModel (po::variables_map const &vm, CRBModelMode mode=CRBModelMode::PFEM) | |
CRBModel (model_ptrtype &model) | |
CRBModel (model_ptrtype &model, CRBModelMode mode) | |
CRBModel (CRBModel const &o) | |
virtual | ~CRBModel () |
destructor | |
FEELPP_DONT_INLINE void | init () |
initialize the model (mesh, function space, operators, matrices, ...) | |
Operator overloads | |
CRBModel & | operator= (CRBModel const &o) |
copy operator | |
Accessors | |
po::variables_map | vm () const |
virtual sparse_matrix_ptrtype | newMatrix () const |
virtual vector_ptrtype | newVector () const |
sparse_matrix_ptrtype const & | innerProduct () const |
Returns the matrix associated with the ![]() | |
sparse_matrix_ptrtype | innerProduct () |
Returns the matrix associated with the ![]() | |
sparse_matrix_ptrtype const & | innerProductForMassMatrix () const |
Returns the matrix associated with the inner product. | |
sparse_matrix_ptrtype | innerProductForMassMatrix () |
Returns the matrix associated with the inner product. | |
sparse_matrix_ptrtype const & | h1 () const |
Returns the matrix associated with the ![]() | |
sparse_matrix_ptrtype | h1 () |
functionspace_ptrtype | functionSpace () const |
Returns the function space. | |
size_type | Qa () const |
return the number of ![]() | |
size_type | Qm () const |
return the number of ![]() | |
size_type | Qm (mpl::bool_< true >) const |
size_type | Qm (mpl::bool_< false >) const |
int | QInitialGuess () const |
int | mMaxA (int q) |
int | mMaxM (int q) |
int | mMaxM (int q, mpl::bool_< true >) |
int | mMaxM (int q, mpl::bool_< false >) |
int | mMaxInitialGuess (int q) const |
int | mMaxF (int output_index, int q) |
size_type | Nl () const |
return the number of outputs | |
size_type | Ql (int l) const |
return the number of ![]() | |
parameterspace_ptrtype | parameterSpace () const |
return the parameter space | |
parameter_type | refParameter () |
Methods | |
set the mesh characteristic length to | |
beta_vector_type | computeBetaInitialGuess (parameter_type const &mu) const |
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) |
betaqm_type | computeBetaQm (element_type const &T, parameter_type const &mu, double time=0) |
betaqm_type | computeBetaQm (element_type const &T, parameter_type const &mu, mpl::bool_< true >, double time=0) |
betaqm_type | computeBetaQm (element_type const &T, parameter_type const &mu, mpl::bool_< false >, double time=0) |
element_ptrtype | assembleInitialGuess (parameter_type const &mu) |
offline_merge_type | update (parameter_type const &mu, double time=0) |
update the model wrt mu | |
offline_merge_type | update (parameter_type const &mu, element_type const &T, double time=0) |
element_type | solveFemUsingAffineDecompositionFixedPoint (parameter_type const &mu) |
element_type | solveFemDualUsingAffineDecompositionFixedPoint (parameter_type const &mu) |
element_type | solveFemUsingOfflineEim (parameter_type const &mu) |
void | initModel () |
void | setInitialized (const bool &b) |
bool | isInitialized () |
model_type::funs_type | scalarContinuousEim () |
model_type::funsd_type | scalarDiscontinuousEim () |
double | computeNormL2 (element_type u1, element_type u2) |
double | computeNormL2 (element_type u1, element_type u2, mpl::bool_< false >) |
double | computeNormL2 (element_type u1, element_type u2, mpl::bool_< true >) |
operatorcomposite_ptrtype | operatorCompositeA () const |
std::vector < functionalcomposite_ptrtype > | functionalCompositeF () const |
operatorcomposite_ptrtype | operatorCompositeM () const |
operatorcomposite_ptrtype | operatorCompositeM (mpl::bool_< true >) const |
operatorcomposite_ptrtype | operatorCompositeM (mpl::bool_< false >) const |
affine_decomposition_type | computeAffineDecomposition () |
Compute the affine decomposition of the various forms. More... | |
affine_decomposition_type | computeAffineDecomposition (mpl::bool_< true >) |
affine_decomposition_type | computeAffineDecomposition (mpl::bool_< false >) |
std::vector< std::vector < element_ptrtype > > | computeInitialGuessAffineDecomposition () |
std::vector< std::vector < element_ptrtype > > | computeInitialGuessVAffineDecomposition () |
value_type | h1 (element_type const &xi_i, element_type const &xi_j) const |
the inner product ![]() | |
value_type | h1 (element_type const &xi_i) const |
the inner product ![]() | |
sparse_matrix_ptrtype | Aqm (uint16_type q, uint16_type m, bool transpose=false) |
Returns the matrix Aq [q][m] of the affine decomposition of the bilinear form. More... | |
const sparse_matrix_ptrtype | Mqm (uint16_type q, uint16_type m, bool transpose=false) const |
Returns the matrix Mq [q][m] of the affine decomposition of the bilinear form (time dependent) More... | |
sparse_matrix_ptrtype | Mqm (uint16_type q, uint16_type m, bool transpose=false) |
Returns the matrix Mq [q][m] of the affine decomposition of the bilinear form (time dependent) More... | |
const vector_ptrtype | InitialGuessVector (uint16_type q, uint16_type m) const |
vector_ptrtype | InitialGuessVector (uint16_type q, uint16_type m) |
value_type | Aqm (uint16_type q, uint16_type m, element_type const &xi_i, element_type const &xi_j, bool transpose=false) const |
the inner product ![]() | |
value_type | Mqm (uint16_type q, uint16_type m, element_type const &xi_i, element_type const &xi_j, bool transpose=false) const |
the inner product ![]() | |
beta_vector_type const & | betaInitialGuessQm (mpl::bool_< true >) const |
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... | |
element_ptrtype | InitialGuessQm (uint16_type q, int m) const |
value_type | Fqm (uint16_type l, uint16_type q, uint16_type m, element_type const &xi) |
the inner product ![]() | |
value_type | Fqm (uint16_type l, uint16_type q, uint16_type m, element_ptrtype const &xi) |
the inner product ![]() | |
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_type const &X, vector_type const &Y) |
double | scalarProductForPod (vector_type const &X, vector_type const &Y, mpl::bool_< true >) |
double | scalarProductForPod (vector_type const &X, vector_type const &Y, mpl::bool_< false >) |
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 | solve (parameter_type const &mu, element_ptrtype &u) |
void | solve (parameter_type const &mu, element_ptrtype &u, vector_ptrtype const &L, bool transpose=false) |
void | l2solve (vector_ptrtype &u, vector_ptrtype const &f) |
boost::tuple< int, value_type > | solve (sparse_matrix_ptrtype const &A, vector_ptrtype &x, vector_ptrtype const &f, bool tranpose=false) |
solve ![]() | |
void | run (const double *X, unsigned long N, double *Y, unsigned long P) |
export a vector of elements More... | |
value_type | output (int output_index, parameter_type const &mu, element_type &u, bool need_to_solve=false) |
int | computeNumberOfSnapshots () |
int | computeNumberOfSnapshots (mpl::bool_< true >) |
int | computeNumberOfSnapshots (mpl::bool_< false >) |
vectorN_type | computeStatistics (Eigen::VectorXd vector, std::string name) |
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 >) |
int | timeOrder () |
int | timeOrder (mpl::bool_< true >) |
int | timeOrder (mpl::bool_< false >) |
bool | isSteady () |
bool | isSteady (mpl::bool_< true >) |
bool | isSteady (mpl::bool_< false >) |
void | initializationField (element_ptrtype &initial_field, parameter_type const &mu) |
void | initializationField (element_ptrtype &initial_field, parameter_type const &mu, mpl::bool_< true >) |
void | initializationField (element_ptrtype &initial_field, parameter_type const &mu, mpl::bool_< false >) |
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 | |
std::vector< std::vector < std::vector< vector_ptrtype > > > | M_Fqm |
affine decomposition terms for the right hand side | |
std::vector< std::vector < element_ptrtype > > | M_InitialGuessV |
std::vector< std::vector < vector_ptrtype > > | M_InitialGuessVector |
std::vector< std::vector < sparse_matrix_ptrtype > > | M_Mqm |
affine decomposition terms ( time dependent ) | |
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 std::vector < std::vector< element_ptrtype > > | initial_guess_type |
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 Bdf< space_type > | bdf_type |
time discretization | |
typedef boost::shared_ptr < bdf_type > | bdf_ptrtype |
typedef OperatorLinearComposite < space_type, space_type > | operatorcomposite_type |
typedef boost::shared_ptr < operatorcomposite_type > | operatorcomposite_ptrtype |
typedef FsFunctionalLinearComposite < space_type > | functionalcomposite_type |
typedef boost::shared_ptr < functionalcomposite_type > | functionalcomposite_ptrtype |
typedef Preconditioner< double > | preconditioner_type |
typedef boost::shared_ptr < preconditioner_type > | preconditioner_ptrtype |
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 |
|
inline |
model | the model to be used |
References Feel::CRBModel< ModelType >::init().
|
inline |
copy constructor
References Feel::CRBModel< ModelType >::init().
|
inline |
Returns the matrix Aq
[q][m] of the affine decomposition of the bilinear form.
q | and m are index of the component in the affine decomposition |
transpose | transpose A_q |
Aq
[q][m] of the affine decomposition of the bilinear form References Feel::CRBModel< ModelType >::M_Aqm, and Feel::CRBModel< ModelType >::operatorCompositeA().
|
inline |
the inner product
q | and m index of the component in the affine decomposition |
xi_i | an element of the function space |
xi_j | an element of the function space |
transpose | transpose A_{qm} |
References Feel::CRBModel< ModelType >::M_Aqm, and Feel::CRBModel< ModelType >::operatorCompositeA().
|
inline |
Compute the affine decomposition of the various forms.
This function assembles the parameter independant part of the affine decomposition of the bilinear and linear forms. This function will assemble and stock all matrices/vector associated to the affine decomposition and must be called ONLY if crb.stock-matrices=true
|
inline |
the vector Fq
[q][m] of the affine decomposition of the right hand side
References Feel::CRBModel< ModelType >::M_Fqm.
|
inline |
the inner product
Denote the algebraic representation of the linear form associated with the right hand side.
q | and m index of the component in the affine decomposition |
xi | an element of the function space |
References Feel::inner_product(), and Feel::CRBModel< ModelType >::M_Fqm.
|
inline |
the inner product
Denote the algebraic representation of the linear form associated with the right hand side.
q | and m index of the component in the affine decomposition |
xi | an element of the function space |
References Feel::inner_product(), and Feel::CRBModel< ModelType >::M_Fqm.
|
inline |
the inner product
xi_i | an element of the function space |
xi_j | an element of the function space |
transpose | transpose A_q |
|
inline |
the inner product
xi_i | an element of the function space |
xi_j | an element of the function space |
transpose | transpose A_q |
|
inline |
initialize the model
|
inline |
solve where
is the matrix associated to the
norm
|
inline |
Returns the matrix Mq
[q][m] of the affine decomposition of the bilinear form (time dependent)
q | and m are index of the component in the affine decomposition |
transpose | transpose M_q |
Mq
[q][m] of the affine decomposition of the bilinear form (ime dependent) References Feel::CRBModel< ModelType >::M_Mqm.
|
inline |
Returns the matrix Mq
[q][m] of the affine decomposition of the bilinear form (time dependent)
q | and m are index of the component in the affine decomposition |
transpose | transpose M_q |
Mq
[q][m] of the affine decomposition of the bilinear form (ime dependent) References Feel::CRBModel< ModelType >::M_Mqm.
|
inline |
the inner product
q | and m index of the component in the affine decomposition |
xi_i | an element of the function space |
xi_j | an element of the function space |
transpose | transpose M_{qm} |
References Feel::CRBModel< ModelType >::M_Mqm.
|
inlinevirtual |
create a new matrix
|
inlinevirtual |
create a new vector
|
inline |
Access to a pre-assemble objects given by the model The key of the map is a tuple of two double (one for "q" index and other for "m" index) The q^th term of the affine decomposition can have m terms from the EIM Let MAT the matrix associated to index (q,m) MAT can have contributions from elements of the mesh, or faces, or both that is why we have a vector of pre-assemble objects (and not only one pre-assemble object) associated with a tuple <q,m>
|
inline |
Given the output index output_index
and the parameter mu
, return the value of the corresponding FEM output
void Feel::CRBModel< TruthModelType >::run | ( | const double * | X, |
unsigned long | N, | ||
double * | Y, | ||
unsigned long | P | ||
) |
export a vector of elements
v | a vector of shared_ptr<> elements of the functions space run the model |
|
inline |
returns list of eim objects ( scalar continuous)
|
inline |
returns list of eim objects ( scalar discontinuous)
|
inline |
returns the scalar product of the vector x and vector y
|
inline |
returns the scalar product of the vector x and vector y
|
inline |
returns the scalar product used for the mass matrix of the vector x and vector y
|
inline |
returns the scalar product used for the mass matrix of the vector x and vector y
|
inline |
returns the scalar product used to assemble POD matrix of the vector x and vector y
|
inline |
returns the scalar product used to assemble POD matrix of the vector x and vector y
References Feel::CRBModel< ModelType >::scalarProductForPod().
|
inline |
solve the model for a given parameter mu
|
inline |
solve the model for a given parameter mu
|
inline |
solve the model for a given parameter mu
and L
as right hand side
transpose | if true solve the transposed(dual) problem |
|
inline |
solve
tranpose
is true then solve for A | matrix |
x | solution vector |
f | right hand side vector |
transpose | if is true solve for ![]() ![]() |
|
inline |
variables_map