Commit 03c08dac authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

add more interpolation specializations

parent 693a149f
Pipeline #66925 passed with stage
in 3 minutes and 46 seconds
......@@ -32,6 +32,9 @@ class particles_generic_interp;
#include "Lagrange_polys.hpp"
#include "spline.hpp"
/*****************************************************************************/
/* Lagrange interpolation */
template <>
class particles_generic_interp<double, 1,0>{
public:
......@@ -43,122 +46,137 @@ public:
};
template <>
class particles_generic_interp<double, 1,1>{
class particles_generic_interp<double, 2,0>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n1_m1(in_derivative, in_part_val, poly_val);
beta_Lagrange_n2(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 1,2>{
class particles_generic_interp<double, 3,0>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n1_m2(in_derivative, in_part_val, poly_val);
beta_Lagrange_n3(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 2,0>{
class particles_generic_interp<double, 4,0>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_Lagrange_n2(in_derivative, in_part_val, poly_val);
beta_Lagrange_n4(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 2,1>{
class particles_generic_interp<double, 5,0>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n2_m1(in_derivative, in_part_val, poly_val);
beta_Lagrange_n5(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 2,2>{
class particles_generic_interp<double, 6,0>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n2_m2(in_derivative, in_part_val, poly_val);
beta_Lagrange_n6(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 3,0>{
class particles_generic_interp<double, 7,0>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_Lagrange_n3(in_derivative, in_part_val, poly_val);
beta_Lagrange_n7(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 3,1>{
class particles_generic_interp<double, 8,0>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n3_m1(in_derivative, in_part_val, poly_val);
beta_Lagrange_n8(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 3,2>{
class particles_generic_interp<double, 9,0>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n3_m2(in_derivative, in_part_val, poly_val);
beta_Lagrange_n9(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 4,0>{
class particles_generic_interp<double, 10,0>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_Lagrange_n4(in_derivative, in_part_val, poly_val);
beta_Lagrange_n10(in_derivative, in_part_val, poly_val);
}
};
/*****************************************************************************/
/*****************************************************************************/
/* spline C1 */
template <>
class particles_generic_interp<double, 4,1>{
class particles_generic_interp<double, 1,1>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n4_m1(in_derivative, in_part_val, poly_val);
beta_n1_m1(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 4,2>{
class particles_generic_interp<double, 2,1>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n4_m2(in_derivative, in_part_val, poly_val);
beta_n2_m1(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 5,0>{
class particles_generic_interp<double, 3,1>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_Lagrange_n5(in_derivative, in_part_val, poly_val);
beta_n3_m1(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 4,1>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n4_m1(in_derivative, in_part_val, poly_val);
}
};
......@@ -173,95 +191,127 @@ public:
};
template <>
class particles_generic_interp<double, 5,2>{
class particles_generic_interp<double, 6,1>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n5_m2(in_derivative, in_part_val, poly_val);
beta_n6_m1(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 7,1>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n7_m1(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 6,0>{
class particles_generic_interp<double, 8,1>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_Lagrange_n6(in_derivative, in_part_val, poly_val);
beta_n8_m1(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 6,1>{
class particles_generic_interp<double, 9,1>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n6_m1(in_derivative, in_part_val, poly_val);
beta_n9_m1(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 6,2>{
class particles_generic_interp<double, 10,1>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n6_m2(in_derivative, in_part_val, poly_val);
beta_n10_m1(in_derivative, in_part_val, poly_val);
}
};
/*****************************************************************************/
/*****************************************************************************/
/* spline C2 */
template <>
class particles_generic_interp<double, 7,0>{
class particles_generic_interp<double, 1,2>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_Lagrange_n7(in_derivative, in_part_val, poly_val);
beta_n1_m2(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 7,1>{
class particles_generic_interp<double, 2,2>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n7_m1(in_derivative, in_part_val, poly_val);
beta_n2_m2(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 7,2>{
class particles_generic_interp<double, 3,2>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n7_m2(in_derivative, in_part_val, poly_val);
beta_n3_m2(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 4,2>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n4_m2(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 8,0>{
class particles_generic_interp<double, 5,2>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_Lagrange_n8(in_derivative, in_part_val, poly_val);
beta_n5_m2(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 8,1>{
class particles_generic_interp<double, 6,2>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n8_m1(in_derivative, in_part_val, poly_val);
beta_n6_m2(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 7,2>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n7_m2(in_derivative, in_part_val, poly_val);
}
};
......@@ -275,67 +325,177 @@ public:
}
};
template <>
class particles_generic_interp<double, 9,2>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n9_m2(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 9, 0>{
class particles_generic_interp<double, 10,2>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_Lagrange_n9(in_derivative, in_part_val, poly_val);
beta_n10_m2(in_derivative, in_part_val, poly_val);
}
};
/*****************************************************************************/
/*****************************************************************************/
/* spline C3 */
template <>
class particles_generic_interp<double, 9,1>{
class particles_generic_interp<double, 3,3>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n9_m1(in_derivative, in_part_val, poly_val);
beta_n3_m3(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 9,2>{
class particles_generic_interp<double, 4,3>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n9_m2(in_derivative, in_part_val, poly_val);
beta_n4_m3(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 5,3>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n5_m3(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 10,0>{
class particles_generic_interp<double, 6,3>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_Lagrange_n10(in_derivative, in_part_val, poly_val);
beta_n6_m3(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 10,1>{
class particles_generic_interp<double, 7,3>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n10_m1(in_derivative, in_part_val, poly_val);
beta_n7_m3(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 10,2>{
class particles_generic_interp<double, 8,3>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n10_m2(in_derivative, in_part_val, poly_val);
beta_n8_m3(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 9,3>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n9_m3(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 10,3>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n10_m3(in_derivative, in_part_val, poly_val);
}
};
/*****************************************************************************/
/*****************************************************************************/
/* spline C4 */
template <>
class particles_generic_interp<double, 5,4>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n5_m4(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 6,4>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n6_m4(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 7,4>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n7_m4(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 8,4>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n8_m4(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 9,4>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n9_m4(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 10,4>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n10_m4(in_derivative, in_part_val, poly_val);
}
};
/*****************************************************************************/
#endif//PARTICLES_INTERP_SPLINE_HPP
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment