]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add erfc function to FunctionParser.
authorJonathan Perry-Houts <jperryh2@uoregon.edu>
Tue, 20 Oct 2015 22:46:50 +0000 (15:46 -0700)
committerJonathan Perry-Houts <jperryh2@uoregon.edu>
Mon, 2 Nov 2015 21:15:16 +0000 (13:15 -0800)
source/base/function_parser.cc

index 25ffd17e81dcd263f06aae9c0b177a02bdd6bdcc..badd034b013c147cea97f14d7f51b852ac989338 100644 (file)
@@ -17,6 +17,7 @@
 #include <deal.II/base/function_parser.h>
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/vector.h>
+#include <cmath>
 
 
 #ifdef DEAL_II_WITH_MUPARSER
@@ -170,6 +171,11 @@ namespace internal
   {
     return std::pow(a, b);
   }
+
+  double mu_erfc(double value)
+  {
+    return erfc(value);
+  }
 }
 
 
@@ -208,6 +214,7 @@ void FunctionParser<dim>:: init_muparser() const
       fp.get()[component].DefineFun("sec", internal::mu_sec, true);
       fp.get()[component].DefineFun("log", internal::mu_log, true);
       fp.get()[component].DefineFun("pow", internal::mu_pow, true);
+      fp.get()[component].DefineFun("erfc", internal::mu_erfc, true);
 
       try
         {
@@ -257,7 +264,8 @@ void FunctionParser<dim>:: init_muparser() const
             "csc",
             "floor",
             "sec",
-            "pow"
+            "pow",
+            "erfc"
           };
           for (unsigned int f=0; f<sizeof(function_names)/sizeof(function_names[0]); ++f)
             {

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.