https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Functions | Variables
PorousFlowCubicTest.C File Reference

Go to the source code of this file.

Functions

 TEST (PorousFlowCubic, cubic)
 Test cubic.
 
 TEST (PorousFlowCubic, dcubic)
 Test dcubic.
 

Variables

const double eps = 1.0E-8
 

Function Documentation

◆ TEST() [1/2]

TEST ( PorousFlowCubic  ,
cubic   
)

Test cubic.

Definition at line 17 of file PorousFlowCubicTest.C.

18{
19 EXPECT_NEAR(3.0, PorousFlowCubic::cubic(2.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0), 1.0E-12);
20 EXPECT_NEAR(4.0,
21 (PorousFlowCubic::cubic(2.0 + eps, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0) -
22 PorousFlowCubic::cubic(2.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0)) /
23 eps,
24 1.0E-5);
25 EXPECT_NEAR(6.0, PorousFlowCubic::cubic(5.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0), 1.0E-12);
26 EXPECT_NEAR(7.0,
27 (PorousFlowCubic::cubic(5.0 + eps, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0) -
28 PorousFlowCubic::cubic(5.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0)) /
29 eps,
30 1.0E-5);
31 EXPECT_NEAR(-6.0, PorousFlowCubic::cubic(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0), 1.0E-12);
32 EXPECT_NEAR(4.0, PorousFlowCubic::cubic(3.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0), 1.0E-12);
33 EXPECT_NEAR(3.0, PorousFlowCubic::cubic(4.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0), 1.0E-12);
34 EXPECT_NEAR(48.0, PorousFlowCubic::cubic(7.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0), 1.0E-12);
35}
const double eps
Real cubic(Real x, Real x0, Real y0, Real y0p, Real x1, Real y1, Real y1p)
Cubic function f(x) that satisfies f(x0) = y0 f'(x0) = y0p f(x1) = y1 f'(x1) = y1p.

◆ TEST() [2/2]

TEST ( PorousFlowCubic  ,
dcubic   
)

Test dcubic.

Definition at line 38 of file PorousFlowCubicTest.C.

39{
40 EXPECT_NEAR(4.0, PorousFlowCubic::dcubic(2.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0), 1.0E-12);
41 EXPECT_NEAR(7.0, PorousFlowCubic::dcubic(5.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0), 1.0E-12);
42 EXPECT_NEAR(PorousFlowCubic::dcubic(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0),
43 (PorousFlowCubic::cubic(1.0 + eps, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0) -
44 PorousFlowCubic::cubic(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0)) /
45 eps,
46 1.0E-5);
47 EXPECT_NEAR(PorousFlowCubic::dcubic(3.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0),
48 (PorousFlowCubic::cubic(3.0 + eps, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0) -
49 PorousFlowCubic::cubic(3.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0)) /
50 eps,
51 1.0E-5);
52 EXPECT_NEAR(PorousFlowCubic::dcubic(4.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0),
53 (PorousFlowCubic::cubic(4.0 + eps, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0) -
54 PorousFlowCubic::cubic(4.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0)) /
55 eps,
56 1.0E-5);
57 EXPECT_NEAR(PorousFlowCubic::dcubic(7.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0),
58 (PorousFlowCubic::cubic(7.0 + eps, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0) -
59 PorousFlowCubic::cubic(7.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0)) /
60 eps,
61 1.0E-5);
62}
Real dcubic(Real x, Real x0, Real y0, Real y0p, Real x1, Real y1, Real y1p)
Derivative of cubic function, f(x), with respect to x.

Variable Documentation

◆ eps

const double eps = 1.0E-8

Definition at line 14 of file PorousFlowCubicTest.C.

Referenced by TEST(), and TEST().