https://mooseframework.inl.gov
CosineHumpFunctionTest.h
Go to the documentation of this file.
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 #pragma once
11 
12 #include "MooseObjectUnitTest.h"
13 
15 {
16 public:
18  : MooseObjectUnitTest("ThermalHydraulicsApp"),
19  _fn_name_positive("positive_hump"),
20  _fn_name_negative("negative_hump"),
22  _hump_width(2.0),
23  _hump_begin_value(5.0),
26  {
27  buildObjects();
28  }
29 
30 protected:
31  void buildObjects()
32  {
33  // positive hump
34  {
35  const std::string class_name = "CosineHumpFunction";
36  InputParameters params = _factory.getValidParams(class_name);
37  params.set<MooseEnum>("axis") = "y";
38  params.set<Real>("hump_center_position") = _hump_center_position;
39  params.set<Real>("hump_width") = _hump_width;
40  params.set<Real>("hump_begin_value") = _hump_begin_value;
41  params.set<Real>("hump_center_value") = _hump_center_value_positive;
42  _fe_problem->addFunction(class_name, _fn_name_positive, params);
43  }
44 
45  // negative hump
46  {
47  const std::string class_name = "CosineHumpFunction";
48  InputParameters params = _factory.getValidParams(class_name);
49  params.set<MooseEnum>("axis") = "y";
50  params.set<Real>("hump_center_position") = _hump_center_position;
51  params.set<Real>("hump_width") = _hump_width;
52  params.set<Real>("hump_begin_value") = _hump_begin_value;
53  params.set<Real>("hump_center_value") = _hump_center_value_negative;
54  _fe_problem->addFunction(class_name, _fn_name_negative, params);
55  }
56  }
57 
59  const FunctionName _fn_name_positive;
61  const FunctionName _fn_name_negative;
72 };
const Real _hump_center_value_positive
Value at center of hump for the "positive" hump tests.
std::shared_ptr< FEProblem > _fe_problem
const Real _hump_begin_value
Value before and after hump.
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const FunctionName _fn_name_positive
Tested function name for the "positive" hump tests.
const FunctionName _fn_name_negative
Tested function name for the "negative" hump tests.
const Real _hump_center_value_negative
Value at center of hump for the "negative" hump tests.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _hump_width
Hump width.
const Real _hump_center_position
Hump center position.