Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a custom parsed function #1143

Merged
merged 16 commits into from
May 22, 2024
Merged

Adding a custom parsed function #1143

merged 16 commits into from
May 22, 2024

Conversation

oguevremont
Copy link
Collaborator

@oguevremont oguevremont commented May 15, 2024

Description of the problem

  • In the idea of adding a reactive physics, a way to parse functions based on any variables needed to be added. For example, when a species A reacts at a rate of -dA/dt = k*A, the source term for A depends on A itself.
  • Parsed functions in deal.II didn't allow to parse functions unless they depended only on x,y,z,t.

Description of the solution

  • A new custom class based on the deal.II implementation of parsed functions (using muParser) is added to Lethe.
  • This class has the template parameter n_component. It requires that classes are instantiated with n_component expressions as well.
  • Physics that will use this class will have the responsibility of interfacing between their variables of interest and the class ParsedFunctionCustom itself.
  • When a different number of variables/expressions will be needed by a solver, this solver will have the responsibility of introducing dummy variables or expressions. This solution might change if required.

How Has This Been Tested?

  • [core/custom_parsed_functions] Unit test of value and gradient functions.

Documentation

  • Not at the moment, except for doxygen.

Future changes

  • A reactive auxiliary physics will be implemented using this class.

@oguevremont oguevremont force-pushed the reactive_auxiliary_physics branch 2 times, most recently from a94e69f to 0903ca2 Compare May 16, 2024 17:28
@oguevremont oguevremont marked this pull request as ready for review May 16, 2024 18:00
@oguevremont oguevremont requested review from mivaia and hepap May 16, 2024 18:16
@oguevremont oguevremont force-pushed the reactive_auxiliary_physics branch from 87d32f8 to e9a5bff Compare May 17, 2024 18:15
Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1-2 comments that's all. Cool work man

include/core/mu_parser_internal.h Outdated Show resolved Hide resolved
include/core/mu_parser_internal.h Outdated Show resolved Hide resolved
@oguevremont oguevremont force-pushed the reactive_auxiliary_physics branch from 48a35de to c4534a7 Compare May 21, 2024 15:51
@oguevremont oguevremont force-pushed the reactive_auxiliary_physics branch from c4534a7 to c2df53b Compare May 22, 2024 00:29
Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with it. Can you get @mivaia and @hepap 's review and then I can merge

@blaisb blaisb added the Needs more reviewers This pull request needs more review before a merge is possible label May 22, 2024
Copy link
Collaborator

@lpsaavedra lpsaavedra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Excited about the reactive physics module in Lethe coming soon. I have only a few remarks regarding documentation

include/core/mu_parser_internal.h Show resolved Hide resolved
include/core/mu_parser_internal.h Outdated Show resolved Hide resolved
include/core/parsed_function_custom.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@hepap hepap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only few suggestion for comments :)

include/core/parsed_function_custom.h Show resolved Hide resolved
include/core/mu_parser_internal.h Outdated Show resolved Hide resolved
include/core/parsed_function_custom.h Outdated Show resolved Hide resolved
source/core/mu_parser_internal.cc Outdated Show resolved Hide resolved
source/core/mu_parser_internal.cc Outdated Show resolved Hide resolved
source/core/mu_parser_internal.cc Outdated Show resolved Hide resolved
source/core/mu_parser_internal.cc Outdated Show resolved Hide resolved
source/core/mu_parser_internal.cc Outdated Show resolved Hide resolved
source/core/parsed_function_custom.cc Outdated Show resolved Hide resolved
tests/core/custom_parsed_functions.cc Outdated Show resolved Hide resolved
@oguevremont oguevremont removed the Needs more reviewers This pull request needs more review before a merge is possible label May 22, 2024
@blaisb blaisb merged commit 8b0aab5 into master May 22, 2024
8 checks passed
@blaisb blaisb deleted the reactive_auxiliary_physics branch May 22, 2024 19:22
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
Description of the problem
In the idea of adding a reactive physics, a way to parse functions based on any variables needed to be added. For example, when a species A reacts at a rate of -dA/dt = k*A, the source term for A depends on A itself.
Parsed functions in deal.II didn't allow to parse functions unless they depended only on x,y,z,t.
Description of the solution
A new custom class based on the deal.II implementation of parsed functions (using muParser) is added to Lethe.
This class has the template parameter n_component. It requires that classes are instantiated with n_component expressions as well.
Physics that will use this class will have the responsibility of interfacing between their variables of interest and the class ParsedFunctionCustom itself.
When a different number of variables/expressions will be needed by a solver, this solver will have the responsibility of introducing dummy variables or expressions. This solution might change if required.
How Has This Been Tested?
[core/custom_parsed_functions] Unit test of value and gradient functions.
Documentation
Not at the moment, except for doxygen.
Future changes
A reactive auxiliary physics will be implemented using this class.

Co-authored-by: Bruno Blais <[email protected]>
Co-authored-by: hepap <[email protected]>
Former-commit-id: 8b0aab5
blaisb added a commit that referenced this pull request Sep 30, 2024
Description of the problem
In the idea of adding a reactive physics, a way to parse functions based on any variables needed to be added. For example, when a species A reacts at a rate of -dA/dt = k*A, the source term for A depends on A itself.
Parsed functions in deal.II didn't allow to parse functions unless they depended only on x,y,z,t.
Description of the solution
A new custom class based on the deal.II implementation of parsed functions (using muParser) is added to Lethe.
This class has the template parameter n_component. It requires that classes are instantiated with n_component expressions as well.
Physics that will use this class will have the responsibility of interfacing between their variables of interest and the class ParsedFunctionCustom itself.
When a different number of variables/expressions will be needed by a solver, this solver will have the responsibility of introducing dummy variables or expressions. This solution might change if required.
How Has This Been Tested?
[core/custom_parsed_functions] Unit test of value and gradient functions.
Documentation
Not at the moment, except for doxygen.
Future changes
A reactive auxiliary physics will be implemented using this class.

Co-authored-by: Bruno Blais <[email protected]>
Co-authored-by: hepap <[email protected]>
Former-commit-id: 8b0aab5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants