https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
16public:
18 : MooseObjectUnitTest("ThermalHydraulicsApp"),
19 _fn_name_positive("positive_hump"),
20 _fn_name_negative("negative_hump"),
22 _hump_width(2.0),
26 {
28 }
29
30protected:
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;
65 const Real _hump_width;
72};
const Real _hump_begin_value
Value before and after hump.
const Real _hump_center_position
Hump center position.
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_width
Hump width.
const Real _hump_center_value_negative
Value at center of hump for the "negative" hump tests.
const Real _hump_center_value_positive
Value at center of hump for the "positive" hump tests.
InputParameters getValidParams(const std::string &name) const
T & set(const std::string &name, bool quiet_mode=false)
std::shared_ptr< FEProblem > _fe_problem