https://mooseframework.inl.gov
Functions
CosineHumpFunctionTest.C File Reference

Go to the source code of this file.

Functions

 TEST_F (CosineHumpFunctionTest, testPositiveHump)
 
 TEST_F (CosineHumpFunctionTest, testNegativeHump)
 

Function Documentation

◆ TEST_F() [1/2]

TEST_F ( CosineHumpFunctionTest  ,
testPositiveHump   
)

Definition at line 14 of file CosineHumpFunctionTest.C.

15 {
16  const Function & fn = _fe_problem->getFunction(_fn_name_positive);
17 
18  const Real x = 3.0;
19  const Real z = 6.0;
20  const Real abs_tol = 1e-13;
21 
22  // center
23  {
24  const Point p(x, _hump_center_position, z);
25  ABS_TEST(fn.value(0, p), _hump_center_value_positive, abs_tol);
26  }
27 
28  // left
29  {
30  const Point p(x, _hump_center_position - 0.7 * _hump_width, z);
31  ABS_TEST(fn.value(0, p), _hump_begin_value, abs_tol);
32  }
33 
34  // right
35  {
36  const Point p(x, _hump_center_position + 0.7 * _hump_width, z);
37  ABS_TEST(fn.value(0, p), _hump_begin_value, abs_tol);
38  }
39 
40  // halfway between left end of hump and center of hump
41  {
42  const Point p(x, _hump_center_position - 0.25 * _hump_width, z);
43  ABS_TEST(fn.value(0, p), 0.5 * (_hump_begin_value + _hump_center_value_positive), abs_tol);
44  }
45 }
const std::vector< double > x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real value(Real t, const Point &p) const

◆ TEST_F() [2/2]

TEST_F ( CosineHumpFunctionTest  ,
testNegativeHump   
)

Definition at line 47 of file CosineHumpFunctionTest.C.

48 {
49  const Function & fn = _fe_problem->getFunction(_fn_name_negative);
50 
51  const Real x = 3.0;
52  const Real z = 6.0;
53  const Real abs_tol = 1e-13;
54 
55  // center
56  {
57  const Point p(x, _hump_center_position, z);
58  ABS_TEST(fn.value(0, p), _hump_center_value_negative, abs_tol);
59  }
60 
61  // left
62  {
63  const Point p(x, _hump_center_position - 0.7 * _hump_width, z);
64  ABS_TEST(fn.value(0, p), _hump_begin_value, abs_tol);
65  }
66 
67  // right
68  {
69  const Point p(x, _hump_center_position + 0.7 * _hump_width, z);
70  ABS_TEST(fn.value(0, p), _hump_begin_value, abs_tol);
71  }
72 
73  // halfway between left end of hump and center of hump
74  {
75  const Point p(x, _hump_center_position - 0.25 * _hump_width, z);
76  ABS_TEST(fn.value(0, p), 0.5 * (_hump_begin_value + _hump_center_value_negative), abs_tol);
77  }
78 }
const std::vector< double > x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real value(Real t, const Point &p) const