32 #include <feel/feelcore/feel.hpp>
44 std::string _o( std::string
const& prefix, std::string
const& opt )
46 std::string o = prefix;
59 template<
typename ModelType>
66 typedef boost::shared_ptr<crbmodel_type> crbmodel_ptrtype;
76 PFemApp(
int argc,
char** argv,
AboutData const& ad, po::options_description
const& od )
84 std::srand( static_cast<unsigned>( std::time( 0 ) ) );
87 % this->
about().appName()
88 % this->
vm()[
"hsize"].
template as<double>()
90 std::cout <<
"[PFemApp] build model " << this->
about().
appName() <<
"\n";
93 std::cout <<
"build model " << this->
about().
appName() <<
" done\n";
97 if ( this->
vm().count(
"help" ) )
103 typename crbmodel_type::parameter_type mu( model->parameterSpace() );
104 int mutype = this->
vm()[_o( this->
about().appName(),
"mu-type" )].template as<int>();
108 bool broadcast =
true;
109 mu = crbmodel_type::parameterspace_type::logRandom( model->parameterSpace(), broadcast );
112 else if ( mutype == 1 )
114 mu = model->parameterSpace()->min();
117 else if ( mutype == 2 )
120 mu = model->parameterSpace()->max();
125 mu = model->parameterSpace()->max();
128 std::cout <<
"[PFemApp] running " << this->
about().
appName() <<
" with mu = [";
129 int size = mu.size();
131 for (
int i=0; i<size-1; i++ ) std::cout<<mu( i )<<
" , ";
133 std::cout<< mu( size-1 )<<
"] "<<std::endl;
137 auto Xh = model->functionSpace();
138 auto u = Xh->element();
139 bool need_to_solve=
true;
141 for (
int l =0; l < model->Nl(); ++l )
143 double o = model->output( l,mu , u , need_to_solve );
144 std::cout <<
"[PFemApp] output " << l <<
" of " << this->
about().
appName() <<
" = " << o <<
"\n";
148 void run(
const double * X,
unsigned long N,
149 double * Y,
unsigned long P )
152 model->run( X, N, Y, P );
156 crbmodel_ptrtype model;
provides information about the Application
Definition: application.hpp:71
po::options_description pfemapp_options(std::string const &prefix)
Definition: pfemapp.cpp:33
void setLogs()
Definition: application.cpp:687
void add(Simget *simget)
Definition: application.cpp:877
Application & changeRepository(boost::format)
Definition: application.cpp:818
Holds information needed by the "About" box and other classes.
Definition: about.hpp:173
Certified Reduced Basis Model class.
Definition: crbmodel.hpp:73
po::options_description const & optionsDescription() const
Definition: application.hpp:175
po::variables_map const & vm() const
Definition: application.hpp:186
void run()
Definition: pfemapp.hpp:95
void run(const double *X, unsigned long N, double *Y, unsigned long P)
Definition: pfemapp.hpp:148
Parametrized Finite Element Method Application.
Definition: pfemapp.hpp:60
AboutData const & about() const
Definition: application.hpp:198
std::string appName() const
Definition: about.cpp:225