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::CRBSCM< TruthModelType > Class Template Reference

#include <crbscm.hpp>

Detailed Description

template<typename TruthModelType>
class Feel::CRBSCM< TruthModelType >

SCM algorithm.

Template Parameters
TruthModelTypethe type of the class that describes the truth (e.g. fem) model problem

TruthModelType must support a certain interface: affine decomposition, solve for fm problem and problem associated with with affine decomposition. As to the SCM, it should problem

  • eigensolves for the full Truth problem
  • eigensolves associated with the affine decomposition
Author
Christophe Prud'homme
See Also
page scm
+ Inheritance diagram for Feel::CRBSCM< TruthModelType >:

Public Types

Typedefs
typedef TruthModelType truth_model_type
 
typedef truth_model_type model_type
 
typedef boost::shared_ptr
< truth_model_type > 
truth_model_ptrtype
 
typedef double value_type
 
typedef boost::tuple< double,
double > 
bounds_type
 
typedef ParameterSpace
< TruthModelType::ParameterSpaceDimension > 
parameterspace_type
 
typedef boost::shared_ptr
< parameterspace_type
parameterspace_ptrtype
 
typedef
parameterspace_type::element_type 
parameter_type
 
typedef
parameterspace_type::element_ptrtype 
parameter_ptrtype
 
typedef
parameterspace_type::sampling_type 
sampling_type
 
typedef
parameterspace_type::sampling_ptrtype 
sampling_ptrtype
 
typedef boost::tuple< double,
parameter_type, size_type,
double, double > 
relative_error_type
 
typedef model_type::backend_type backend_type
 
typedef
model_type::sparse_matrix_ptrtype 
sparse_matrix_ptrtype
 
typedef model_type::vector_ptrtype vector_ptrtype
 
typedef
model_type::beta_vector_type 
beta_vector_type
 
typedef Eigen::VectorXd y_type
 
typedef Eigen::VectorXd vector_type
 
typedef std::vector
< std::vector< y_type > > 
y_set_type
 
typedef std::vector
< std::vector< boost::tuple
< double, double > > > 
y_bounds_type
 

Public Member Functions

sampling_ptrtype c () const
 
Constructors, destructor
 CRBSCM ()
 default constructor
 
 CRBSCM (std::string const &name, po::variables_map const &vm)
 constructor from command line options
 
 CRBSCM (std::string const &name, po::variables_map const &vm, truth_model_ptrtype const &model)
 constructor from command line options
 
 CRBSCM (std::string const &name, po::variables_map const &vm, truth_model_ptrtype const &model, bool scm_for_mass_matrix)
 constructor from command line options
 
 CRBSCM (CRBSCM const &o)
 copy constructor
 
 ~CRBSCM ()
 destructor
 
Operator overloads
CRBSCMoperator= (CRBSCM const &o)
 copy operator
 
Accessors
size_type KMax () const
 Returns maximum value of K.
 
int maxIter () const
 return max iterations
 
parameterspace_ptrtype Dmu () const
 return the parameter space
 
int Mplus () const
 get M+
 
int Malpha ()
 get Malpha
 
Mutators
void setTolerance (double tolerance)
 set offline tolerance
 
void setMplus (int Mplus)
 set M+
 
void setMalpha (int Malpha)
 set Malpha
 
void setTruthModel (truth_model_ptrtype const &model)
 set the truth offline model
 
void setMaxIter (int K)
 set Kmax
 
void setScmForMassMatrix (bool b)
 set bool ( if we do scm for mass matrix or not )
 
int mMax (int q) const
 
int nb_decomposition_terms_q (void) const
 
int nb_decomposition_terms_qm (void) const
 
Methods
void generate ()
 
void checkC (size_type K) const
 
boost::tuple< value_type,
value_type > 
ex (parameter_type const &mu) const
 
boost::tuple< value_type,
value_type > 
lb (parameter_type const &mu, size_type K=invalid_size_type_value, int indexmu=-1) const
 
boost::tuple< value_type,
value_type > 
lbSCM (parameter_type const &mu, size_type K=invalid_size_type_value, int indexmu=-1) const
 
boost::tuple< value_type,
value_type > 
lbNoSCM (parameter_type const &mu, size_type K=invalid_size_type_value, int indexmu=-1) const
 
boost::tuple< value_type,
value_type > 
lb (parameter_ptrtype const &mu, size_type K=invalid_size_type_value, int indexmu=-1) const
 
boost::tuple< value_type,
value_type > 
ub (parameter_type const &mu, size_type K=invalid_size_type_value) const
 
boost::tuple< value_type,
value_type > 
ub (parameter_ptrtype const &mu, size_type K=invalid_size_type_value) const
 
std::vector< boost::tuple
< double, double, double > > 
offline ()
 
std::vector< boost::tuple
< double, double, double > > 
offlineSCM ()
 
std::vector< boost::tuple
< double, double, double > > 
offlineNoSCM ()
 
bounds_type online () const
 
relative_error_type maxRelativeError (size_type K) const
 Retuns maximum value of the relative error. More...
 
void computeYBounds ()
 compute the bounds for $y \in \mathbb{R}^{Q_a}$
 
std::vector< double > run (parameter_type const &mu, int K)
 
void run (const double *X, unsigned long N, double *Y, unsigned long P)
 
void saveDB ()
 
bool loadDB ()
 
bool rebuildDB ()
 
bool doScmForMassMatrix ()
 
