LCOV - code coverage report
Current view: top level - src/scalarkernels - ScalarKernelBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 11 17 64.7 %
Date: 2025-07-17 01:28:37 Functions: 2 3 66.7 %
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 "ScalarKernelBase.h"
      11             : #include "Assembly.h"
      12             : #include "MooseVariableScalar.h"
      13             : #include "MooseVariableFE.h"
      14             : #include "Problem.h"
      15             : #include "SubProblem.h"
      16             : #include "NonlinearSystem.h"
      17             : 
      18             : InputParameters
      19      216815 : ScalarKernelBase::validParams()
      20             : {
      21      216815 :   InputParameters params = ResidualObject::validParams();
      22      650445 :   params.addParam<bool>("use_displaced_mesh",
      23      433630 :                         false,
      24             :                         "Whether or not this object should use the "
      25             :                         "displaced mesh for computation.  Note that "
      26             :                         "in the case this is true but no "
      27             :                         "displacements are provided in the Mesh block "
      28             :                         "the undisplaced mesh will still be used.");
      29      216815 :   params.addParamNamesToGroup("use_displaced_mesh", "Advanced");
      30             : 
      31      216815 :   params.registerBase("ScalarKernel");
      32      216815 :   params.registerSystemAttributeName("ScalarKernel");
      33             : 
      34      216815 :   return params;
      35           0 : }
      36             : 
      37        1420 : ScalarKernelBase::ScalarKernelBase(const InputParameters & parameters)
      38             :   : ResidualObject(parameters),
      39             :     ScalarCoupleable(this),
      40        1420 :     _var(_sys.getScalarVariable(_tid, parameters.get<NonlinearVariableName>("variable")))
      41             : {
      42        1416 : }
      43             : 
      44             : const VariableValue &
      45           0 : ScalarKernelBase::uOld() const
      46             : {
      47           0 :   if (_sys.solutionStatesInitialized())
      48           0 :     mooseError("The solution states have already been initialized when calling ",
      49           0 :                type(),
      50             :                "::uOld().\n\n",
      51             :                "Make sure to call uOld() within the object constructor.");
      52             : 
      53           0 :   return _var.slnOld();
      54             : }

Generated by: LCOV version 1.14