57 template <
typename VectorScalar>
58 void make_custom(
unsigned int choice, VectorScalar & x, VectorScalar & y)
65 x.resize(9); y.resize(9);
66 x[0] = 2.50L; y[0] = 2.25L/0.75L;
67 x[1] = 3.25L; y[1] = 3.75L/0.75L;
68 x[2] = 4.00L; y[2] = 6.00L/0.75L;
69 x[3] = 4.75L; y[3] = 5.00L/0.75L;
70 x[4] = 5.50L; y[4] = 5.50L/0.75L;
71 x[5] = 6.25L; y[5] = 7.50L/0.75L;
72 x[6] = 7.00L; y[6] = 5.25L/0.75L;
73 x[7] = 7.75L; y[7] = 3.75L/0.75L;
74 x[8] = 8.50L; y[8] = 0.00L/0.75L;
79 x.resize(9); y.resize(9);
80 x[0] = 0.00L; y[0] = 0.50L/1.50L;
81 x[1] = 1.50L; y[1] = 2.50L/1.50L;
82 x[2] = 3.00L; y[2] = 9.00L/1.50L;
83 x[3] = 4.50L; y[3] = 10.0L/1.50L;
84 x[4] = 6.00L; y[4] = 13.5L/1.50L;
85 x[5] = 7.50L; y[5] = 7.50L/1.50L;
86 x[6] = 9.00L; y[6] = 2.00L/1.50L;
87 x[7] = 10.5L; y[7] = 0.00L/1.50L;
88 x[8] = 12.0L; y[8] = 0.00L/1.50L;
93 x.resize(5); y.resize(5);
94 x[0] = -1.00L; y[0] = 0.00L/1.20L;
95 x[1] = 0.20L; y[1] = 0.40L/1.20L;
96 x[2] = 1.40L; y[2] = 1.80L/1.20L;
97 x[3] = 2.60L; y[3] = 4.80L/1.20L;
98 x[4] = 3.80L; y[4] = 00.0L/1.20L;
103 x.resize(6); y.resize(6);
104 x[0] = 2.00L; y[0] = 5.75L/1.75L;
105 x[1] = 3.75L; y[1] = 12.25L/1.75L;
106 x[2] = 5.50L; y[2] = 14.75L/1.75L;
107 x[3] = 7.25L; y[3] = 9.25L/1.75L;
108 x[4] = 9.00L; y[4] = 2.00L/1.75L;
109 x[5] = 10.75L; y[5] = 00.00L/1.75L;
116 template <
typename VectorScalar>
121 for(
unsigned int i = 0; i < 10; i++)
139 template <
typename Scalar>
142 std::vector<Scalar> bin_ref_x,bin_ref_y;
148 const Scalar tol = std::numeric_limits<Scalar>::epsilon() * 10;
157 for(
unsigned int i = 0; i < 4; i++)
159 std::vector<Scalar> bin_custom_x, exact_sol_y;
161 std::vector<Scalar> bin_custom_y(bin_custom_x.size());
164 bin_custom_x,bin_custom_y);
167 for(
unsigned int il = 0; il < bin_custom_x.size() - 1; il++)
169 const Scalar dist = (exact_sol_y[il] < tol)?std::abs(bin_custom_y[il] - exact_sol_y[il]):std::abs(bin_custom_y[il] - exact_sol_y[il])/exact_sol_y[il];
172 std::cout << std::scientific << std::setprecision(16)
173 <<
"Error: Mismatch in bin values." << std::endl
174 <<
"case (" << bin_custom_x[il] <<
";" << bin_custom_x[il+1] <<
")" << std::endl
175 <<
"bin = " << bin_custom_y[il] << std::endl
176 <<
"bin_exact = " << exact_sol_y[il] << std::endl
177 <<
"relative error = " << dist << std::endl
178 <<
"tolerance = " << tol << std::endl;
191 return (tester<float>() ||
193 tester<long double>()
void make_reference(VectorScalar &x, VectorScalar &y)
void y_on_custom_grid(const VectorCoeffType &x_old, const VectorCoeffType &y_old, const VectorStateType &x_new, VectorStateType &y_new) const
void make_custom(unsigned int choice, VectorScalar &x, VectorScalar &y)