LCOV - code coverage report
Current view: top level - src/materials - ConstantAnisotropicMobility.C (source / functions) Hit Total Coverage
Test: idaholab/moose phase_field: #31405 (292dce) with base fef103 Lines: 17 18 94.4 %
Date: 2025-09-04 07:55:36 Functions: 6 6 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 "ConstantAnisotropicMobility.h"
      11             : 
      12             : registerMooseObject("PhaseFieldApp", ConstantAnisotropicMobility);
      13             : registerMooseObject("PhaseFieldApp", ADConstantAnisotropicMobility);
      14             : 
      15             : template <bool is_ad>
      16             : InputParameters
      17         289 : ConstantAnisotropicMobilityTempl<is_ad>::validParams()
      18             : {
      19         289 :   InputParameters params = Material::validParams();
      20         289 :   params.addClassDescription("Provide a constant mobility tensor value");
      21         578 :   params.addRequiredParam<MaterialPropertyName>("M_name",
      22             :                                                 "Name of the mobility tensor property to generate");
      23         578 :   params.addRequiredRangeCheckedParam<std::vector<Real>>(
      24             :       "tensor", "tensor_size=9", "Tensor values");
      25         578 :   params.set<MooseEnum>("constant_on") = "SUBDOMAIN";
      26         289 :   return params;
      27           0 : }
      28             : 
      29             : template <bool is_ad>
      30         222 : ConstantAnisotropicMobilityTempl<is_ad>::ConstantAnisotropicMobilityTempl(
      31             :     const InputParameters & parameters)
      32             :   : Material(parameters),
      33         222 :     _mobility_values(getParam<std::vector<Real>>("tensor")),
      34         444 :     _mobility_name(getParam<MaterialPropertyName>("M_name")),
      35         444 :     _mobility(declareGenericProperty<RealTensorValue, is_ad>(_mobility_name))
      36             : {
      37         222 : }
      38             : 
      39             : template <bool is_ad>
      40             : void
      41       10388 : ConstantAnisotropicMobilityTempl<is_ad>::computeQpProperties()
      42             : {
      43       41552 :   for (const auto a : make_range(Moose::dim))
      44      124656 :     for (const auto b : make_range(Moose::dim))
      45       93492 :       _mobility[_qp](a, b) = _mobility_values[a * 3 + b];
      46       10388 : }
      47             : 
      48             : template class ConstantAnisotropicMobilityTempl<false>;
      49             : template class ConstantAnisotropicMobilityTempl<true>;

Generated by: LCOV version 1.14