]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add erf to muparser 13425/head
authorBruno Blais <blais.bruno@gmail.com>
Sun, 20 Feb 2022 17:46:05 +0000 (12:46 -0500)
committerBruno Blais <blais.bruno@gmail.com>
Sun, 20 Feb 2022 17:46:05 +0000 (12:46 -0500)
include/deal.II/base/mu_parser_internal.h
source/base/function_parser.cc
source/base/mu_parser_internal.cc

index 00e6d95f019d80bb79e47dc8ea42c36de40eab5a..d068ccd895c37862854b5e779b6ff473d0745242 100644 (file)
@@ -71,6 +71,9 @@ namespace internal
     double
     mu_pow(double a, double b);
 
+    double
+    mu_erf(double value);
+
     double
     mu_erfc(double value);
 
index 3174d79cf15b9b24c184a5c89a878d6c8aadfc8b..75505758ca88161c2a06ce197269bc9759a87abf 100644 (file)
@@ -187,6 +187,9 @@ FunctionParser<dim>::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);
index 44ce4621cbd879a478ed915853a8ae6e3d65f028..9a925af2e9b2455989ac1666cbd2b99e1c4bd25b 100644 (file)
@@ -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"};

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.