LCOV - code coverage report
Current view: top level - src/actions - AddAuxVariableAction.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 17 20 85.0 %
Date: 2025-07-17 01:28:37 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       54236 : AddAuxVariableAction::validParams()
      17             : {
      18       54236 :   InputParameters params = AddVariableAction::validParams();
      19       54236 :   params.addClassDescription("Add auxiliary variable to the simulation.");
      20       54236 :   return params;
      21           0 : }
      22             : 
      23       53837 : AddAuxVariableAction::AddAuxVariableAction(const InputParameters & params)
      24       53837 :   : AddVariableAction(params)
      25             : {
      26       53837 : }
      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         239 : AddAuxVariableAction::getAuxVariableOrders()
      39             : {
      40             :   return MooseEnum(
      41         239 :       "CONSTANT FIRST SECOND THIRD FOURTH FIFTH SIXTH SEVENTH EIGHTH NINTH", "FIRST", true);
      42             : }
      43             : 
      44             : void
      45       53644 : AddAuxVariableAction::init()
      46             : {
      47       53644 :   AddVariableAction::init();
      48             : 
      49       53644 :   if (_fe_type.order > libMesh::NINTH && !_scalar_var)
      50           4 :     mooseError("Non-scalar AuxVariables must be CONSTANT, FIRST, SECOND, THIRD, FOURTH, FIFTH, "
      51             :                "SIXTH, SEVENTH, EIGHTH or NINTH order (",
      52           4 :                _fe_type.order,
      53             :                " supplied)");
      54             : 
      55             :   // Need static_cast to resolve overloads
      56      107280 :   _problem_add_var_method = static_cast<void (FEProblemBase::*)(
      57       53640 :       const std::string &, const std::string &, InputParameters &)>(&FEProblemBase::addAuxVariable);
      58       53640 : }

Generated by: LCOV version 1.14