LCOV - code coverage report
Current view: top level - src/actions - AddAuxVariableAction.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 17 20 85.0 %
Date: 2026-05-29 20:35:17 Functions: 4 5 80.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 "AddAuxVariableAction.h"
      11             : #include "FEProblem.h"
      12             : 
      13             : registerMooseAction("MooseApp", AddAuxVariableAction, "add_aux_variable");
      14             : 
      15             : InputParameters
      16       60387 : AddAuxVariableAction::validParams()
      17             : {
      18       60387 :   InputParameters params = AddVariableAction::validParams();
      19       60387 :   params.addClassDescription("Add auxiliary variable to the simulation.");
      20       60387 :   return params;
      21           0 : }
      22             : 
      23       60296 : AddAuxVariableAction::AddAuxVariableAction(const InputParameters & params)
      24       60296 :   : AddVariableAction(params)
      25             : {
      26       60296 : }
      27             : 
      28             : MooseEnum
      29           0 : AddAuxVariableAction::getAuxVariableFamilies()
      30             : {
      31             :   return MooseEnum("LAGRANGE MONOMIAL SCALAR LAGRANGE_VEC MONOMIAL_VEC L2_HIERARCHIC "
      32             :                    "L2_HIERARCHIC_VEC L2_LAGRANGE L2_LAGRANGE_VEC L2_RAVIART_THOMAS",
      33             :                    "LAGRANGE",
      34           0 :                    true);
      35             : }
      36             : 
      37             : MooseEnum
      38          78 : AddAuxVariableAction::getAuxVariableOrders()
      39             : {
      40             :   return MooseEnum(
      41         312 :       "CONSTANT FIRST SECOND THIRD FOURTH FIFTH SIXTH SEVENTH EIGHTH NINTH", "FIRST", true);
      42             : }
      43             : 
      44             : void
      45       60067 : AddAuxVariableAction::init()
      46             : {
      47       60067 :   AddVariableAction::init();
      48             : 
      49       60067 :   if (_fe_type.order > libMesh::NINTH && !_scalar_var)
      50           3 :     mooseError("Non-scalar AuxVariables must be CONSTANT, FIRST, SECOND, THIRD, FOURTH, FIFTH, "
      51             :                "SIXTH, SEVENTH, EIGHTH or NINTH order (",
      52           3 :                _fe_type.order,
      53             :                " supplied)");
      54             : 
      55             :   // Need static_cast to resolve overloads
      56      120128 :   _problem_add_var_method = static_cast<void (FEProblemBase::*)(
      57       60064 :       const std::string &, const std::string &, InputParameters &)>(&FEProblemBase::addAuxVariable);
      58       60064 : }

Generated by: LCOV version 1.14