From: Bruno Blais Date: Sun, 20 Feb 2022 17:46:05 +0000 (-0500) Subject: Add erf to muparser X-Git-Tag: v9.4.0-rc1~459^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a010da4c6442423771e8d2eca54fc9be0dd1426;p=dealii.git Add erf to muparser --- 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"};