LCOV - code coverage report
Current view: top level - src/indicators - ElementIndicator.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 24 25 96.0 %
Date: 2025-07-17 01:28:37 Functions: 2 2 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 "ElementIndicator.h"
      11             : 
      12             : #include "Assembly.h"
      13             : #include "MooseVariableField.h"
      14             : #include "SystemBase.h"
      15             : 
      16             : #include "libmesh/threads.h"
      17             : 
      18             : InputParameters
      19       14461 : ElementIndicator::validParams()
      20             : {
      21       14461 :   InputParameters params = Indicator::validParams();
      22       14461 :   params += MaterialPropertyInterface::validParams();
      23       14461 :   params += TransientInterface::validParams();
      24       14461 :   params.addRequiredParam<VariableName>("variable",
      25             :                                         "The name of the variable that this Indicator operates on");
      26       14461 :   std::vector<SubdomainName> everywhere(1, "ANY_BLOCK_ID");
      27       14461 :   params.addParam<std::vector<SubdomainName>>(
      28             :       "block", everywhere, "block ID or name where the object works");
      29       28922 :   return params;
      30       14461 : }
      31             : 
      32         102 : ElementIndicator::ElementIndicator(const InputParameters & parameters)
      33             :   : Indicator(parameters),
      34             :     TransientInterface(this),
      35             :     PostprocessorInterface(this),
      36             :     Coupleable(this, false),
      37             :     ScalarCoupleable(this),
      38             :     MooseVariableInterface<Real>(this,
      39             :                                  false,
      40             :                                  "variable",
      41             :                                  Moose::VarKindType::VAR_ANY,
      42             :                                  Moose::VarFieldType::VAR_FIELD_STANDARD),
      43         102 :     _field_var(_subproblem.getStandardVariable(_tid, name())),
      44             : 
      45         102 :     _current_elem(_field_var.currentElem()),
      46         102 :     _current_elem_volume(_assembly.elemVolume()),
      47         102 :     _q_point(_assembly.qPoints()),
      48         102 :     _qrule(_assembly.qRule()),
      49         102 :     _JxW(_assembly.JxW()),
      50         102 :     _coord(_assembly.coordTransformation()),
      51         102 :     _var(mooseVariableField()),
      52         102 :     _u(_var.sln()),
      53         204 :     _grad_u(_var.gradSln())
      54             : {
      55         102 :   const std::vector<MooseVariableFieldBase *> & coupled_vars = getCoupledMooseVars();
      56         102 :   for (const auto & var : coupled_vars)
      57           0 :     addMooseVariableDependency(var);
      58             : 
      59         102 :   addMooseVariableDependency(&mooseVariableField());
      60         102 : }

Generated by: LCOV version 1.14