-
Notifications
You must be signed in to change notification settings - Fork 239
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
Pre post timestep for local asm #1094
Pre post timestep for local asm #1094
Conversation
/// The positions in the global matrix/vector are taken from | ||
/// the LocalToGlobalIndexMap provided in the constructor at index \c id. | ||
/// \attention The index \c id is not necesserily the mesh item's id. | ||
template <typename LocalAssembler_> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need the trailing underscore? ✅
Very important comment, though easy to fix. Afterwards ⏩. |
@@ -72,14 +72,59 @@ class Process | |||
/// Process specific initialization called by initialize(). | |||
virtual void createLocalAssemblers() = 0; | |||
|
|||
/// Postprocessing after solve(). | |||
/// Preprocessing before starting assembly for new timestep. | |||
virtual void preTimestep(GlobalVector const& x) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will preTimestep()
, postTimestep()
or output()
change the internals of the process object or will they work on external data? If they only work on external data the methods could be const
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They do change the internals. E.g., they could save some secondary variables from the previous timeste.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explanation. I understand that preTimestep()
and postTimestep()
should be able change internal things. Will output()
change internals, too? ✅
Looks good. 👍 |
- moved the generalized method out of the class. - extracted function for getting indices
Need an implementation in FEM part of the process: void preTimestep(std::vector<double> const& local_x) override; and implementation in the Process calling FEM::preTimestep: void SpecificProcess::preTimestep() override { Base::_global_setup.execute( [&](std::size_t const id, LocalAssembler* const local_assembler, GlobalVector const& x) -> void { Base::_global_assembler->preTimestep(id, local_assembler, x); }, _local_assemblers, x); }
b99a17f
to
47b1626
Compare
👍 |
Pre post timestep for local asm
OpenGeoSys development has been moved to GitLab. |
postTimestep()
andoutput()
. (No changes, just copy&paste).To use in particular process one needs an implementation in FEM part of the process of
and an implementation in the Process calling
FEM::preTimestep