LCOV - code coverage report
Current view: top level - src/materials - Compute1DFiniteStrain.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #32971 (54bef8) with base c6cf66 Lines: 24 25 96.0 %
Date: 2026-05-29 20:40:07 Functions: 3 3 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             : #include "Compute1DFiniteStrain.h"
      11             : 
      12             : #include "libmesh/quadrature.h"
      13             : 
      14             : InputParameters
      15          52 : Compute1DFiniteStrain::validParams()
      16             : {
      17          52 :   InputParameters params = ComputeFiniteStrain::validParams();
      18          52 :   params.addClassDescription("Compute strain increment for finite strain in 1D problem");
      19             : 
      20          52 :   return params;
      21           0 : }
      22             : 
      23          39 : Compute1DFiniteStrain::Compute1DFiniteStrain(const InputParameters & parameters)
      24          39 :   : ComputeFiniteStrain(parameters)
      25             : {
      26          39 : }
      27             : 
      28             : void
      29        5368 : Compute1DFiniteStrain::computeProperties()
      30             : {
      31       16104 :   for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
      32             :   {
      33             :     // Deformation gradient
      34             :     auto A = RankTwoTensor::initializeFromRows(
      35       10736 :         (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]);
      36             : 
      37             :     // Old Deformation gradient
      38             :     auto Fbar = RankTwoTensor::initializeFromRows(
      39       10736 :         (*_grad_disp_old[0])[_qp], (*_grad_disp_old[1])[_qp], (*_grad_disp_old[2])[_qp]);
      40             : 
      41             :     // Compute the displacement gradient dUy/dy and dUz/dz value for 1D problems
      42       10736 :     A(1, 1) = computeGradDispYY();
      43       10736 :     A(2, 2) = computeGradDispZZ();
      44             : 
      45       10736 :     Fbar(1, 1) = computeGradDispYYOld();
      46       10736 :     Fbar(2, 2) = computeGradDispZZOld();
      47             : 
      48             :     // Gauss point deformation gradient
      49       10736 :     _deformation_gradient[_qp] = A;
      50       10736 :     _deformation_gradient[_qp].addIa(1.0);
      51             : 
      52       10736 :     A -= Fbar; // very nearly A = gradU - gradUold, adapted to cylindrical coords
      53             : 
      54       10736 :     Fbar.addIa(1.0); // Fbar = ( I + gradUold)
      55             : 
      56             :     // Incremental deformation gradient _Fhat = I + A Fbar^-1
      57       10736 :     _Fhat[_qp] = A * Fbar.inverse();
      58       10736 :     _Fhat[_qp].addIa(1.0);
      59             :   }
      60             : 
      61       16104 :   for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
      62       10736 :     computeQpStrain();
      63        5368 : }

Generated by: LCOV version 1.14