<commit_before>//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

// Standard includes
#include <sstream>
#include <stdexcept>

// MOOSE includes
#include "AddVariableAction.h"
#include "FEProblem.h"
#include "Factory.h"
#include "MooseEnum.h"
#include "MooseEigenSystem.h"
#include "MooseObjectAction.h"
#include "MooseMesh.h"

#include "libmesh/libmesh.h"
#include "libmesh/exodusII_io.h"
#include "libmesh/equation_systems.h"
#include "libmesh/nonlinear_implicit_system.h"
#include "libmesh/explicit_system.h"
#include "libmesh/string_to_enum.h"

// class static initialization
const Real AddVariableAction::_abs_zero_tol = 1e-12;

registerMooseAction("MooseApp", AddVariableAction, "add_variable");

template <>
InputParameters
validParams<AddVariableAction>()
{
  // Get MooseEnums for the possible order/family options for this variable
  MooseEnum families(AddVariableAction::getNonlinearVariableFamilies());
  MooseEnum orders(AddVariableAction::getNonlinearVariableOrders());

  // Define the general input options
  InputParameters params = validParams<Action>();
  params += validParams<OutputInterface>();
  params.addParam<MooseEnum>(
      "family", families, "Specifies the family of FE shape functions to use for this variable");
  params.addParam<MooseEnum>("order",
                             orders,
                             "Specifies the order of the FE shape function to use "
                             "for this variable (additional orders not listed are "
                             "allowed)");
  params.addParam<unsigned int>("component", 1, "Number of component for an array variable");
  params.addParam<std::vector<Real>>("initial_condition",
                                     "Specifies the initial condition for this variable");
  params.addParam<std::vector<SubdomainName>>("block", "The block id where this variable lives");
  params.addParam<bool>("eigen", false, "True to make this variable an eigen variable");

  // Advanced input options
  params.addParam<std::vector<Real>>("scaling",
                                     "Specifies a scaling factor to apply to this variable");
  params.addParamNamesToGroup("scaling eigen", "Advanced");

  return params;
}

AddVariableAction::AddVariableAction(InputParameters params)
  : Action(params),<commit_msg>protect component param from being set to zero accidentally<commit_after>//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

// Standard includes
#include <sstream>
#include <stdexcept>

// MOOSE includes
#include "AddVariableAction.h"
#include "FEProblem.h"
#include "Factory.h"
#include "MooseEnum.h"
#include "MooseEigenSystem.h"
#include "MooseObjectAction.h"
#include "MooseMesh.h"

#include "libmesh/libmesh.h"
#include "libmesh/exodusII_io.h"
#include "libmesh/equation_systems.h"
#include "libmesh/nonlinear_implicit_system.h"
#include "libmesh/explicit_system.h"
#include "libmesh/string_to_enum.h"

// class static initialization
const Real AddVariableAction::_abs_zero_tol = 1e-12;

registerMooseAction("MooseApp", AddVariableAction, "add_variable");

template <>
InputParameters
validParams<AddVariableAction>()
{
  // Get MooseEnums for the possible order/family options for this variable
  MooseEnum families(AddVariableAction::getNonlinearVariableFamilies());
  MooseEnum orders(AddVariableAction::getNonlinearVariableOrders());

  // Define the general input options
  InputParameters params = validParams<Action>();
  params += validParams<OutputInterface>();
  params.addParam<MooseEnum>(
      "family", families, "Specifies the family of FE shape functions to use for this variable");
  params.addParam<MooseEnum>("order",
                             orders,
                             "Specifies the order of the FE shape function to use "
                             "for this variable (additional orders not listed are "
                             "allowed)");
  params.addRangeCheckedParam<unsigned int>(
      "component", 1, "component>0", "Number of component for an array variable");
  params.addParam<std::vector<Real>>("initial_condition",
                                     "Specifies the initial condition for this variable");
  params.addParam<std::vector<SubdomainName>>("block", "The block id where this variable lives");
  params.addParam<bool>("eigen", false, "True to make this variable an eigen variable");

  // Advanced input options
  params.addParam<std::vector<Real>>("scaling",
                                     "Specifies a scaling factor to apply to this variable");
  params.addParamNamesToGroup("scaling eigen", "Advanced");

  return params;
}

AddVariableAction::AddVariableAction(InputParameters params)
  : Action(params),
{'fraction_non_alphanumeric': 0.11451551129835312, 'fraction_numerical': 0.0032554576790501722, 'mean_word_length': 3.822714681440443, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 36, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5757391', 'n_tokens_mistral': 1480, 'n_tokens_neox': 1449, 'n_words': 395}