libCEED
libCEED copied to clipboard
fluids: Refactor boundary condition handling
Currently in progress, but open to feedback. Currently, only the wall and symmetry BCs are converted over to the new BCDefinition format. Still deciding exactly how I want to handle the boundary integrals and Ceed-based essential BCs.
TODOs:
- [ ] Make a unified essential BC mask and values vector (for handling time-varying and initial-condition based essential BCs)
- [x] Add in a setup function for creating IFunction and IJacobian definitions
- [ ] Figure out integration with strong Ceed-based BCs
Addresses the backend parts of #1090
The code is now in a state of a working minimal example, so I'm hoping to get some feedback. To give a brief tour:
- Define a
BCDefinitionstruct- It's primary purpose is to:
- A) define all the backend information necessary to create the BC (face labels, essential components, DM field, etc.)
- B) store intermediary data related to the BC as it passes between steps (qfunction information predominately)
- Define
BCTypeenum to act as a marker for what various setup procedures need to be done for it- This was cleaner than trying to add in function pointers to do those setup procedures at an early stage IMO.
There are 4 primary steps.
- Read general bc info and write to an array of
BCDefinitionstructs. Code link - Set essential boundary conditions from the
BCDefinition. Code link - Run any extra setup functions needed for the BC, as determined by it's
BCType. Here's the generic function which calls more specific functions based on theBCType. - Create
CeedOperators for the IFunction and IJacobian based on the QFunction information defined in step 3. Code link
Limitations of the current implementation:
- The essential BCs are currently limited to constant-in-time values. Not sure how to go about doing time-varying values, but haven't put too much thought into it yet.
- The freestream is the only natural BC currently implemented. Not sure how I want to handle the problem-specific inflow/outflow BCs yet.
Tagging @jeremylt and @zatkins-dev since y'all were involved the Ratel BC refactor discussion awhile ago.
I've created https://github.com/CEED/libCEED/pull/1600 to try and break up this refactoring into multiple stages.
This first stage in #1600 adds in the BCDefinition struct and the time-independent essential BCs.