25 namespace advection_diffusion
38 auto const nnodes = config::get_value<size_t>(
"num_nodes", 3);
39 auto const ndofs = config::get_value<size_t>(
"spatial_dofs", 64);
40 auto const quad_type = \
44 auto factory = make_shared<encap::VectorFactory<double>>(ndofs);
45 auto sweeper = make_shared<AdvectionDiffusionSweeper<>>(ndofs);
47 sweeper->set_quadrature(quad);
48 sweeper->set_factory(factory);
49 sweeper->set_residual_tolerances(abs_residual_tol, rel_residual_tol);
56 auto q0 = sweeper->get_start_state();
57 sweeper->exact(q0, 0.0);
61 return sweeper->get_errors();
68 #ifndef PFASST_UNIT_TESTING
69 int main(
int argc,
char** argv)
virtual void run()
Run vanilla SDC.
virtual void set_options(bool all_sweepers=true)
Set options from command line etc.
map< tuple< size_t, size_t >, double > error_map
virtual void add_level(shared_ptr< ISweeper< time >> sweeper, shared_ptr< ITransfer< time >> transfer=shared_ptr< ITransfer< time >>(nullptr), bool coarse=true)
Adding a level to the controller.
error_map run_vanilla_sdc(double abs_residual_tol, double rel_residual_tol=0.0)
Advection/diffusion example using an encapsulated IMEX sweeper.
static void init(int argc, char **argv, std::function< void()> opts=nullptr, std::function< void()> logs=nullptr)
virtual void set_duration(time t0, time tend, time dt, size_t niters)
Set basic time scope of the Controller.
shared_ptr< IQuadrature< precision > > quadrature_factory(const size_t nnodes, const QuadratureType qtype)
Instantiates quadrature handler for given number of nodes and type descriptor.
int main(int argc, char **argv)
Gauss-Legendre quadrature
advection-diffusion sweeper with semi-implicit time-integration.
virtual void setup()
Basic setup routine for this controller.