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::EIM< ModelType > Class Template Reference

#include <eim.hpp>

Detailed Description

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

Empirical interpolation of a function to obtain an affine decomposition.

We are given a function $g (\: \cdot\: ; \mu) \in L^{\infty} (\Omega)$ of sufficient regularity.

Offline Stage

To begin, we choose $\mu^g_1$, and define $S^g_1 = \{ \mu^g_1 \}$, $\xi_1 \equiv g (x ; \mu^g_1)$, and $W^g_1 = {\rm span} \: \{\xi_1 \}$; we assume that $\xi_1 \neq 0$. Then, for $M \geq 2$, we set $\mu^g_M = \arg \max_{\mu \in \Xi^{^g}}\inf _{z \in W^g_{M-1}} \|g (\: \cdot \: ; \mu) - z \|_{L^{\infty} (\Omega)}$, where $\Xi^g$ is a suitably fine parameter sample over ${\mathcal{D}}$. We then set $S^g_M = S^g_{M-1} \cup \mu^g_M$, $\xi_M = g (x;\mu^g_M)$, and $W^g_M = {\rm span} \: \{ \xi_m, \: 1 \leq m \leq M \}$. Note that, thanks to our truth approximation, $\mu^g_M$ is the solution of a standard linear program.

We suppose that $M_{\max}$ is chosen such that the dimension of $\{g (\: \cdot \: ; \mu) \: | \: \mu \in \mathcal{D}\} $ exceeds $M_{\max}$.

We now construct nested sets of interpolation points $T_M = \{ t_1, \ldots, t_M \}$, $1 \leq M \leq M_{\max}$. We first set $t_1 = \arg \: {\rm ess} \: \sup_{x \in \Omega} | \xi_1 (x)|$, $q_1 = \xi_1 (x) / \xi_1 (t_1) $, $B^1_{11} = 1$. Then for $M = 2, \ldots, M_{\max}$, we solve the linear system $ \sum^{M-1}_{j = 1} \: \sigma^{M-1}_j \: q_j(t_i) = \xi_M (t_i)$, $ 1 \leq i \leq M-1$, and set $r_M (x) = \xi_M (x) - \sum^{M-1}_{j = 1}\: \sigma^{M-1}_j \: q_j (x)$, $t_M = \arg \: {\rm ess} \: \sup_{x \in \Omega} |r_M (x)|$, $q_M (x) = r_M (x) /r_M (t_M) $, and $B^M_{i \: j} = q_j (t_i)$, $1 \leq i,j \leq M$.

Online Stage

Our coefficient function approximation is the interpolant of $g$ over $T_M$ : $g_M (x ; \mu) = \sum^M_{m = 1} \beta_m (\mu) \: q_m (x)$, where $\sum^M_{j = 1} \: B^M_{i \: j} \: \beta_j (\mu) = g (t_i ; \mu)$, $ 1 \leq i \leq M$. We define $\varepsilon_M (\mu) \equiv \| g (\: \cdot \: ; \mu) - g_M (\: \cdot \: ; \mu)\|_{L^{\infty} (\Omega)}$.

Author
Christophe Prud'homme chris.nosp@m.toph.nosp@m.e.pru.nosp@m.dhom.nosp@m.me@fe.nosp@m.elpp.nosp@m..org
See Also
+ Inheritance diagram for Feel::EIM< ModelType >:

Public Types

Typedefs
typedef ModelType model_type
 
typedef ModelType::value_type value_type
 
typedef Eigen::Matrix< double,
Eigen::Dynamic, Eigen::Dynamic > 
matrix_type
 
typedef matrix_type::ColXpr column_type
 
typedef Eigen::Matrix< double,
Eigen::Dynamic, 1 > 
vector_type
 
typedef ModelType::node_type node_type
 
typedef
ModelType::functionspace_type 
functionspace_type
 
typedef boost::shared_ptr
< functionspace_type > 
functionspace_ptrtype
 
typedef
functionspace_type::element_type 
element_type
 
typedef
functionspace_type::element_ptrtype 
element_ptrtype
 
typedef ModelType::solution_type solution_type
 
typedef
ModelType::parameterspace_type 
parameterspace_type
 
typedef ModelType::parameter_type parameter_type
 
typedef
parameterspace_type::sampling_ptrtype 
sampling_ptrtype
 
