Skip to content

Commit

Permalink
Merge pull request #13425 from lethe-cfd/add_erf_mu_parser
Browse files Browse the repository at this point in the history
Add erf function to deal.II muparser functions
  • Loading branch information
marcfehling committed Feb 21, 2022
2 parents 790dc5d + 5a010da commit e57f860
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/deal.II/base/mu_parser_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ namespace internal
double
mu_pow(double a, double b);

double
mu_erf(double value);

double
mu_erfc(double value);

Expand Down
3 changes: 3 additions & 0 deletions source/base/function_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions source/base/mu_parser_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -186,6 +192,7 @@ namespace internal
"floor",
"sec",
"pow",
"erf",
"erfc",
"rand",
"rand_seed"};
Expand Down

0 comments on commit e57f860

Please sign in to comment.