Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TurTLE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TurTLE
TurTLE
Commits
b1d4f6a2
Commit
b1d4f6a2
authored
5 years ago
by
Cristian Lalescu
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/spectrum_func' into develop
parents
ae604046
75ea2f36
No related branches found
No related tags found
No related merge requests found
Pipeline
#77092
passed
5 years ago
Stage: build
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+1
-0
1 addition, 0 deletions
CMakeLists.txt
cpp/spectrum_function.hpp
+32
-0
32 additions, 0 deletions
cpp/spectrum_function.hpp
with
33 additions
and
0 deletions
CMakeLists.txt
+
1
−
0
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
)
...
...
This diff is collapsed.
Click to expand it.
cpp/spectrum_function.hpp
0 → 100644
+
32
−
0
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
];
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment