Skip to content

Commit 452612b

Browse files
committed
config: enable cmd args for residual tolerances
1 parent 2682ae5 commit 452612b

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

include/pfasst.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
#include "pfasst/interfaces.hpp"
77
#include "pfasst/quadrature.hpp"
88
#include "pfasst/sdc.hpp"
9+
#include "pfasst/encap/encap_sweeper.hpp"
910

1011
namespace pfasst
1112
{
1213
inline static void init(int argc, char** argv)
1314
{
1415
SDC<>::enable_config_options(0);
16+
encap::EncapSweeper<>::enable_config_options(0);
1517
Quadrature::enable_config_options(0);
1618
config::init_config();
1719
log::start_log(argc, argv);

include/pfasst/encap/encap_sweeper.hpp

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77

88
#include <algorithm>
99
#include <cstdlib>
10-
#include <vector>
1110
#include <memory>
11+
#include <vector>
12+
using namespace std;
1213

1314
#include "../globals.hpp"
15+
#include "../config.hpp"
1416
#include "../interfaces.hpp"
1517
#include "../quadrature.hpp"
1618
#include "encapsulation.hpp"
@@ -25,6 +27,15 @@ namespace pfasst
2527
class EncapSweeper
2628
: public ISweeper<time>
2729
{
30+
private:
31+
static void init_config_options(po::options_description& opts)
32+
{
33+
opts.add_options()
34+
("abs_res_tol", po::value<time>(), "absolute residual tolerance")
35+
("rel_res_tol", po::value<time>(), "relative residual tolerance")
36+
;
37+
}
38+
2839
protected:
2940
//! @{
3041
shared_ptr<IQuadrature<time>> quadrature;
@@ -289,6 +300,16 @@ namespace pfasst
289300
this->start_state->broadcast(comm);
290301
}
291302
//! @}
303+
304+
//! @{
305+
static void enable_config_options(size_t index = -1)
306+
{
307+
pfasst::config::Options::get_instance()
308+
.register_init_function("Encapsulation Sweeper",
309+
std::function<void(po::options_description&)>(init_config_options),
310+
index);
311+
}
312+
//! @}
292313
};
293314

294315

0 commit comments

Comments
 (0)