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; ...@@ -32,6 +32,9 @@ class particles_generic_interp;
#include "Lagrange_polys.hpp" #include "Lagrange_polys.hpp"
#include "spline.hpp" #include "spline.hpp"
/*****************************************************************************/
/* Lagrange interpolation */
template <> template <>
class particles_generic_interp<double, 1,0>{ class particles_generic_interp<double, 1,0>{
public: public:
...@@ -43,122 +46,137 @@ public: ...@@ -43,122 +46,137 @@ public:
}; };
template <> template <>
class particles_generic_interp<double, 1,1>{ class particles_generic_interp<double, 2,0>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 1,2>{ class particles_generic_interp<double, 3,0>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 2,0>{ class particles_generic_interp<double, 4,0>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 2,1>{ class particles_generic_interp<double, 5,0>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 2,2>{ class particles_generic_interp<double, 6,0>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 3,0>{ class particles_generic_interp<double, 7,0>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 3,1>{ class particles_generic_interp<double, 8,0>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 3,2>{ class particles_generic_interp<double, 9,0>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 4,0>{ class particles_generic_interp<double, 10,0>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 4,1>{ class particles_generic_interp<double, 1,1>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 4,2>{ class particles_generic_interp<double, 2,1>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 5,0>{ class particles_generic_interp<double, 3,1>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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: ...@@ -173,95 +191,127 @@ public:
}; };
template <> template <>
class particles_generic_interp<double, 5,2>{ class particles_generic_interp<double, 6,1>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 6,0>{ class particles_generic_interp<double, 8,1>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 6,1>{ class particles_generic_interp<double, 9,1>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 6,2>{ class particles_generic_interp<double, 10,1>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 7,0>{ class particles_generic_interp<double, 1,2>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 7,1>{ class particles_generic_interp<double, 2,2>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 7,2>{ class particles_generic_interp<double, 3,2>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 8,0>{ class particles_generic_interp<double, 5,2>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 8,1>{ class particles_generic_interp<double, 6,2>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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: ...@@ -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 <> template <>
class particles_generic_interp<double, 9, 0>{ class particles_generic_interp<double, 10,2>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 9,1>{ class particles_generic_interp<double, 3,3>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 9,2>{ class particles_generic_interp<double, 4,3>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 10,0>{ class particles_generic_interp<double, 6,3>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 10,1>{ class particles_generic_interp<double, 7,3>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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 <> template <>
class particles_generic_interp<double, 10,2>{ class particles_generic_interp<double, 8,3>{
public: public:
using real_number = double; using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const { 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);