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
f87dbb4b
Commit
f87dbb4b
authored
5 years ago
by
Cristian Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
adds parameters for Gauss field test
parent
fab7b536
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
TurTLE/TEST.py
+6
-5
6 additions, 5 deletions
TurTLE/TEST.py
cpp/full_code/Gauss_field_test.cpp
+12
-2
12 additions, 2 deletions
cpp/full_code/Gauss_field_test.cpp
cpp/full_code/Gauss_field_test.hpp
+5
-1
5 additions, 1 deletion
cpp/full_code/Gauss_field_test.hpp
with
23 additions
and
8 deletions
TurTLE/TEST.py
+
6
−
5
View file @
f87dbb4b
...
@@ -130,11 +130,12 @@ class TEST(_code):
...
@@ -130,11 +130,12 @@ class TEST(_code):
pars
[
'
tracers0_neighbours
'
]
=
int
(
1
)
pars
[
'
tracers0_neighbours
'
]
=
int
(
1
)
pars
[
'
tracers0_smoothness
'
]
=
int
(
1
)
pars
[
'
tracers0_smoothness
'
]
=
int
(
1
)
if
dns_type
==
'
Gauss_field_test
'
:
if
dns_type
==
'
Gauss_field_test
'
:
pars
[
'
histogram_bins
'
]
=
129
pars
[
'
histogram_bins
'
]
=
int
(
129
)
pars
[
'
max_velocity_estimate
'
]
=
8.
pars
[
'
max_velocity_estimate
'
]
=
float
(
8
)
pars
[
'
spectrum_slope
'
]
=
1.
pars
[
'
spectrum_slope
'
]
=
float
(
-
5.
/
3
)
pars
[
'
spectrum_k_cutoff
'
]
=
16.
pars
[
'
spectrum_k_cutoff
'
]
=
float
(
16
)
pars
[
'
spectrum_coefficient
'
]
=
1.
pars
[
'
spectrum_coefficient
'
]
=
float
(
1
)
pars
[
'
random_seed
'
]
=
int
(
1
)
return
pars
return
pars
def
get_kspace
(
self
):
def
get_kspace
(
self
):
kspace
=
{}
kspace
=
{}
...
...
This diff is collapsed.
Click to expand it.
cpp/full_code/Gauss_field_test.cpp
+
12
−
2
View file @
f87dbb4b
...
@@ -151,7 +151,11 @@ int Gauss_field_test<rnumber>::read_parameters()
...
@@ -151,7 +151,11 @@ int Gauss_field_test<rnumber>::read_parameters()
(
this
->
simname
+
std
::
string
(
".h5"
)).
c_str
(),
(
this
->
simname
+
std
::
string
(
".h5"
)).
c_str
(),
H5F_ACC_RDONLY
,
H5F_ACC_RDONLY
,
H5P_DEFAULT
);
H5P_DEFAULT
);
this
->
filter_length
=
hdf5_tools
::
read_value
<
double
>
(
parameter_file
,
"/parameters/filter_length"
);
this
->
max_velocity_estimate
=
hdf5_tools
::
read_value
<
double
>
(
parameter_file
,
"/parameters/max_velocity_estimate"
);
this
->
spectrum_slope
=
hdf5_tools
::
read_value
<
double
>
(
parameter_file
,
"/parameters/spectrum_slope"
);
this
->
spectrum_k_cutoff
=
hdf5_tools
::
read_value
<
double
>
(
parameter_file
,
"/parameters/spectrum_k_cutoff"
);
this
->
spectrum_coefficient
=
hdf5_tools
::
read_value
<
double
>
(
parameter_file
,
"/parameters/spectrum_coefficient"
);
this
->
random_seed
=
hdf5_tools
::
read_value
<
int
>
(
parameter_file
,
"/parameters/random_seed"
);
H5Fclose
(
parameter_file
);
H5Fclose
(
parameter_file
);
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
}
}
...
@@ -162,7 +166,13 @@ int Gauss_field_test<rnumber>::do_work(void)
...
@@ -162,7 +166,13 @@ int Gauss_field_test<rnumber>::do_work(void)
TIMEZONE
(
"Gauss_field_test::do_work"
);
TIMEZONE
(
"Gauss_field_test::do_work"
);
/// initialize vector Gaussian random field
/// initialize vector Gaussian random field
make_gaussian_random_field
(
this
->
kk
,
this
->
vector_field
,
3
);
make_gaussian_random_field
(
this
->
kk
,
this
->
vector_field
,
this
->
random_seed
,
this
->
spectrum_slope
,
this
->
spectrum_k_cutoff
,
this
->
spectrum_coefficient
);
/// impose divergence free condition while maintaining the energy of the field
/// impose divergence free condition while maintaining the energy of the field
this
->
kk
->
template
project_divfree
<
rnumber
>(
this
->
vector_field
->
get_cdata
(),
true
);
this
->
kk
->
template
project_divfree
<
rnumber
>(
this
->
vector_field
->
get_cdata
(),
true
);
...
...
This diff is collapsed.
Click to expand it.
cpp/full_code/Gauss_field_test.hpp
+
5
−
1
View file @
f87dbb4b
...
@@ -59,7 +59,11 @@ class Gauss_field_test: public test
...
@@ -59,7 +59,11 @@ class Gauss_field_test: public test
public:
public:
/* parameters that are read in read_parameters */
/* parameters that are read in read_parameters */
double
filter_length
;
double
max_velocity_estimate
;
double
spectrum_slope
;
double
spectrum_k_cutoff
;
double
spectrum_coefficient
;
int
random_seed
;
/* other stuff */
/* other stuff */
kspace
<
FFTW
,
SMOOTH
>
*
kk
;
kspace
<
FFTW
,
SMOOTH
>
*
kk
;
...
...
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