Way to use the erf function with MuParser?

15 views
Skip to first unread message

blais...@gmail.com

unread,
Feb 16, 2022, 10:16:15 PM2/16/22
to deal.II User Group
Dear all,
I hope you are well?
It seems MuParser does not, by default, allow for the use of the error function (erf). We are solving a Stefan problem right now and I'd like to be able to compare the solution to the analytical one to make a unit test out of it. Regrettably, the analytical solution is an ugly beast containing an error function (e.g. erf (x) )
It seems that muparser does not allow for the usage of erf. Would any of you have an idea how i could circumvent this issue? Everything works super well, but i'd like to be able to monitor the convergence and, right now, this is not exactly possibly because of this erf function. 

:)
Best
Bruno

Wolfgang Bangerth

unread,
Feb 16, 2022, 11:33:58 PM2/16/22
to dea...@googlegroups.com
Strangely, we support erfc but not erf. But it should be easy enough to
implement if you're willing to extend deal.II. Take a look here:

https://github.com/dealii/dealii/blob/master/source/base/function_parser.cc#L190-L192

and

https://github.com/dealii/dealii/blob/master/source/base/mu_parser_internal.cc#L114-L118

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

blais...@gmail.com

unread,
Feb 17, 2022, 6:27:33 AM2/17/22
to deal.II User Group
Awesome,
I'll make a PR for it.
Reply all
Reply to author
Forward
0 new messages