- Public Member Functions inherited from Feel::CRBDB
 CRBDB ()
 default constructor
 
 CRBDB (std::string prefixdir, std::string name, std::string dbprefix, po::variables_map const &vm)
 constructor from command line options
 
 CRBDB (CRBDB const &)
 copy constructor
 
virtual ~CRBDB ()
 destructor
 
CRBDBoperator= (CRBDB const &o)
 copy operator
 
std::string const & prefixDirectory () const
 
std::string const & name () const
 
std::string const & dbFilename () const
 
fs::path dbLocalPath () const
 
fs::path dbSystemPath () const
 
fs::path lookForDB () const
 
po::variables_map vm ()
 
po::variables_map vm () const
 
bool isDBLoaded () const
 
void setDBFilename (std::string const &filename)
 set the DB filename
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Member Functions inherited from Feel::CRBDB
template<class Archive >
void load (Archive &ar, const unsigned int version)
 
template<class Archive >
void save (Archive &ar, const unsigned int version) const
 
void setIsLoaded (bool isloaded)
 

Member Function Documentation

template<typename TruthModelType >
void Feel::CRBSCM< TruthModelType >::checkC ( size_type  K) const

check $C_K$ properties

Parameters
Kdimension of $C_K$

References Feel::CRBSCM< TruthModelType >::lb(), and Feel::CRBSCM< TruthModelType >::ub().

template<typename TruthModelType>
void Feel::CRBSCM< TruthModelType >::generate ( )

generate offline the space $C_K$

template<typename TruthModelType >
boost::tuple< typename CRBSCM< TruthModelType >::value_type, double > Feel::CRBSCM< TruthModelType >::lb ( parameter_type const &  mu,
size_type  K = invalid_size_type_value,
int  indexmu = -1 
) const

Returns the lower bound of the coercive constant given a parameter $\mu$

Parameters
mu$ \mu$ the parameter at which to evaluate the coercive constant
Kthe dimension of $Y_{\mathrm{UB}}$
Returns
compute online the lower bounmd
template<typename TruthModelType>
boost::tuple<value_type,value_type> Feel::CRBSCM< TruthModelType >::lb ( parameter_ptrtype const &  mu,
size_type  K = invalid_size_type_value,
int  indexmu = -1 
) const
inline

Returns the lower bound of the coercive constant given a parameter $\mu$

Parameters
mu$ \mu$ the parameter at which to evaluate the coercive constant
Kthe dimension of $Y_{\mathrm{UB}}$
Returns
compute online the lower bounmd

References Feel::CRBSCM< TruthModelType >::lb().

template<typename TruthModelType >
bool Feel::CRBSCM< TruthModelType >::loadDB ( )
virtual

load the CRB database

Reimplemented from Feel::CRBDB.

References Feel::CRBDB::lookForDB().

template<typename TruthModelType >
CRBSCM< TruthModelType >::relative_error_type Feel::CRBSCM< TruthModelType >::maxRelativeError ( size_type  K) const

Retuns maximum value of the relative error.

Parameters
Xifine sampling of the parameter space

References Feel::CRBSCM< TruthModelType >::lb(), and Feel::CRBSCM< TruthModelType >::ub().

template<typename TruthModelType >
std::vector< boost::tuple< double, double, double > > Feel::CRBSCM< TruthModelType >::offline ( )

Offline computation

template<typename TruthModelType>
bounds_type Feel::CRBSCM< TruthModelType >::online ( ) const
inline

Online computation

template<typename TruthModelType >
std::vector< double > Feel::CRBSCM< TruthModelType >::run ( parameter_type const &  mu,
int  K 
)
Parameters
Ksize of C_K
muparameter set

References Feel::CRBSCM< TruthModelType >::lb(), and Feel::CRBSCM< TruthModelType >::ub().

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

run scm for a set of parameter

Parameters
X- input parameter
N- number of input parameter
Y- outputs
P- number of outputs

the output is the lower/upper bounds, hence P=2

References Feel::CRBSCM< TruthModelType >::KMax(), Feel::CRBSCM< TruthModelType >::lb(), and Feel::CRBSCM< TruthModelType >::ub().

template<typename TruthModelType >
void Feel::CRBSCM< TruthModelType >::saveDB ( )
virtual

save the CRB database

Reimplemented from Feel::CRBDB.

References Feel::CRBDB::dbFilename(), and Feel::CRBDB::dbLocalPath().

template<typename TruthModelType >
boost::tuple< typename CRBSCM< TruthModelType >::value_type, double > Feel::CRBSCM< TruthModelType >::ub ( parameter_type const &  mu,
size_type  K = invalid_size_type_value 
) const

Returns the upper bound of the coercive constant given a parameter $\mu$

Parameters
mu$ \mu$ the parameter at which to evaluate the coercive constant
Kthe dimension of $Y_{\mathrm{UB}}$
Returns
compute online the lower bounmd

References Feel::invalid_size_type_value, and Feel::CRBSCM< TruthModelType >::KMax().

template<typename TruthModelType>
boost::tuple<value_type,value_type> Feel::CRBSCM< TruthModelType >::ub ( parameter_ptrtype const &  mu,
size_type  K = invalid_size_type_value 
) const
inline

Returns the upper bound of the coercive constant given a parameter $\mu$

Parameters
mu$ \mu$ the parameter at which to evaluate the coercive constant
Kthe dimension of $Y_{\mathrm{UB}}$
Returns
compute online the lower bounmd

References Feel::CRBSCM< TruthModelType >::ub().


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