LCOV - code coverage report
Current view: top level - include/dampers - ReferenceElementJacobianDamper.h (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 1 1 100.0 %
Date: 2025-07-25 05:00:39 Functions: 1 1 100.0 %
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 "GeneralDamper.h"
      14             : #include "MooseVariable.h"
      15             : #include "RankTwoTensorForward.h"
      16             : #include "Coupleable.h"
      17             : #include "BlockRestrictable.h"
      18             : 
      19             : // Forward Declarations
      20             : class FEProblemBase;
      21             : class MooseMesh;
      22             : 
      23             : /**
      24             :  * This class implements a damper that limits the change in the Jacobian of elements without relying
      25             :  * on having the displaced mesh
      26             :  */
      27             : class ReferenceElementJacobianDamper : public GeneralDamper,
      28             :                                        public Coupleable,
      29             :                                        public BlockRestrictable
      30             : {
      31             : public:
      32             :   static InputParameters validParams();
      33             : 
      34             :   ReferenceElementJacobianDamper(const InputParameters & parameters);
      35             : 
      36          12 :   virtual void initialSetup() override {}
      37             : 
      38             :   virtual Real computeDamping(const NumericVector<Number> & solution,
      39             :                               const NumericVector<Number> & update) override;
      40             : 
      41             : protected:
      42             :   /// Maximum allowed relative increment in Jacobian
      43             :   const Real _max_jacobian_diff;
      44             : 
      45             :   /// Thread ID
      46             :   THREAD_ID _tid;
      47             : 
      48             :   /// The undisplaced mesh
      49             :   MooseMesh & _mesh;
      50             : 
      51             :   /// The undisplaced assembly
      52             :   Assembly & _assembly;
      53             : 
      54             :   /// Quadrature rule
      55             :   const QBase * const & _qrule;
      56             : 
      57             :   /// Number of displacement variables
      58             :   const unsigned int _ndisp;
      59             : 
      60             :   /// The displacement variable numbers
      61             :   std::vector<unsigned int> _disp_num;
      62             : 
      63             :   /// shape function gradients
      64             :   std::vector<const VariablePhiGradient *> _grad_phi;
      65             : 
      66             : private:
      67             :   /// Fill the displacement gradients
      68             :   void computeGradDisp(const Elem * elem,
      69             :                        const NumericVector<Number> & solution,
      70             :                        const NumericVector<Number> & update);
      71             : 
      72             :   /// The current displacement gradients
      73             :   std::vector<std::vector<RealVectorValue>> _grad_disp;
      74             : 
      75             :   /// The displacement gradients after this update
      76             :   std::vector<std::vector<RealVectorValue>> _grad_disp_update;
      77             : };

Generated by: LCOV version 1.14