LCOV - code coverage report
Current view: top level - src/materials - ComputeConcentrationDependentElasticityTensor.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 0 32 0.0 %
Date: 2025-07-25 05:00:39 Functions: 0 3 0.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 "ComputeConcentrationDependentElasticityTensor.h"
      11             : #include "RotationTensor.h"
      12             : 
      13             : registerMooseObject("SolidMechanicsApp", ComputeConcentrationDependentElasticityTensor);
      14             : 
      15             : InputParameters
      16           0 : ComputeConcentrationDependentElasticityTensor::validParams()
      17             : {
      18           0 :   InputParameters params = ComputeRotatedElasticityTensorBase::validParams();
      19           0 :   params.addClassDescription("Compute concentration dependent elasticity tensor.");
      20           0 :   params.addRequiredParam<std::vector<Real>>("C0_ijkl",
      21             :                                              "Stiffness tensor for zero concentration phase");
      22           0 :   params.addRequiredParam<std::vector<Real>>("C1_ijkl",
      23             :                                              "Stiffness tensor for phase having concentration 1.0");
      24           0 :   params.addParam<MooseEnum>(
      25           0 :       "fill_method0", RankFourTensor::fillMethodEnum() = "symmetric9", "The fill method");
      26           0 :   params.addParam<MooseEnum>(
      27           0 :       "fill_method1", RankFourTensor::fillMethodEnum() = "symmetric9", "The fill method");
      28           0 :   params.addRequiredCoupledVar("c", "Concentration");
      29           0 :   return params;
      30           0 : }
      31             : 
      32           0 : ComputeConcentrationDependentElasticityTensor::ComputeConcentrationDependentElasticityTensor(
      33           0 :     const InputParameters & parameters)
      34             :   : ComputeRotatedElasticityTensorBase(parameters),
      35           0 :     _Cijkl0(getParam<std::vector<Real>>("C0_ijkl"),
      36           0 :             (RankFourTensor::FillMethod)(int)getParam<MooseEnum>("fill_method0")),
      37           0 :     _Cijkl1(getParam<std::vector<Real>>("C1_ijkl"),
      38           0 :             (RankFourTensor::FillMethod)(int)getParam<MooseEnum>("fill_method1")),
      39           0 :     _c(coupledValue("c")),
      40           0 :     _c_name(coupledName("c", 0)),
      41           0 :     _delasticity_tensor_dc(isCoupledConstant("c") ? nullptr
      42           0 :                                                   : &declarePropertyDerivative<RankFourTensor>(
      43           0 :                                                         _elasticity_tensor_name, _c_name))
      44             : {
      45             :   // Define a rotation according to Euler angle parameters
      46           0 :   RotationTensor R(_Euler_angles); // R type: RealTensorValue
      47             : 
      48             :   // Rotate tensors
      49           0 :   _Cijkl0.rotate(R);
      50           0 :   _Cijkl1.rotate(R);
      51           0 : }
      52             : 
      53             : void
      54           0 : ComputeConcentrationDependentElasticityTensor::computeQpElasticityTensor()
      55             : {
      56             :   // Assign elasticity tensor at a given quad point
      57           0 :   _elasticity_tensor[_qp] = _Cijkl0 + (_Cijkl1 - _Cijkl0) * _c[_qp];
      58             :   // Define derivative of elasticity tensor with respect to concentration.
      59           0 :   if (_delasticity_tensor_dc)
      60           0 :     (*_delasticity_tensor_dc)[_qp] = (_Cijkl1 - _Cijkl0);
      61           0 : }

Generated by: LCOV version 1.14