LCOV - code coverage report
Current view: top level - src/materials - ComputeVolumetricDeformGrad.C (source / functions) Hit Total Coverage
Test: idaholab/moose tensor_mechanics: d6b47a Lines: 25 26 96.2 %
Date: 2024-02-27 11:53:14 Functions: 5 5 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://www.mooseframework.org
       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 "ComputeVolumetricDeformGrad.h"
      11             : 
      12             : registerMooseObject("TensorMechanicsApp", ComputeVolumetricDeformGrad);
      13             : 
      14             : InputParameters
      15          24 : ComputeVolumetricDeformGrad::validParams()
      16             : {
      17          24 :   InputParameters params = Material::validParams();
      18          24 :   params.addClassDescription(
      19             :       "Computes volumetric deformation gradient and adjusts the total deformation gradient");
      20          48 :   params.addRequiredParam<MaterialPropertyName>(
      21             :       "pre_deform_grad_name", "Name of pre-adjusted deformation gradient variable");
      22          48 :   params.addRequiredParam<MaterialPropertyName>("volumetric_deform_grad_name",
      23             :                                                 "Name of volumetric deformation gradient variable");
      24          48 :   params.addRequiredParam<MaterialPropertyName>("post_deform_grad_name",
      25             :                                                 "Name of adjusted deformation gradient variable");
      26          24 :   return params;
      27           0 : }
      28             : 
      29          18 : ComputeVolumetricDeformGrad::ComputeVolumetricDeformGrad(const InputParameters & parameters)
      30             :   : DerivativeMaterialInterface<Material>(parameters),
      31          18 :     _pre_deform_grad(getMaterialProperty<RankTwoTensor>("pre_deform_grad_name")),
      32          18 :     _volumetric_deform_grad(declareProperty<RankTwoTensor>(
      33          18 :         getParam<MaterialPropertyName>("volumetric_deform_grad_name"))),
      34          18 :     _post_deform_grad(
      35          54 :         declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("post_deform_grad_name")))
      36             : {
      37          18 : }
      38             : 
      39             : void
      40          64 : ComputeVolumetricDeformGrad::initQpStatefulProperties()
      41             : {
      42          64 :   _post_deform_grad[_qp].setToIdentity();
      43          64 :   _volumetric_deform_grad[_qp].setToIdentity();
      44          64 : }
      45             : 
      46             : void
      47        8000 : ComputeVolumetricDeformGrad::computeQpProperties()
      48             : {
      49        8000 :   createVolumetricDeformGrad();
      50        8000 :   _post_deform_grad[_qp] = _volumetric_deform_grad[_qp].inverse() * _pre_deform_grad[_qp];
      51        8000 : }
      52             : 
      53             : void
      54        8000 : ComputeVolumetricDeformGrad::createVolumetricDeformGrad()
      55             : {
      56        8000 :   _volumetric_deform_grad[_qp].setToIdentity();
      57        8000 : }

Generated by: LCOV version 1.14