LCOV - code coverage report
Current view: top level - src/kernels - ACGrGrElasticDrivingForce.C (source / functions) Hit Total Coverage
Test: idaholab/moose phase_field: #31405 (292dce) with base fef103 Lines: 0 17 0.0 %
Date: 2025-09-04 07:55:36 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 "ACGrGrElasticDrivingForce.h"
      11             : 
      12             : #include "Material.h"
      13             : #include "RankFourTensor.h"
      14             : #include "RankTwoTensor.h"
      15             : 
      16             : registerMooseObject("PhaseFieldApp", ACGrGrElasticDrivingForce);
      17             : 
      18             : InputParameters
      19           0 : ACGrGrElasticDrivingForce::validParams()
      20             : {
      21           0 :   InputParameters params = ACBulk<Real>::validParams();
      22           0 :   params.addClassDescription("Adds elastic energy contribution to the Allen-Cahn equation");
      23           0 :   params.addRequiredParam<MaterialPropertyName>(
      24             :       "D_tensor_name", "The elastic tensor derivative for the specific order parameter");
      25           0 :   return params;
      26           0 : }
      27             : 
      28           0 : ACGrGrElasticDrivingForce::ACGrGrElasticDrivingForce(const InputParameters & parameters)
      29             :   : ACBulk<Real>(parameters),
      30           0 :     _D_elastic_tensor(getMaterialProperty<RankFourTensor>("D_tensor_name")),
      31           0 :     _elastic_strain(getMaterialPropertyByName<RankTwoTensor>("elastic_strain"))
      32             : {
      33           0 : }
      34             : 
      35             : Real
      36           0 : ACGrGrElasticDrivingForce::computeDFDOP(PFFunctionType type)
      37             : {
      38             :   // Access the heterogeneous strain calculated by the Solid Mechanics kernels
      39           0 :   RankTwoTensor strain(_elastic_strain[_qp]);
      40             : 
      41             :   // Compute the partial derivative of the stress wrt the order parameter
      42           0 :   RankTwoTensor D_stress = _D_elastic_tensor[_qp] * strain;
      43             : 
      44           0 :   switch (type)
      45             :   {
      46           0 :     case Residual:
      47             :       return 0.5 *
      48           0 :              D_stress.doubleContraction(strain); // Compute the deformation energy driving force
      49             : 
      50             :     case Jacobian:
      51             :       return 0.0;
      52             :   }
      53             : 
      54           0 :   mooseError("Invalid type passed in");
      55             : }

Generated by: LCOV version 1.14