You could use symbolic functions (based on symengine) and optimize the function with LLVM (you have to have symengine installed with LLVM optimizer). 

Luca

Il giorno 20 nov 2025, alle ore 11:45, Abbas Ballout <[email protected]> ha scritto:

Hi all, 

I want to have the flexibility of Functions::Parsed<dim>, i.e., allowing the user to pass a string _expression_ for a function at runtime, but with the performance of Functions<dim>.

I understand that Functions::Parsed is slow because a) muParser overhead and string parsing b) neither I nor the compiler can make optimisations at compile time.
I have complicated time dependent vector valued expressions that are slowing the overall assembly at boundaries by a factor of 2x. Even for simple expressions, error calculations between an exact Functions::Parsed and a numerical solution can be 6x slower than if I were to use a Functions<dim> but that doesn't take a big chunk of the code runtime anyway so it's okay.  

Wondering if there is something else in the library or if there is a workaround to this? Was thinking about caching the Functions::Parsed values in a table maybe? 

thanks and best, 
Abbas

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/dealii/b39f8227-dd5b-4b13-b366-188988dfe983n%40googlegroups.com.

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/dealii/1027187C-46EF-4795-A8BC-4248AFB62885%40gmail.com.

Reply via email to