#include <crb_trilinear.hpp>
Certifed Reduced Basis for Trilinear forms class.
Implements the certified reduced basis method for treat trilinear forms
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_type > | wn_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_type > | export_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 |
![]() | |
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 | |
CRBDB & | operator= (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 | |
![]() | |
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) |
|
inline |
CRBTrilinear< TruthModelType >::element_type Feel::CRBTrilinear< TruthModelType >::expansion | ( | parameter_type const & | mu, |
int | N = -1 |
||
) |
return the crb expansion at parameter , ie
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().
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
where $, i=1...N$ are the basis function of the reduced basis space
void Feel::CRBTrilinear< TruthModelType >::exportBasisFunctions | ( | const export_vector_wn_type & | wn) | const |
export basis functions to visualize it
wn | : tuple composed of a vector of wn_type and a vector of string (used to name basis) |
References Feel::CRBDB::name().
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
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
mu | ![]() |
N | the size of the reduced basis space to use |
uN | primal solution |
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().
|
virtual |
CRBTrilinear< TruthModelType >::convergence_type Feel::CRBTrilinear< TruthModelType >::offline | ( | ) |
Offline computation
References Feel::CRBTrilinear< TruthModelType >::exportBasisFunctions(), Feel::CRBTrilinear< TruthModelType >::saveDB(), and Feel::CRBDB::vm().
|
inline |
if true, print the max error (absolute) during the offline stage
References Feel::CRBDB::vm().
|
inline |
print max errors (total error and also primal and dual contributions) during offline stage this function is here only to compile !!!
void Feel::CRBTrilinear< TruthModelType >::printMuSelection | ( | void | ) |
print parameters set mu selected during the offline stage
|
virtual |
save the CRB database
Reimplemented from Feel::CRBDB.
References Feel::CRBDB::dbFilename(), and Feel::CRBDB::dbLocalPath().
|
inline |
|
inline |
if true, show the mu selected during the offline stage
References Feel::CRBDB::vm().
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().
void Feel::CRBTrilinear< TruthModelType >::updateLinearTerms | ( | parameter_type const & | mu, |
int | N | ||
) | const |
mu | : parameters |
N | : dimension of the reduced basis used |
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().