LCOV - code coverage report
Current view: top level - include/timeintegrators - NonlinearTimeIntegratorInterface.h (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 2 3 66.7 %
Date: 2025-07-17 01:28:37 Functions: 2 3 66.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #pragma once
      11             : 
      12             : // Moose includes
      13             : #include "MooseTypes.h"
      14             : 
      15             : // Libmesh includes
      16             : #include "libmesh/enum_parallel_type.h"
      17             : 
      18             : // Forward declarations
      19             : class SystemBase;
      20             : class FEProblemBase;
      21             : class NonlinearSystemBase;
      22             : 
      23             : namespace libMesh
      24             : {
      25             : template <typename T>
      26             : class NumericVector;
      27             : class NonlinearImplicitSystem;
      28             : } // namespace libMesh
      29             : 
      30             : /**
      31             :  * Interface class for routines and member variables for time integrators
      32             :  * relying on Newton's method.
      33             :  */
      34             : class NonlinearTimeIntegratorInterface
      35             : {
      36             : public:
      37             :   NonlinearTimeIntegratorInterface(FEProblemBase & problem, SystemBase & system);
      38             : 
      39             :   /**
      40             :    * Callback to the NonLinearTimeIntegratorInterface called immediately after the
      41             :    * residuals are computed in NonlinearSystem::computeResidual().
      42             :    * The residual vector which is passed in to this function should
      43             :    * be filled in by the user with the _Re_time and _Re_non_time
      44             :    * vectors in a way that makes sense for the particular
      45             :    * TimeIntegration method.
      46             :    */
      47           0 :   virtual void postResidual(NumericVector<Number> & /*residual*/) {}
      48             : 
      49             :   /**
      50             :    * Returns the tag for the nodal multiplication factor for the residual calculation of the udot
      51             :    * term.
      52             :    *
      53             :    * By default, this tag will be associated with udot.
      54             :    */
      55       28468 :   TagID uDotFactorTag() const { return _u_dot_factor_tag; }
      56             :   /**
      57             :    * Returns the tag for the nodal multiplication factor for the residual calculation of the udotdot
      58             :    * term.
      59             :    *
      60             :    * By default, this tag will be associated with udotdot.
      61             :    */
      62       28468 :   TagID uDotDotFactorTag() const { return _u_dotdot_factor_tag; }
      63             : 
      64             : protected:
      65             :   /// Wrapper around vector addition for nonlinear time integrators. If we don't
      66             :   /// operate on a nonlinear system we don't need to add the vector.
      67             :   /// @param name The name of the vector
      68             :   /// @param project If the vector should be projected
      69             :   /// @param type The parallel distribution of the vetor
      70             :   NumericVector<Number> *
      71             :   addVector(const std::string & name, const bool project, const libMesh::ParallelType type);
      72             : 
      73             :   /// Pointer to the nonlinear system, can happen that we dont have any
      74             :   NonlinearSystemBase * _nl;
      75             : 
      76             :   /// libMesh nonlinear implicit system, if applicable; otherwise, nullptr
      77             :   libMesh::NonlinearImplicitSystem * _nonlinear_implicit_system;
      78             : 
      79             :   /// residual vector for time contributions
      80             :   NumericVector<Number> * _Re_time;
      81             : 
      82             :   /// residual vector for non-time contributions
      83             :   NumericVector<Number> * _Re_non_time;
      84             : 
      85             :   /// The vector tag for the nodal multiplication factor for the residual calculation of the udot term
      86             :   const TagID _u_dot_factor_tag;
      87             : 
      88             :   /// The vector tag for the nodal multiplication factor for the residual calculation of the udotdot term
      89             :   const TagID _u_dotdot_factor_tag;
      90             : };

Generated by: LCOV version 1.14