typedef boost::tuple< double,
Eigen::Matrix< double, nDim, 1 > > 
space_residual_type
 
typedef boost::tuple< double,
parameter_type > 
parameter_residual_type
 

Public Member Functions

Constructors, destructor
 EIM ()
 
 EIM (po::variables_map const &vm, model_type *model, sampling_ptrtype sampling, double __tol=1e-8)
 
 EIM (EIM const &__bbf)
 
 ~EIM ()
 
Accessors
size_type nDOF () const
 
std::vector< element_type > const & q () const
 
element_type const & q (size_type __m) const
 
size_type mMax () const
 
bool isOfflineDone () const
 
Mutators
void setTrainSet (sampling_ptrtype pset)
 
- 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
 

Static Public Attributes

static const uint16_type nDim = ModelType::nDim
 

Protected Attributes

matrix_type M_B
 
std::vector< element_type > M_g
 
std::vector< size_typeM_index_max
 
bool M_is_read
 
bool M_is_written
 
size_type M_M
 
model_type * M_model
 
std::string M_name
 
bool M_offline_done
 
std::vector< element_type > M_q
 
std::vector< node_type > M_t
 
double M_tol
 
sampling_ptrtype M_trainset
 
po::variables_map M_vm
 
size_type M_WN
 
size_type MM_max
 

Methods

class boost::serialization::access
 
void saveDB ()
 
bool loadDB ()
 
vector_type beta (parameter_type const &mu) const
 Online stage of the coefficient-function interpolation. More...
 
vector_type beta (parameter_type const &mu, solution_type const &T) const
 
vector_type beta (parameter_type const &mu, size_type M) const
 
vector_type beta (parameter_type const &mu, solution_type const &T, size_type M) const
 
std::vector< double > studyConvergence (parameter_type const &mu, solution_type &solution) const
 
void computationalTimeStatistics (std::string appname)
 
element_type residual (size_type M) const
 
parameter_residual_type computeBestFit (sampling_ptrtype trainset, int __M)
 
element_type operator() (parameter_type const &mu, int N) const
 
element_type operator() (parameter_type const &mu, solution_type const &T, int N) const
 
void orthonormalize (std::vector< element_type > &)
 
template<class Archive >
void serialize (Archive &__ar, const unsigned int __version)
 

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 ModelType>
vector_type Feel::EIM< ModelType >::beta ( parameter_type const &  mu) const
inline

Online stage of the coefficient-function interpolation.

Our coefficient function approximation is the interpolant of $g$ over $T_M$ : $g_M (x ; \mu) = \sum^M_{m = 1} \beta_m (\mu) \: q_m (x)$, where $\sum^M_{j = 1} \: B^M_{i \: j} \: \beta_j (\mu) = g (t_i ; \mu)$, $ 1 \leq i \leq M$. We define $\varepsilon_M (\mu) \equiv \| g (\: \cdot \: ; \mu) - g_M (\: \cdot \: ; \mu)\|_{L^{\infty} (\Omega)}$.

Note that $ \Omega $ is given and $D^$ is handled by the parameterset_type data structure.

References Feel::EIM< ModelType >::beta().

template<typename ModelType>
bool Feel::EIM< ModelType >::isOfflineDone ( ) const
inline

Check whether the offline stage has been executed and the database created.

Returns
true if the offline has been executed and the DB saved, false otherwise
template<typename ModelType>
bool Feel::EIM< ModelType >::loadDB ( )
inlinevirtual

load the CRB database

Reimplemented from Feel::CRBDB.

References Feel::CRBDB::lookForDB().

template<typename ModelType>
size_type Feel::EIM< ModelType >::nDOF ( ) const
inline
Returns
the number of DOF in space discretization
template<typename ModelType >
void Feel::EIM< ModelType >::orthonormalize ( std::vector< element_type > &  __Z)

orthonormalize

References Feel::inner_product().

template<typename ModelType>
std::vector<element_type> const& Feel::EIM< ModelType >::q ( ) const
inline

return the set of reduced basis functions associated with the eim

template<typename ModelType>
element_type const& Feel::EIM< ModelType >::q ( size_type  __m) const
inline

return the m-th reduced basis function associated with the eim

template<typename ModelType>
void Feel::EIM< ModelType >::saveDB ( )
inlinevirtual

save the CRB database

Reimplemented from Feel::CRBDB.

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


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