Skip to content
Snippets Groups Projects
Commit c320b2ce authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

add more interpolation options

parent ae09da80
Branches
Tags
No related merge requests found
...@@ -40,6 +40,9 @@ ...@@ -40,6 +40,9 @@
#include "spline_n1.hpp" #include "spline_n1.hpp"
#include "spline_n2.hpp" #include "spline_n2.hpp"
#include "spline_n3.hpp" #include "spline_n3.hpp"
#include "spline_n4.hpp"
#include "spline_n5.hpp"
#include "spline_n6.hpp"
extern int myrank, nprocs; extern int myrank, nprocs;
...@@ -58,7 +61,10 @@ slab_field_particles<rnumber>::slab_field_particles( ...@@ -58,7 +61,10 @@ slab_field_particles<rnumber>::slab_field_particles(
assert((NCOMPONENTS % 3) == 0); assert((NCOMPONENTS % 3) == 0);
assert((INTERP_NEIGHBOURS == 1) || assert((INTERP_NEIGHBOURS == 1) ||
(INTERP_NEIGHBOURS == 2) || (INTERP_NEIGHBOURS == 2) ||
(INTERP_NEIGHBOURS == 3)); (INTERP_NEIGHBOURS == 3) ||
(INTERP_NEIGHBOURS == 4) ||
(INTERP_NEIGHBOURS == 5) ||
(INTERP_NEIGHBOURS == 6));
assert((INTEGRATION_STEPS <= 6) && assert((INTEGRATION_STEPS <= 6) &&
(INTEGRATION_STEPS >= 1)); (INTEGRATION_STEPS >= 1));
strncpy(this->name, NAME, 256); strncpy(this->name, NAME, 256);
...@@ -141,6 +147,75 @@ slab_field_particles<rnumber>::slab_field_particles( ...@@ -141,6 +147,75 @@ slab_field_particles<rnumber>::slab_field_particles(
break; break;
} }
break; break;
case 4:
//this->spline_formula = &slab_field_particles<rnumber>::spline_n3_formula;
assert(this->interp_smoothness >= 0 ||
this->interp_smoothness <= 4);
switch(this->interp_smoothness)
{
case 0:
this->compute_beta = &beta_n4_m0;
break;
case 1:
this->compute_beta = &beta_n4_m1;
break;
case 2:
this->compute_beta = &beta_n4_m2;
break;
case 3:
this->compute_beta = &beta_n4_m3;
break;
case 4:
this->compute_beta = &beta_n4_m4;
break;
}
break;
case 5:
//this->spline_formula = &slab_field_particles<rnumber>::spline_n3_formula;
assert(this->interp_smoothness >= 0 ||
this->interp_smoothness <= 4);
switch(this->interp_smoothness)
{
case 0:
this->compute_beta = &beta_n5_m0;
break;
case 1:
this->compute_beta = &beta_n5_m1;
break;
case 2:
this->compute_beta = &beta_n5_m2;
break;
case 3:
this->compute_beta = &beta_n5_m3;
break;
case 4:
this->compute_beta = &beta_n5_m4;
break;
}
break;
case 6:
//this->spline_formula = &slab_field_particles<rnumber>::spline_n3_formula;
assert(this->interp_smoothness >= 0 ||
this->interp_smoothness <= 4);
switch(this->interp_smoothness)
{
case 0:
this->compute_beta = &beta_n6_m0;
break;
case 1:
this->compute_beta = &beta_n6_m1;
break;
case 2:
this->compute_beta = &beta_n6_m2;
break;
case 3:
this->compute_beta = &beta_n6_m3;
break;
case 4:
this->compute_beta = &beta_n6_m4;
break;
}
break;
} }
// in principle only the buffer width at the top needs the +1, // in principle only the buffer width at the top needs the +1,
// but things are simpler if buffer_width is the same // but things are simpler if buffer_width is the same
......
This diff is collapsed.
/**********************************************************************
* *
* Copyright 2015 Max Planck Institute *
* for Dynamics and Self-Organization *
* *
* This file is part of bfps. *
* *
* bfps is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, either version 3 of the License, *
* or (at your option) any later version. *
* *
* bfps is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with bfps. If not, see <http://www.gnu.org/licenses/> *
* *
* Contact: Cristian.Lalescu@ds.mpg.de *
* *
**********************************************************************/
#ifndef SPLINE_N4
#define SPLINE_N4
void beta_n4_m0(int deriv, double x, double *poly_val);
void beta_n4_m1(int deriv, double x, double *poly_val);
void beta_n4_m2(int deriv, double x, double *poly_val);
void beta_n4_m3(int deriv, double x, double *poly_val);
void beta_n4_m4(int deriv, double x, double *poly_val);
void beta_n4_m5(int deriv, double x, double *poly_val);
void beta_n4_m6(int deriv, double x, double *poly_val);
void beta_n4_m7(int deriv, double x, double *poly_val);
void beta_n4_m8(int deriv, double x, double *poly_val);
#endif//SPLINE_N4
This diff is collapsed.
/**********************************************************************
* *
* Copyright 2015 Max Planck Institute *
* for Dynamics and Self-Organization *
* *
* This file is part of bfps. *
* *
* bfps is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, either version 3 of the License, *
* or (at your option) any later version. *
* *
* bfps is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with bfps. If not, see <http://www.gnu.org/licenses/> *
* *
* Contact: Cristian.Lalescu@ds.mpg.de *
* *
**********************************************************************/
#ifndef SPLINE_N5
#define SPLINE_N5
void beta_n5_m0(int deriv, double x, double *poly_val);
void beta_n5_m1(int deriv, double x, double *poly_val);
void beta_n5_m2(int deriv, double x, double *poly_val);
void beta_n5_m3(int deriv, double x, double *poly_val);
void beta_n5_m4(int deriv, double x, double *poly_val);
void beta_n5_m5(int deriv, double x, double *poly_val);
void beta_n5_m6(int deriv, double x, double *poly_val);
void beta_n5_m7(int deriv, double x, double *poly_val);
void beta_n5_m8(int deriv, double x, double *poly_val);
void beta_n5_m9(int deriv, double x, double *poly_val);
void beta_n5_m10(int deriv, double x, double *poly_val);
#endif//SPLINE_N5
This diff is collapsed.
/**********************************************************************
* *
* Copyright 2015 Max Planck Institute *
* for Dynamics and Self-Organization *
* *
* This file is part of bfps. *
* *
* bfps is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, either version 3 of the License, *
* or (at your option) any later version. *
* *
* bfps is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with bfps. If not, see <http://www.gnu.org/licenses/> *
* *
* Contact: Cristian.Lalescu@ds.mpg.de *
* *
**********************************************************************/
#ifndef SPLINE_N6
#define SPLINE_N6
void beta_n6_m0(int deriv, double x, double *poly_val);
void beta_n6_m1(int deriv, double x, double *poly_val);
void beta_n6_m2(int deriv, double x, double *poly_val);
void beta_n6_m3(int deriv, double x, double *poly_val);
void beta_n6_m4(int deriv, double x, double *poly_val);
void beta_n6_m5(int deriv, double x, double *poly_val);
void beta_n6_m6(int deriv, double x, double *poly_val);
void beta_n6_m7(int deriv, double x, double *poly_val);
void beta_n6_m8(int deriv, double x, double *poly_val);
void beta_n6_m9(int deriv, double x, double *poly_val);
void beta_n6_m10(int deriv, double x, double *poly_val);
void beta_n6_m11(int deriv, double x, double *poly_val);
void beta_n6_m12(int deriv, double x, double *poly_val);
#endif//SPLINE_N6
...@@ -53,7 +53,10 @@ src_file_list = ['field_descriptor', ...@@ -53,7 +53,10 @@ src_file_list = ['field_descriptor',
'tracers', 'tracers',
'spline_n1', 'spline_n1',
'spline_n2', 'spline_n2',
'spline_n3'] 'spline_n3',
'spline_n4',
'spline_n5',
'spline_n6']
header_list = ['cpp/base.hpp'] + ['cpp/' + fname + '.hpp' for fname in src_file_list] header_list = ['cpp/base.hpp'] + ['cpp/' + fname + '.hpp' for fname in src_file_list]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment