Skip to content

Implement matrix assembly and factorization persistent through entire simulation #567

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/chrono/timestepper/ChTimestepperHHT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ ChTimestepperHHT::ChTimestepperHHT(ChIntegrableIIorder* intgr)
h_min(1e-10),
h(1e6),
num_successful_steps(0),
modified_Newton(true) {
modified_Newton(true),
persistent_Newton(false) {
SetAlpha(-0.2); // default: some dissipation
}

Expand Down
8 changes: 8 additions & 0 deletions src/chrono/timestepper/ChTimestepperHHT.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ class ChApi ChTimestepperHHT : public ChTimestepperIIorder, public ChImplicitIte
/// Default: true.
void SetModifiedNewton(bool enable) { modified_Newton = enable; }

/// Enable/disable persistent Newton.
/// If enabled, the Newton matrix is evaluated, assembled, and factorized only once
/// at the beginning of the first step or if the Newton iteration does not converge with an out-of-date matrix.
/// If disabled, the Newton matrix is evaluated at every iteration of the nonlinear solver.
/// Default: false.
void SetPersistentNewton(bool enable) { persistent_Newton = enable; }

/// Perform an integration timestep, by advancing the state by the specified time step.
virtual void Advance(const double dt) override;

Expand Down Expand Up @@ -126,6 +133,7 @@ class ChApi ChTimestepperHHT : public ChTimestepperIIorder, public ChImplicitIte
unsigned int num_successful_steps; ///< number of successful steps

bool modified_Newton; ///< use modified Newton?
bool persistent_Newton; ///< use persistent Newton?
bool matrix_is_current; ///< is the Newton matrix up-to-date?
bool call_setup; ///< should the solver's Setup function be called?

Expand Down