Skip to content

Commit f710efd

Browse files
committed
config: fix a small issue with cmd args
removed non-working dead code
1 parent 264cda3 commit f710efd

File tree

2 files changed

+5
-41
lines changed

2 files changed

+5
-41
lines changed

include/pfasst/config.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ namespace pfasst
9696

9797
options::add_option<double>("Duration", "dt", "time step size");
9898
options::add_option<double>("Duration", "tend", "final time of simulation");
99-
options::add_option<size_t>("Duration", "num_iters", "number of iterations");
99+
options::add_option<size_t>("Duration", "num_iter", "number of iterations");
100+
101+
options::add_option<size_t>("Quadrature", "num_nodes", "number of quadrature nodes");
100102

101103
options::add_option<double>("Tolerances", "abs_res_tol", "absolute residual tolerance");
102104
options::add_option<double>("Tolerances", "rel_res_tol", "relative residual tolerance");

include/pfasst/quadrature.hpp

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
#include <cmath>
55
#include <exception>
6+
#include <string>
67
#include <type_traits>
78
#include <vector>
9+
using namespace std;
810

911
#include <Eigen/Dense>
1012
#include <boost/math/constants/constants.hpp>
@@ -22,7 +24,6 @@
2224
template<typename scalar>
2325
using Matrix = Eigen::Matrix<scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
2426

25-
using namespace std;
2627

2728
namespace pfasst
2829
{
@@ -86,45 +87,6 @@ namespace pfasst
8687
}
8788

8889
} // ::pfasst::quadrature
89-
90-
namespace config
91-
{
92-
// note: GCC fails with "error: explicit template specialization cannot have a storage class"
93-
// if this template specialization is also declared 'static'; Clang does not care.
94-
template<>
95-
inline quadrature::QuadratureType get_value(const string& name)
96-
{
97-
const string type = options::get_instance().get_variables_map()[name].as<string>();
98-
if (type == "gauss-lobatto") {
99-
return quadrature::QuadratureType::GaussLobatto;
100-
} else if (type == "gauss-legendre") {
101-
return quadrature::QuadratureType::GaussLegendre;
102-
} else if (type == "gauss-radau") {
103-
return quadrature::QuadratureType::GaussRadau;
104-
} else if (type == "clenshaw-curtis") {
105-
return quadrature::QuadratureType::ClenshawCurtis;
106-
} else if (type == "uniform") {
107-
return quadrature::QuadratureType::Uniform;
108-
} else {
109-
throw invalid_argument("Quadrature type '" + type + "' not known.");
110-
}
111-
}
112-
113-
// note: GCC fails with "error: explicit template specialization cannot have a storage class"
114-
// if this template specialization is also declared 'static'; Clang does not care.
115-
template<>
116-
inline quadrature::QuadratureType get_value(const string& name,
117-
const quadrature::QuadratureType& default_value)
118-
{
119-
if (options::get_instance().get_variables_map().count(name) == 1) {
120-
return get_value<quadrature::QuadratureType>(name);
121-
} else {
122-
return default_value;
123-
}
124-
}
125-
126-
} // ::pfasst::config
127-
12890
} // ::pfasst
12991

13092
#endif // _PFASST__QUADRATURE_HPP_

0 commit comments

Comments
 (0)