Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TurTLE
TurTLE
Commits
8ba63441
Commit
8ba63441
authored
Jan 14, 2020
by
Cristian Lalescu
Browse files
allow for smoother interpolations
parent
03c08dac
Changes
2
Hide whitespace changes
Inline
Side-by-side
cpp/particles/particles_generic_interp.hpp
View file @
8ba63441
...
...
@@ -26,7 +26,7 @@
#ifndef PARTICLES_GENERIC_INTERP_HPP
#define PARTICLES_GENERIC_INTERP_HPP
template
<
class
real_number
,
int
interp_neighbours
,
int
mo
de
>
template
<
class
real_number
,
int
interp_neighbours
,
int
s
mo
othness
>
class
particles_generic_interp
;
#include "Lagrange_polys.hpp"
...
...
@@ -350,6 +350,28 @@ public:
/*****************************************************************************/
/* 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
<
>
class
particles_generic_interp
<
double
,
3
,
3
>
{
public:
...
...
@@ -435,6 +457,48 @@ public:
/*****************************************************************************/
/* 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
<
>
class
particles_generic_interp
<
double
,
5
,
4
>
{
public:
...
...
cpp/particles/particles_system_builder.hpp
View file @
8ba63441
...
...
@@ -291,7 +291,7 @@ inline std::unique_ptr<abstract_particles_system<partsize_t, particles_rnumber>>
const
int
in_current_iteration
){
return
Template_double_for_if
::
evaluate
<
std
::
unique_ptr
<
abstract_particles_system
<
partsize_t
,
particles_rnumber
>>
,
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
,
p2p_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_
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
>>
,
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
,
p2p_computer_class
,
particles_inner_computer_class
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment