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

#include <crb_trilinear.hpp>

Detailed Description

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

Certifed Reduced Basis for Trilinear forms class.

Implements the certified reduced basis method for treat trilinear forms

Author
Elisa Schenone, Stephane Veys
See Also
+ Inheritance diagram for Feel::CRBTrilinear< 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 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::bimap< int,
boost::tuple< double, double,
double > > 
convergence_type
 
typedef double value_type
 
typedef
convergence_type::value_type 
convergence
 
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::beta_vector_type 
beta_vector_type
 
typedef std::vector< element_typewn_type
 
typedef boost::tuple
< std::vector< wn_type >
, std::vector< std::string > > 
export_vector_wn_type
 
typedef Eigen::VectorXd vectorN_type
 
typedef Eigen::MatrixXd matrixN_type
 
typedef model_type::mesh_type mesh_type
 mesh type
 
typedef boost::shared_ptr
< mesh_type
mesh_ptrtype
 
typedef model_type::space_type space_type
 space type
 
typedef boost::shared_ptr
< space_type
space_ptrtype
 
typedef Eigen::Map
< Eigen::Matrix< double,
Eigen::Dynamic, Eigen::Dynamic > > 
map_dense_matrix_type
 
typedef Eigen::Map
< Eigen::Matrix< double,
Eigen::Dynamic, 1 > > 
map_dense_vector_type
 
typedef boost::tuple
< vectorN_type, vectorN_type > 
solutions_tuple
 
typedef Exporter< mesh_typeexport_type
 
typedef boost::shared_ptr
< export_type
export_ptrtype
 
typedef CRBTrilinear self_type
 
typedef CRBSCM< truth_model_type > scm_type
 scm
 
typedef boost::shared_ptr
< scm_type
scm_ptrtype
 

Public Member Functions

Constructors, destructor
 CRBTrilinear ()
 default constructor
 
 CRBTrilinear (std::string name, po::variables_map const &vm)
 constructor from command line options
 
 CRBTrilinear (std::string name, po::variables_map const &vm, truth_model_ptrtype const &model)
 constructor from command line options
 
 CRBTrilinear (CRBTrilinear const &o)
 copy constructor
 
 ~CRBTrilinear ()
 destructor
 
Methods
void findNearestNeighborInWNmu (parameter_type const &mu, parameter_type &neighbor, int &index) const
 
boost::tuple< double, double > lb (size_type N, parameter_type const &mu, vectorN_type &uN) const
 
convergence_type offline ()
 
void computationalTimeStatistics (std::string)
 
void updateLinearTerms (parameter_type const &mu, int N) const
 
void updateJacobian (const map_dense_vector_type &X, map_dense_matrix_type &J, parameter_type const &mu, int N) const
 
void updateResidual (const map_dense_vector_type &X, map_dense_vector_type &R, parameter_type const &mu, int N) const
 
void displayVector (const map_dense_vector_type &V) const
 
void displayVector (const vectorN_type &V) const
 
void displayMatrix (const matrixN_type &M) const
 
void orthonormalize (size_type N, wn_type &wn, int Nm=1)
 
void checkOrthonormality (int N, const wn_type &wn) const
 
bool printErrorDuringOfflineStep ()
 
CRBErrorType errorType () const
 
scm_ptrtype scm () const
 
sampling_ptrtype wnmu () const
 
bool useWNmu ()
 
wn_type wndu () const
 
void printErrorsDuringRbConstruction (void)
 
element_type expansion (parameter_type const &mu, int N=-1)
 
element_type expansion (vectorN_type const &u, int const N, wn_type const &WN) const
 
void exportBasisFunctions (const export_vector_wn_type &wn) const
 
boost::tuple< double, double,
solutions_tuple, double,
double, double, boost::tuple
< double, double, double > > 
run (parameter_type const &mu, double eps=1e-6, int N=-1)
 
void run (const double *X, unsigned long N, double *Y, unsigned long P)
 
void setTruthModel (truth_model_ptrtype const &model)
 set the truth offline model
 
void setOfflineStep (bool b)
 set boolean indicates if we are in offline_step or not
 
wn_type wn () const
 
bool showMuSelection ()
 
void printMuSelection (void)
 
int dimension () const
 
bool rebuildDB ()
 
void saveDB ()
 
bool loadDB ()
 
WorldComm const & worldComm () const
 
- 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>
int Feel::CRBTrilinear< TruthModelType >::dimension ( ) const
inline
Returns
the dimension of the reduced basis space
template<typename TruthModelType >
CRBTrilinear< TruthModelType >::element_type Feel::CRBTrilinear< TruthModelType >::expansion ( parameter_type const &  mu,
int  N = -1 
)

