LCOV - code coverage report
Current view: top level - src/kernels - ADCoefMatReaction.C (source / functions) Hit Total Coverage
Test: coverage.info Lines: 6 20 30.0 %
Date: 2025-07-12 01:09:23 Functions: 1 3 33.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 "ADCoefMatReaction.h"
       6             : 
       7             : registerMooseObject("raccoonApp", ADCoefMatReaction);
       8             : 
       9             : InputParameters
      10         136 : ADCoefMatReaction::validParams()
      11             : {
      12         136 :   InputParameters params = ADKernelValue::validParams();
      13         136 :   params.addClassDescription(
      14             :       "Reaction term optionally multiplied with a coefficient and material properties. The weak "
      15             :       "form is $(w, c u)$, where $c$ is the product of all multipliers.");
      16         272 :   params.addParam<Real>("coefficient", 1.0, "Coefficient of the term");
      17         272 :   params.addParam<std::vector<MaterialPropertyName>>(
      18             :       "prop_names", {}, "names of the material properties to provide the multiplier");
      19         136 :   return params;
      20           0 : }
      21             : 
      22           0 : ADCoefMatReaction::ADCoefMatReaction(const InputParameters & parameters)
      23             :   : ADKernelValue(parameters),
      24           0 :     _coef(getParam<Real>("coefficient")),
      25           0 :     _prop_names(getParam<std::vector<MaterialPropertyName>>("prop_names")),
      26           0 :     _num_props(_prop_names.size())
      27             : {
      28           0 :   _props.resize(_num_props);
      29           0 :   for (unsigned int i = 0; i < _num_props; i++)
      30           0 :     _props[i] = &getADMaterialProperty<Real>(_prop_names[i]);
      31           0 : }
      32             : 
      33             : ADReal
      34           0 : ADCoefMatReaction::precomputeQpResidual()
      35             : {
      36           0 :   ADReal factor = _coef;
      37           0 :   for (auto prop : _props)
      38           0 :     factor *= (*prop)[_qp];
      39           0 :   return factor * _u[_qp];
      40             : }

Generated by: LCOV version 1.16