LCOV - code coverage report
Current view: top level - src/materials/large_deformation_models - LargeDeformationElasticityModel.C (source / functions) Hit Total Coverage
Test: coverage.info Lines: 27 31 87.1 %
Date: 2025-02-21 01:06:12 Functions: 6 7 85.7 %

          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 "LargeDeformationElasticityModel.h"
       6             : #include "LargeDeformationPlasticityModel.h"
       7             : 
       8             : InputParameters
       9         340 : LargeDeformationElasticityModel::validParams()
      10             : {
      11         340 :   InputParameters params = Material::validParams();
      12         340 :   params += BaseNameInterface::validParams();
      13             : 
      14         340 :   params.set<bool>("compute") = false;
      15         340 :   params.suppressParameter<bool>("compute");
      16             : 
      17         340 :   return params;
      18           0 : }
      19             : 
      20          48 : LargeDeformationElasticityModel::LargeDeformationElasticityModel(const InputParameters & parameters)
      21             :   : Material(parameters),
      22             :     BaseNameInterface(parameters),
      23          48 :     _plasticity_model(nullptr),
      24          48 :     _Fe(declareADProperty<RankTwoTensor>(prependBaseName("elastic_deformation_gradient")))
      25             : {
      26          48 : }
      27             : 
      28             : void
      29      287136 : LargeDeformationElasticityModel::setQp(unsigned int qp)
      30             : {
      31      287136 :   _qp = qp;
      32      287136 :   if (_plasticity_model)
      33      234024 :     _plasticity_model->setQp(qp);
      34      287136 : }
      35             : 
      36             : void
      37          39 : LargeDeformationElasticityModel::setPlasticityModel(
      38             :     LargeDeformationPlasticityModel * plasticity_model)
      39             : {
      40          39 :   _plasticity_model = plasticity_model;
      41          39 :   _plasticity_model->setElasticityModel(this);
      42          39 : }
      43             : 
      44             : void
      45           0 : LargeDeformationElasticityModel::initQpStatefulProperties()
      46             : {
      47           0 :   _Fe[_qp].setToIdentity();
      48           0 : }
      49             : 
      50             : void
      51      287136 : LargeDeformationElasticityModel::updateState(const ADRankTwoTensor & Fm, ADRankTwoTensor & stress)
      52             : {
      53      287136 :   _Fe[_qp] = Fm;
      54             : 
      55      287136 :   if (_plasticity_model)
      56      234024 :     _plasticity_model->updateState(stress, _Fe[_qp]);
      57             :   else
      58      106224 :     stress = computeCauchyStress(_Fe[_qp]);
      59      287136 : }
      60             : 
      61             : ADRankTwoTensor
      62      287136 : LargeDeformationElasticityModel::computeCauchyStress(const ADRankTwoTensor & Fe)
      63             : {
      64      287136 :   return Fe.inverse().transpose() * computeMandelStress(Fe) * Fe.transpose() / Fe.det();
      65             : }

Generated by: LCOV version 1.16