Skip to content
GitLab
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
b1d4f6a2
Commit
b1d4f6a2
authored
Jun 23, 2020
by
Cristian Lalescu
Browse files
Merge branch 'feature/spectrum_func' into develop
parents
ae604046
75ea2f36
Pipeline
#77092
passed with stages
in 18 minutes and 59 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
b1d4f6a2
...
...
@@ -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 @
b1d4f6a2
#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
Supports
Markdown
0%
Try again
or
attach a new 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