-
Notifications
You must be signed in to change notification settings - Fork 0
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
Rework TDycore with polymorphic "ops" tables #197
Comments
Looking through the code, it seems like we're making use of these "operations" only for material properties, forcings, and boundary conditions. Here are some other areas that might deserve their own
The |
Here's an approach that is used in C-based "polymorphic" software libraries that takes advantage of our functional decomposition, and can help prevent people from selecting unsupported or nonsensical combinations of options. What if we replace
Then we could expose specific functions for creating supported configurations, such as
and so on. The ops table could then be expanded to handle stuff like solves, which could be exposed via appropriate The advantage of this approach is that we wouldn't have to change the library's interface much if we wanted to add another configuration--we'd just add another one of these functions for creating the configuration. We could also take advantage of the specificity of a supported configuration to support specific command-line options that don't make sense in general. If we wanted to, we could also support a function that specified a specific configuration ( But all of this is also a matter of taste, and I'll defer to what the group wants. |
Another question related to ops: currently we offer the ability to supply a "context pointer" ( You can see these various context pointers in the I can imagine elaborate use cases where we interpolate from tables and such to fill in material properties or boundary conditions. If we're actually interested in doing such things, I understand the need for the complexity. But another solution that arguably captures this concept a bit better is to create proper types for material models and boundary conditions, and have them manage their own contextual data. |
I believe we have the context pointer (such as |
We have separate contexts in PETSc callbacks because it avoids imposing a specific granularity on user code. So the SNES residual and Jacobian implementations could be provided by the same C++ class (context = |
Here's an incomplete list of stuff required for this task:
|
See @jedbrown 's comment here. By using pointers to functions to dispatch mode-specific work, we can avoid a lot of
if
andswitch
tests.In order to make this work, we should identify the operations/behaviors we want to capture in such a table of function pointers.
The text was updated successfully, but these errors were encountered: