LCOV - code coverage report
Current view: top level - src/materials/large_deformation_models - LargeDeformationPlasticityModel.C (source / functions) Hit Total Coverage
Test: coverage.info Lines: 32 36 88.9 %
Date: 2025-02-21 01:06:12 Functions: 6 6 100.0 %

          Line data    Source code
       1             : //* This file is part of the RACCOON application
       2             : //* being developed at Dolbow lab at Duke University
       3             : //* http://dolbow.pratt.duke.edu
       4             : 
       5             : #include "LargeDeformationPlasticityModel.h"
       6             : #include "LargeDeformationElasticityModel.h"
       7             : 
       8             : InputParameters
       9         328 : LargeDeformationPlasticityModel::validParams()
      10             : {
      11         328 :   InputParameters params = Material::validParams();
      12         328 :   params += ADSingleVariableReturnMappingSolution::validParams();
      13         328 :   params += BaseNameInterface::validParams();
      14             : 
      15         656 :   params.addRequiredParam<MaterialName>("hardening_model", "Name of the plastic hardening model");
      16             : 
      17         328 :   params.set<bool>("compute") = false;
      18         328 :   params.suppressParameter<bool>("compute");
      19             : 
      20         328 :   return params;
      21           0 : }
      22             : 
      23          39 : LargeDeformationPlasticityModel::LargeDeformationPlasticityModel(const InputParameters & parameters)
      24             :   : Material(parameters),
      25             :     ADSingleVariableReturnMappingSolution(parameters),
      26             :     BaseNameInterface(parameters),
      27          78 :     _Fp(declareADProperty<RankTwoTensor>(prependBaseName("plastic_deformation_gradient"))),
      28          39 :     _Fp_old(getMaterialPropertyOldByName<RankTwoTensor>(
      29          78 :         prependBaseName("plastic_deformation_gradient"))),
      30          78 :     _ep(declareADProperty<Real>(prependBaseName("effective_plastic_strain"))),
      31         117 :     _ep_old(getMaterialPropertyOldByName<Real>(prependBaseName("effective_plastic_strain"))),
      32          78 :     _Np(declareADProperty<RankTwoTensor>(prependBaseName("flow_direction"))),
      33          78 :     _heat(declareADProperty<Real>(prependBaseName("plastic_heat_generation")))
      34             : {
      35          39 : }
      36             : 
      37             : void
      38          39 : LargeDeformationPlasticityModel::initialSetup()
      39             : {
      40          39 :   _hardening_model = dynamic_cast<PlasticHardeningModel *>(&getMaterial("hardening_model"));
      41          39 :   if (!_hardening_model)
      42           0 :     paramError("hardening_model",
      43           0 :                "Plastic hardening model " + getParam<MaterialName>("hardening_model") +
      44           0 :                    " is not compatible with " + name());
      45          39 : }
      46             : 
      47             : void
      48      234024 : LargeDeformationPlasticityModel::setQp(unsigned int qp)
      49             : {
      50      234024 :   _qp = qp;
      51      234024 :   _hardening_model->setQp(qp);
      52      234024 : }
      53             : 
      54             : void
      55          39 : LargeDeformationPlasticityModel::setElasticityModel(
      56             :     LargeDeformationElasticityModel * elasticity_model)
      57             : {
      58          39 :   _elasticity_model = elasticity_model;
      59          39 : }
      60             : 
      61             : void
      62       11216 : LargeDeformationPlasticityModel::initQpStatefulProperties()
      63             : {
      64       11216 :   _Fp[_qp].setToIdentity();
      65       11216 :   _ep[_qp] = 0;
      66       11216 : }

Generated by: LCOV version 1.16