From 5a010da4c6442423771e8d2eca54fc9be0dd1426 Mon Sep 17 00:00:00 2001 From: Bruno Blais Date: Sun, 20 Feb 2022 12:46:05 -0500 Subject: [PATCH] Add erf to muparser --- include/deal.II/base/mu_parser_internal.h | 3 +++ source/base/function_parser.cc | 3 +++ source/base/mu_parser_internal.cc | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/include/deal.II/base/mu_parser_internal.h b/include/deal.II/base/mu_parser_internal.h index 00e6d95f01..d068ccd895 100644 --- a/include/deal.II/base/mu_parser_internal.h +++ b/include/deal.II/base/mu_parser_internal.h @@ -71,6 +71,9 @@ namespace internal double mu_pow(double a, double b); + double + mu_erf(double value); + double mu_erfc(double value); diff --git a/source/base/function_parser.cc b/source/base/function_parser.cc index 3174d79cf1..75505758ca 100644 --- a/source/base/function_parser.cc +++ b/source/base/function_parser.cc @@ -187,6 +187,9 @@ FunctionParser::init_muparser() const fp.get()[component]->DefineFun("pow", internal::FunctionParser::mu_pow, true); + fp.get()[component]->DefineFun("erf", + internal::FunctionParser::mu_erf, + true); fp.get()[component]->DefineFun("erfc", internal::FunctionParser::mu_erfc, true); diff --git a/source/base/mu_parser_internal.cc b/source/base/mu_parser_internal.cc index 44ce4621cb..9a925af2e9 100644 --- a/source/base/mu_parser_internal.cc +++ b/source/base/mu_parser_internal.cc @@ -111,6 +111,12 @@ namespace internal return std::pow(a, b); } + double + mu_erf(double value) + { + return std::erf(value); + } + double mu_erfc(double value) { @@ -186,6 +192,7 @@ namespace internal "floor", "sec", "pow", + "erf", "erfc", "rand", "rand_seed"}; -- 2.39.5