LCOV - code coverage report
Current view: top level - src/materials - CompositeElasticityTensor.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 16 17 94.1 %
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 "CompositeElasticityTensor.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", CompositeElasticityTensor);
      13             : 
      14             : InputParameters
      15         288 : CompositeElasticityTensor::validParams()
      16             : {
      17         288 :   InputParameters params = CompositeTensorBase<RankFourTensor, Material>::validParams();
      18         288 :   params.addClassDescription("Assemble an elasticity tensor from multiple tensor contributions "
      19             :                              "weighted by material properties");
      20         576 :   params.addParam<std::string>("base_name",
      21             :                                "Optional parameter that allows the user to define "
      22             :                                "multiple mechanics material systems on the same "
      23             :                                "block, i.e. for multiple phases");
      24         288 :   return params;
      25           0 : }
      26             : 
      27         216 : CompositeElasticityTensor::CompositeElasticityTensor(const InputParameters & parameters)
      28             :   : CompositeTensorBase<RankFourTensor, Material>(parameters),
      29         216 :     _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
      30         216 :     _M_name(_base_name + "elasticity_tensor"),
      31         432 :     _M(declareProperty<RankFourTensor>(_M_name))
      32             : {
      33             :   // we take the tensor names to be the _base names_ of the elasticity tensors
      34         558 :   for (unsigned int i = 0; i < _num_comp; ++i)
      35         342 :     _tensor_names[i] += "_elasticity_tensor";
      36             : 
      37         216 :   initializeDerivativeProperties(_M_name);
      38         216 : }
      39             : 
      40             : void
      41     2352468 : CompositeElasticityTensor::computeQpProperties()
      42             : {
      43     2352468 :   computeQpTensorProperties(_M);
      44     2352468 : }

Generated by: LCOV version 1.14