Commit 166ea083 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

Merge branch 'feature/more-interpolations' into develop

parents 03c08dac 8ba63441
Pipeline #66965 passed with stage
in 6 minutes and 33 seconds
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#ifndef PARTICLES_GENERIC_INTERP_HPP #ifndef PARTICLES_GENERIC_INTERP_HPP
#define PARTICLES_GENERIC_INTERP_HPP #define PARTICLES_GENERIC_INTERP_HPP
template <class real_number, int interp_neighbours, int mode> template <class real_number, int interp_neighbours, int smoothness>
class particles_generic_interp; class particles_generic_interp;
#include "Lagrange_polys.hpp" #include "Lagrange_polys.hpp"
...@@ -350,6 +350,28 @@ public: ...@@ -350,6 +350,28 @@ public:
/*****************************************************************************/ /*****************************************************************************/
/* spline C3 */ /* spline C3 */
template <>
class particles_generic_interp<double, 1,3>{
// no such thing as C3 interpolant with just a 4-point kernel, so we just use C2
// this specialisation must exist, otherwise the template_double_for_if will fail
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);
}
};
template <>
class particles_generic_interp<double, 2,3>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n2_m3(in_derivative, in_part_val, poly_val);
}
};
template <> template <>
class particles_generic_interp<double, 3,3>{ class particles_generic_interp<double, 3,3>{
public: public:
...@@ -435,6 +457,48 @@ public: ...@@ -435,6 +457,48 @@ public:
/*****************************************************************************/ /*****************************************************************************/
/* spline C4 */ /* spline C4 */
template <>
class particles_generic_interp<double, 1,4>{
// no such thing as C4 interpolant with just a 4-point kernel, so we just use C2
// this specialisation must exist, otherwise the template_double_for_if will fail
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);
}
};
template <>
class particles_generic_interp<double, 2,4>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n2_m4(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 3,4>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n3_m4(in_derivative, in_part_val, poly_val);
}
};
template <>
class particles_generic_interp<double, 4,4>{
public:
using real_number = double;
void compute_beta(const int in_derivative, const double in_part_val, double poly_val[]) const {
beta_n4_m4(in_derivative, in_part_val, poly_val);
}
};
template <> template <>
class particles_generic_interp<double, 5,4>{ class particles_generic_interp<double, 5,4>{
public: public:
......
...@@ -291,7 +291,7 @@ inline std::unique_ptr<abstract_particles_system<partsize_t, particles_rnumber>> ...@@ -291,7 +291,7 @@ inline std::unique_ptr<abstract_particles_system<partsize_t, particles_rnumber>>
const int in_current_iteration){ const int in_current_iteration){
return Template_double_for_if::evaluate<std::unique_ptr<abstract_particles_system<partsize_t, particles_rnumber>>, return Template_double_for_if::evaluate<std::unique_ptr<abstract_particles_system<partsize_t, particles_rnumber>>,
int, 1, 11, 1, // interpolation_size int, 1, 11, 1, // interpolation_size
int, 0, 3, 1, // spline_mode int, 0, 5, 1, // spline_mode
particles_system_build_container<partsize_t, field_rnumber,be,fc,particles_rnumber, particles_system_build_container<partsize_t, field_rnumber,be,fc,particles_rnumber,
p2p_computer_empty<particles_rnumber,partsize_t>, p2p_computer_empty<particles_rnumber,partsize_t>,
particles_inner_computer_empty<particles_rnumber,partsize_t>, particles_inner_computer_empty<particles_rnumber,partsize_t>,
...@@ -321,7 +321,7 @@ inline std::unique_ptr<abstract_particles_system_with_p2p<partsize_t, particles_ ...@@ -321,7 +321,7 @@ inline std::unique_ptr<abstract_particles_system_with_p2p<partsize_t, particles_
const particles_rnumber cutoff){ const particles_rnumber cutoff){
return Template_double_for_if::evaluate<std::unique_ptr<abstract_particles_system_with_p2p<partsize_t, particles_rnumber, p2p_computer_class>>, return Template_double_for_if::evaluate<std::unique_ptr<abstract_particles_system_with_p2p<partsize_t, particles_rnumber, p2p_computer_class>>,
int, 1, 11, 1, // interpolation_size int, 1, 11, 1, // interpolation_size
int, 0, 3, 1, // spline_mode int, 0, 5, 1, // spline_mode
particles_system_build_container<partsize_t, field_rnumber,be,fc,particles_rnumber, particles_system_build_container<partsize_t, field_rnumber,be,fc,particles_rnumber,
p2p_computer_class, p2p_computer_class,
particles_inner_computer_class, particles_inner_computer_class,
......
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