return the crb expansion at parameter , ie $\sum_{i=0}^N u^N_i \phi_i$ where $, i=1...N$ are the basis function of the reduced basis space if N>0 take the N^th first elements, else take all elements

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

template<typename TruthModelType >
CRBTrilinear< TruthModelType >::element_type Feel::CRBTrilinear< TruthModelType >::expansion ( vectorN_type const &  u,
int const  N,
wn_type const &  WN 
) const

return the crb expansion at parameter , ie $\sum_{i=0}^N u^N_i \phi_i$ where $, i=1...N$ are the basis function of the reduced basis space

template<typename TruthModelType >
void Feel::CRBTrilinear< TruthModelType >::exportBasisFunctions ( const export_vector_wn_type &  wn) const

export basis functions to visualize it

Parameters
wn: tuple composed of a vector of wn_type and a vector of string (used to name basis)

References Feel::CRBDB::name().

template<typename TruthModelType >
void Feel::CRBTrilinear< TruthModelType >::findNearestNeighborInWNmu ( parameter_type const &  mu,
parameter_type neighbor,
int &  index 
) const

find the nearest neighbor of mu in the sampling WNmu return th neighbor and the index of this neighbor in WNmu

template<typename TruthModelType >
boost::tuple< double, double > Feel::CRBTrilinear< TruthModelType >::lb ( size_type  N,
parameter_type const &  mu,
vectorN_type &  uN 
) const

Returns the lower bound of the output

Parameters
mu$ \mu$ the parameter at which to evaluate the output
Nthe size of the reduced basis space to use
uNprimal solution
Returns
compute online the lower bound also condition number of matrix A

References Feel::Backend< T >::build(), Feel::CRBTrilinear< TruthModelType >::findNearestNeighborInWNmu(), Feel::CRBTrilinear< TruthModelType >::updateJacobian(), Feel::CRBTrilinear< TruthModelType >::updateLinearTerms(), Feel::CRBTrilinear< TruthModelType >::updateResidual(), and Feel::CRBDB::vm().

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

load the CRB database

Reimplemented from Feel::CRBDB.

References Feel::CRBDB::lookForDB().

template<typename TruthModelType >
CRBTrilinear< TruthModelType >::convergence_type Feel::CRBTrilinear< TruthModelType >::offline ( )

Offline computation

Returns
the convergence history (max error)

References Feel::CRBTrilinear< TruthModelType >::exportBasisFunctions(), Feel::CRBTrilinear< TruthModelType >::saveDB(), and Feel::CRBDB::vm().

template<typename TruthModelType>
bool Feel::CRBTrilinear< TruthModelType >::printErrorDuringOfflineStep ( )
inline

if true, print the max error (absolute) during the offline stage

References Feel::CRBDB::vm().

template<typename TruthModelType>
void Feel::CRBTrilinear< TruthModelType >::printErrorsDuringRbConstruction ( void  )
inline

print max errors (total error and also primal and dual contributions) during offline stage this function is here only to compile !!!

template<typename TruthModelType >
void Feel::CRBTrilinear< TruthModelType >::printMuSelection ( void  )

print parameters set mu selected during the offline stage

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

save the CRB database

Reimplemented from Feel::CRBDB.

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

template<typename TruthModelType>
scm_ptrtype Feel::CRBTrilinear< TruthModelType >::scm ( ) const
inline
Returns
the scm object (only to compile)
template<typename TruthModelType>
bool Feel::CRBTrilinear< TruthModelType >::showMuSelection ( )
inline

if true, show the mu selected during the offline stage

References Feel::CRBDB::vm().

template<typename TruthModelType >
void Feel::CRBTrilinear< TruthModelType >::updateJacobian ( const map_dense_vector_type &  X,
map_dense_matrix_type &  J,
parameter_type const &  mu,
int  N 
) const

Update the Jacobian Matrix for Newton Solver

References Feel::CRBTrilinear< TruthModelType >::expansion(), and Feel::CRBDB::vm().

template<typename TruthModelType >
void Feel::CRBTrilinear< TruthModelType >::updateLinearTerms ( parameter_type const &  mu,
int  N 
) const
Parameters
mu: parameters
N: dimension of the reduced basis used
template<typename TruthModelType >
void Feel::CRBTrilinear< TruthModelType >::updateResidual ( const map_dense_vector_type &  X,
map_dense_vector_type &  R,
parameter_type const &  mu,
int  N 
) const

Update the Residual of the Newton Solver

References Feel::CRBTrilinear< TruthModelType >::expansion(), Feel::inner_product(), and Feel::CRBDB::vm().


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

Generated on Sun Oct 20 2013 08:25:07 for Feel++ by doxygen 1.8.4