15 #include <gtest/gtest.h> 18 #include "../../include/ecl/geometry/tension_function.hpp" 41 int main(
int argc,
char **argv) {
46 std::cout << std::endl;
47 std::cout <<
"***********************************************************" << std::endl;
48 std::cout <<
" Constructors" << std::endl;
49 std::cout <<
"***********************************************************" << std::endl;
50 std::cout << std::endl;
53 function = TensionFunction::Interpolation(2.0,1.0,2.0,3.0,2.0,3.0);
55 std::cout <<
"f(tau,x) =" << std::endl;
56 std::cout <<
function << std::endl;
58 std::cout << string_format(
"t=0.01");
59 std::cout << string_format(
"t=1");
60 std::cout << string_format(
"t=2");
61 std::cout << string_format(
"t=3");
62 std::cout << string_format(
"t=4");
63 std::cout << string_format(
"t=10") << std::endl;
64 for (
int i = 0; i <= 50; ++i ) {
65 std::cout << format(
function(0.01,2.0 + 0.02*i));
66 for (
int j = 1; j < 5; j+=1 ) {
67 std::cout << format(
function(1.0*j,2.0 + 0.02*i));
69 std::cout << format(
function(10.0,2.0 + 0.02*i));
70 std::cout << std::endl;
73 std::cout << std::endl;
74 std::cout <<
"***********************************************************" << std::endl;
75 std::cout <<
" Derivatives" << std::endl;
76 std::cout <<
"***********************************************************" << std::endl;
77 std::cout << std::endl;
79 std::cout << string_format(
"t=0.01");
80 std::cout << string_format(
"t=1");
81 std::cout << string_format(
"t=2");
82 std::cout << string_format(
"t=3");
83 std::cout << string_format(
"t=4");
84 std::cout << string_format(
"t=10") << std::endl;
85 for (
int i = 0; i <= 50; ++i ) {
86 std::cout << format(
function.derivative(0.01,2.0 + 0.02*i));
87 for (
int j = 1; j < 5; j+=1 ) {
88 std::cout << format(
function.derivative(1.0*j,2.0 + 0.02*i));
90 std::cout << format(
function.derivative(10.0,2.0 + 0.02*i));
91 std::cout << std::endl;
95 std::cout << std::endl;
96 std::cout <<
"***********************************************************" << std::endl;
97 std::cout <<
" 2nd Derivatives" << std::endl;
98 std::cout <<
"***********************************************************" << std::endl;
99 std::cout << std::endl;
101 std::cout << string_format(
"t=0.01");
102 std::cout << string_format(
"t=1");
103 std::cout << string_format(
"t=2");
104 std::cout << string_format(
"t=3");
105 std::cout << string_format(
"t=4");
106 std::cout << string_format(
"t=10") << std::endl;
107 for (
int i = 0; i <= 50; ++i ) {
108 std::cout << format(
function.dderivative(0.01,2.0 + 0.02*i));
109 for (
int j = 1; j < 5; j+=1 ) {
110 std::cout << format(
function.dderivative(1.0*j,2.0 + 0.02*i));
112 std::cout << format(
function.dderivative(10.0,2.0 + 0.02*i));
113 std::cout << std::endl;
117 std::cout << std::endl;
118 std::cout <<
"***********************************************************" << std::endl;
119 std::cout <<
" Passed" << std::endl;
120 std::cout <<
"***********************************************************" << std::endl;
121 std::cout << std::endl;
123 testing::InitGoogleTest(&argc,argv);
124 return RUN_ALL_TESTS();
int main(int argc, char **argv)
TEST(TensionFunction, allEggsInOneBasket)
Representation of a tension function.