LCOV - code coverage report
Current view: top level - src/materials/small_deformation_models - SmallDeformationElasticityModel.C (source / functions) Hit Total Coverage
Test: coverage.info Lines: 25 29 86.2 %
Date: 2025-02-21 01:06:12 Functions: 5 6 83.3 %

          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 "SmallDeformationElasticityModel.h"
       6             : #include "SmallDeformationPlasticityModel.h"
       7             : 
       8             : InputParameters
       9         214 : SmallDeformationElasticityModel::validParams()
      10             : {
      11         214 :   InputParameters params = Material::validParams();
      12         214 :   params += BaseNameInterface::validParams();
      13             : 
      14         214 :   params.set<bool>("compute") = false;
      15         214 :   params.suppressParameter<bool>("compute");
      16             : 
      17         214 :   return params;
      18           0 : }
      19             : 
      20          57 : SmallDeformationElasticityModel::SmallDeformationElasticityModel(const InputParameters & parameters)
      21             :   : Material(parameters),
      22             :     BaseNameInterface(parameters),
      23          57 :     _plasticity_model(nullptr),
      24          57 :     _elastic_strain(declareADProperty<RankTwoTensor>(prependBaseName("elastic_strain")))
      25             : {
      26          57 : }
      27             : 
      28             : void
      29    12039692 : SmallDeformationElasticityModel::setQp(unsigned int qp)
      30             : {
      31    12039692 :   _qp = qp;
      32    12039692 :   if (_plasticity_model)
      33      139608 :     _plasticity_model->setQp(qp);
      34    12039692 : }
      35             : 
      36             : void
      37           6 : SmallDeformationElasticityModel::setPlasticityModel(
      38             :     SmallDeformationPlasticityModel * plasticity_model)
      39             : {
      40           6 :   _plasticity_model = plasticity_model;
      41           6 :   _plasticity_model->setElasticityModel(this);
      42           6 : }
      43             : 
      44             : void
      45           0 : SmallDeformationElasticityModel::initQpStatefulProperties()
      46             : {
      47           0 :   _elastic_strain[_qp].zero();
      48           0 : }
      49             : 
      50             : void
      51    12039692 : SmallDeformationElasticityModel::updateState(const ADRankTwoTensor & mechanical_strain,
      52             :                                              ADRankTwoTensor & stress)
      53             : {
      54    12039692 :   _elastic_strain[_qp] = mechanical_strain;
      55             : 
      56    12039692 :   if (_plasticity_model)
      57      139608 :     _plasticity_model->updateState(stress, _elastic_strain[_qp]);
      58             :   else
      59    23800168 :     stress = computeStress(_elastic_strain[_qp]);
      60    12039692 : }

Generated by: LCOV version 1.16