32 #include <boost/property_tree/ptree.hpp>
33 #include <boost/property_tree/xml_parser.hpp>
35 #include <feel/feelcore/feel.hpp>
42 namespace ptree = boost::property_tree;
113 virtual std::string
name()
const
125 po::variables_map
const&
vm()
const
144 return M_meshSizeInit;
197 virtual void run() = 0;
202 virtual void run(
const double* X,
unsigned long P,
double* Y,
unsigned long N ) {
run(); };
207 void print( std::ostream& out, std::vector<ptree::ptree> &
stats );
222 double M_meshSizeInit;
224 ptree::ptree M_stats;
226 mpi::communicator M_comm;
227 po::variables_map M_vm;
240 template<
typename SimgetType>
244 return new SimgetType( about );
247 #define REGISTER_SIMGET_IN_FACTORY( simget, simgetname, about ) \
248 SimgetFactory::instance().registerProduct( simgetname, &createSimget<simget>( about )
250 #if defined( FEELPP_HAS_OCT_H )
251 #define OCTNAME(name,dim, order) BOOST_PP_CAT(BOOST_PP_CAT(BOOST_PP_CAT(name,dim),_),order)
253 #define REGISTER_SIMGET( dim, order ) \
254 DEFUN_DLD (OCTNAME(residualestimator_,dim,order), args, nargout, "Residual Estimator for the Laplacian") \
256 int nargin = args.length (); \
261 NDArray A = args(0).array_value (); \
262 dim_vector dims = A.dims(); \
263 dim_vector ydims(1); \
268 static bool is_init = false; \
271 if (!Feel::Environment::initialized() ) \
272 new Feel::Environment(); \
275 boost::shared_ptr<ResidualEstimator<dim,order> > OCTNAME(app_,dim,order)( new ResidualEstimator<dim,order>( makeAbout() ) ); \
276 std::vector<double> x( dims(0) ); \
277 for( int j = 0; j < dims(0); ++j ) \
280 std::cout << "x["<< j << "]=" << x[j] << "\n"; \
282 std::vector<double> y( 4 ); \
283 OCTNAME(app_,dim,order)->run( x.data(), dims(1), y.data(), 4 ); \
290 return octave_value (Y); \
292 return octave_value_list (); \