LCOV - code coverage report
Current view: top level - src/materials - ADComputeGreenLagrangeStrain.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 16 20 80.0 %
Date: 2025-07-25 05:00:39 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 "ADComputeGreenLagrangeStrain.h"
      11             : #include "libmesh/quadrature.h"
      12             : 
      13             : registerMooseObject("SolidMechanicsApp", ADComputeGreenLagrangeStrain);
      14             : 
      15             : InputParameters
      16          48 : ADComputeGreenLagrangeStrain::validParams()
      17             : {
      18          48 :   InputParameters params = ADComputeStrainBase::validParams();
      19          48 :   params.addClassDescription("Compute a Green-Lagrange strain.");
      20          48 :   return params;
      21           0 : }
      22             : 
      23          36 : ADComputeGreenLagrangeStrain::ADComputeGreenLagrangeStrain(const InputParameters & parameters)
      24          36 :   : ADComputeStrainBase(parameters)
      25             : {
      26             :   // error out if unsupported features are to be used
      27          36 :   if (_global_strain)
      28           0 :     paramError("global_strain",
      29             :                "Global strain (periodicity) is not yet supported for Green-Lagrange strains");
      30          36 :   if (!_eigenstrains.empty())
      31           0 :     paramError("eigenstrain_names",
      32             :                "Eigenstrains are not yet supported for Green-Lagrange strains");
      33          36 :   if (_volumetric_locking_correction)
      34           0 :     paramError("volumetric_locking_correction",
      35             :                "Volumetric locking correction is not implemented for Green-Lagrange strains");
      36          36 : }
      37             : 
      38             : void
      39      141984 : ADComputeGreenLagrangeStrain::computeProperties()
      40             : {
      41     1277856 :   for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
      42             :   {
      43             :     auto dxu = ADRankTwoTensor::initializeFromRows(
      44     1135872 :         (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]);
      45     1135872 :     auto dxuT = dxu.transpose();
      46             : 
      47     1135872 :     _mechanical_strain[_qp] = _total_strain[_qp] = (dxuT + dxu + dxuT * dxu) / 2.0;
      48             :   }
      49      141984 : }

Generated by: LCOV version 1.14