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

Save last state of each unit separately #23

Closed
schmoelder opened this issue Mar 10, 2020 · 3 comments
Closed

Save last state of each unit separately #23

schmoelder opened this issue Mar 10, 2020 · 3 comments
Labels
good first issue Good starting point for newcomers, easy to fix

Comments

@schmoelder
Copy link
Contributor

Currently, the last state (as well as its derivative) is only saved for the entire system.
It would be convenient being able to also save the state for each unit operation separately for re-initialization of systems where individual unit operations might be exchanged.

@sleweke sleweke added the good first issue Good starting point for newcomers, easy to fix label Mar 15, 2020
@Immudzen
Copy link
Contributor

Immudzen commented May 10, 2021

It looks like changes are needed in

void readDataOutputConfig(ParamProvider_t& pp, StorageConfig_t& cfg, const std::string& dataType)

It looks like a new configuration is needed to control saving the state

and in

virtual void beginUnitOperation(cadet::UnitOpIdx idx, const cadet::IModel& model, const cadet::ISolutionExporter& exporter)

Probably have to read from the model to get the current state for a unit operation using _models and _dofOffset

@Immudzen
Copy link
Contributor

and in SolutionRecordImpl.hpp virtual void beginUnitOperation(cadet::UnitOpIdx idx, const cadet::IModel& model, const cadet::ISolutionExporter& exporter)

It looks like this part is incorrect. It doesn't look like from inside this method there is any access to the state variables.

@sleweke-bayer
Copy link
Contributor

My preferred approach:

  1. Add function getModelSlice() to IModelSystem. This function should return start index and length of the model's slice in the global state vector.
  2. Implement this function in ModelSystem class.
  3. Use this function in Driver to obtain the requested slice of the model.

The SolutionRecorder framework is meant for saving specific parts of a model's state, not necessarily the whole state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good starting point for newcomers, easy to fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants