Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TurTLE
TurTLE
Commits
75ea2f36
Commit
75ea2f36
authored
Jun 23, 2020
by
Cristian Lalescu
Browse files
add class to hold numeric spectrum for subsequent use
parent
ae604046
Changes
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
75ea2f36
...
...
@@ -392,6 +392,7 @@ set(hpp_for_lib
${
PROJECT_SOURCE_DIR
}
/cpp/omputils.hpp
${
PROJECT_SOURCE_DIR
}
/cpp/shared_array.hpp
${
PROJECT_SOURCE_DIR
}
/cpp/spline.hpp
${
PROJECT_SOURCE_DIR
}
/cpp/spectrum_function.hpp
${
PROJECT_SOURCE_DIR
}
/cpp/full_code/ornstein_uhlenbeck_process.hpp
${
PROJECT_SOURCE_DIR
}
/cpp/full_code/ou_vorticity_equation.hpp
)
...
...
cpp/spectrum_function.hpp
0 → 100644
View file @
75ea2f36
#include<cmath>
#include<vector>
#include "kspace.hpp"
template
<
field_backend
be
,
kspace_dealias
type
dt
>
class
spectrum_function
{
private:
const
kspace
<
be
,
dt
>
*
kk
;
const
std
::
vector
<
double
>
values
;
public:
spectrum_function
(
const
kspace
<
be
,
dt
>
*
KK
,
const
std
::
vector
&
source_values
)
:
kk
(
KK
),
values
(
source_values
)
{
assert
(
this
->
values
.
size
()
==
this
->
kk
->
nshells
);
}
~
spectrum_function
(){}
double
operator
()(
double
kvalue
)
{
assert
(
kvalue
>=
double
(
0
));
int
index
=
floor
(
kvalue
/
this
->
kk
->
dk
);
assert
(
index
<
this
->
values
.
size
());
return
this
->
values
[
index
];
}
}
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