Skip to content

Commit

Permalink
Remove integrates_nl/linear and just use pointers. (#29149)
Browse files Browse the repository at this point in the history
  • Loading branch information
grmnptr committed Dec 12, 2024
1 parent 834dc42 commit fc547cd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ class LinearTimeIntegratorInterface
/// Pointer to the linear system, can happen that we dont have any
LinearSystem * _linear_system;

/// Boolean to check if it integrates a linear system
const bool _integrates_linear_system;

/// Nonlinear implicit system, if applicable; otherwise, nullptr
libMesh::LinearImplicitSystem * _linear_implicit_system;
};
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ class NonlinearTimeIntegratorInterface
/// Pointer to the nonlinear system, can happen that we dont have any
NonlinearSystemBase * _nl;

/// Boolean to check if this integrator belongs to a nonlinear system
const bool _integrates_nl;

/// libMesh nonlinear implicit system, if applicable; otherwise, nullptr
libMesh::NonlinearImplicitSystem * _nonlinear_implicit_system;

Expand Down
2 changes: 1 addition & 1 deletion framework/src/timeintegrators/CrankNicolson.C
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ CrankNicolson::init()
u_dot.zero();
computeDuDotDu();

if (_integrates_nl)
if (_nl)
{
// compute residual for the initial time step
// Note: we can not directly pass _residual_old in computeResidualTag because
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

LinearTimeIntegratorInterface::LinearTimeIntegratorInterface(SystemBase & system)
: _linear_system(dynamic_cast<LinearSystem *>(&system)),
_integrates_linear_system(_linear_system),
_linear_implicit_system(
_linear_system ? dynamic_cast<LinearImplicitSystem *>(&_linear_system->system()) : nullptr)
{
Expand Down
11 changes: 5 additions & 6 deletions framework/src/timeintegrators/NonlinearTimeIntegratorInterface.C
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
NonlinearTimeIntegratorInterface::NonlinearTimeIntegratorInterface(FEProblemBase & problem,
SystemBase & system)
: _nl(dynamic_cast<NonlinearSystemBase *>(&system)),
_integrates_nl(_nl),
_nonlinear_implicit_system(
_integrates_nl ? dynamic_cast<NonlinearImplicitSystem *>(&_nl->system()) : nullptr),
_Re_time(_integrates_nl ? &_nl->getResidualTimeVector() : nullptr),
_Re_non_time(_integrates_nl ? &_nl->getResidualNonTimeVector() : nullptr),
_nonlinear_implicit_system(_nl ? dynamic_cast<NonlinearImplicitSystem *>(&_nl->system())
: nullptr),
_Re_time(_nl ? &_nl->getResidualTimeVector() : nullptr),
_Re_non_time(_nl ? &_nl->getResidualNonTimeVector() : nullptr),
_u_dot_factor_tag(problem.addVectorTag("u_dot_factor", Moose::VECTOR_TAG_SOLUTION)),
_u_dotdot_factor_tag(problem.addVectorTag("u_dotdot_factor", Moose::VECTOR_TAG_SOLUTION))
{
Expand All @@ -33,7 +32,7 @@ NonlinearTimeIntegratorInterface::addVector(const std::string & name,
const bool project,
const libMesh::ParallelType type)
{
if (_integrates_nl)
if (_nl)
return &_nl->addVector(name, project, type);
else
return nullptr;
Expand Down

0 comments on commit fc547cd

Please sign in to comment.