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
61f3bcc3
Commit
61f3bcc3
authored
5 years ago
by
sniklas142
Browse files
Options
Downloads
Patches
Plain Diff
added vorticity field to ou process
parent
da0f1390
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cpp/full_code/ornstein_uhlenbeck_process.cpp
+34
-0
34 additions, 0 deletions
cpp/full_code/ornstein_uhlenbeck_process.cpp
cpp/full_code/ornstein_uhlenbeck_process.hpp
+3
-0
3 additions, 0 deletions
cpp/full_code/ornstein_uhlenbeck_process.hpp
with
37 additions
and
0 deletions
cpp/full_code/ornstein_uhlenbeck_process.cpp
+
34
−
0
View file @
61f3bcc3
...
@@ -28,6 +28,12 @@ ornstein_uhlenbeck_process<rnumber,be>::ornstein_uhlenbeck_process(
...
@@ -28,6 +28,12 @@ ornstein_uhlenbeck_process<rnumber,be>::ornstein_uhlenbeck_process(
nx
,
ny
,
nz
,
MPI_COMM_WORLD
,
FFTW_PLAN_RIGOR
);
nx
,
ny
,
nz
,
MPI_COMM_WORLD
,
FFTW_PLAN_RIGOR
);
*
this
->
ou_field
=
0.0
;
*
this
->
ou_field
=
0.0
;
this
->
ou_field
->
dft
();
//have it complex all zero TODO:Ask Chichi
this
->
ou_field
->
dft
();
//have it complex all zero TODO:Ask Chichi
this
->
ou_field_vort
=
new
field
<
rnumber
,
be
,
THREE
>
(
nx
,
ny
,
nz
,
MPI_COMM_WORLD
,
FFTW_PLAN_RIGOR
);
*
this
->
ou_field_vort
=
0.0
;
this
->
ou_field_vort
->
dft
();
this
->
B
=
new
field
<
rnumber
,
be
,
THREExTHREE
>
(
this
->
B
=
new
field
<
rnumber
,
be
,
THREExTHREE
>
(
nx
,
ny
,
nz
,
MPI_COMM_WORLD
,
FFTW_PLAN_RIGOR
);
nx
,
ny
,
nz
,
MPI_COMM_WORLD
,
FFTW_PLAN_RIGOR
);
...
@@ -48,6 +54,7 @@ ornstein_uhlenbeck_process<rnumber,be>::~ornstein_uhlenbeck_process()
...
@@ -48,6 +54,7 @@ ornstein_uhlenbeck_process<rnumber,be>::~ornstein_uhlenbeck_process()
TIMEZONE
(
"ornstein_uhlenbeck_process::~ornstein_uhlenbeck_process"
);
TIMEZONE
(
"ornstein_uhlenbeck_process::~ornstein_uhlenbeck_process"
);
delete
this
->
kk
;
delete
this
->
kk
;
delete
this
->
ou_field
;
delete
this
->
ou_field
;
delete
this
->
ou_field_vort
;
delete
this
->
B
;
delete
this
->
B
;
}
}
...
@@ -81,6 +88,9 @@ void ornstein_uhlenbeck_process<rnumber,be>::step(
...
@@ -81,6 +88,9 @@ void ornstein_uhlenbeck_process<rnumber,be>::step(
}
}
});
});
this
->
calc_ou_vorticity
();
// this->ou_field->symmetrize(); ???
// this->ou_field->symmetrize(); ???
}
}
...
@@ -244,6 +254,30 @@ void ornstein_uhlenbeck_process<rnumber,be>::add_to_field_gaussian(
...
@@ -244,6 +254,30 @@ void ornstein_uhlenbeck_process<rnumber,be>::add_to_field_gaussian(
);
);
}
}
template
<
class
rnumber
,
field_backend
be
>
void
ornstein_uhlenbeck_process
<
rnumber
,
be
>::
calc_ou_vorticity
(
void
)
{
this
->
kk
->
CLOOP_K2
(
[
&
](
ptrdiff_t
cindex
,
ptrdiff_t
xindex
,
ptrdiff_t
yindex
,
ptrdiff_t
zindex
,
double
k2
){
if
(
k2
<=
this
->
kk
->
kM2
)
{
this
->
ou_field_vort
->
cval
(
cindex
,
0
,
0
)
=
-
(
this
->
kk
->
ky
[
yindex
]
*
this
->
ou_field
->
cval
(
cindex
,
2
,
1
)
-
this
->
kk
->
kz
[
zindex
]
*
this
->
ou_field
->
cval
(
cindex
,
1
,
1
));
this
->
ou_field_vort
->
cval
(
cindex
,
0
,
1
)
=
(
this
->
kk
->
ky
[
yindex
]
*
this
->
ou_field
->
cval
(
cindex
,
2
,
0
)
-
this
->
kk
->
kz
[
zindex
]
*
this
->
ou_field
->
cval
(
cindex
,
1
,
0
));
this
->
ou_field_vort
->
cval
(
cindex
,
1
,
0
)
=
-
(
this
->
kk
->
kz
[
zindex
]
*
this
->
ou_field
->
cval
(
cindex
,
0
,
1
)
-
this
->
kk
->
kx
[
xindex
]
*
this
->
ou_field
->
cval
(
cindex
,
2
,
1
));
this
->
ou_field_vort
->
cval
(
cindex
,
1
,
1
)
=
(
this
->
kk
->
kz
[
zindex
]
*
this
->
ou_field
->
cval
(
cindex
,
0
,
0
)
-
this
->
kk
->
kx
[
xindex
]
*
this
->
ou_field
->
cval
(
cindex
,
2
,
0
));
this
->
ou_field_vort
->
cval
(
cindex
,
2
,
0
)
=
-
(
this
->
kk
->
kx
[
xindex
]
*
this
->
ou_field
->
cval
(
cindex
,
1
,
1
)
-
this
->
kk
->
ky
[
yindex
]
*
this
->
ou_field
->
cval
(
cindex
,
0
,
1
));
this
->
ou_field_vort
->
cval
(
cindex
,
2
,
1
)
=
(
this
->
kk
->
kx
[
xindex
]
*
this
->
ou_field
->
cval
(
cindex
,
1
,
0
)
-
this
->
kk
->
ky
[
yindex
]
*
this
->
ou_field
->
cval
(
cindex
,
0
,
0
));
}
else
std
::
fill_n
((
rnumber
*
)(
this
->
ou_field_vort
->
get_cdata
()
+
3
*
cindex
),
6
,
0.0
);
}
);
this
->
ou_field_vort
->
symmetrize
();
}
template
class
ornstein_uhlenbeck_process
<
float
,
FFTW
>;
template
class
ornstein_uhlenbeck_process
<
float
,
FFTW
>;
template
class
ornstein_uhlenbeck_process
<
double
,
FFTW
>;
template
class
ornstein_uhlenbeck_process
<
double
,
FFTW
>;
This diff is collapsed.
Click to expand it.
cpp/full_code/ornstein_uhlenbeck_process.hpp
+
3
−
0
View file @
61f3bcc3
...
@@ -22,6 +22,7 @@ class ornstein_uhlenbeck_process{
...
@@ -22,6 +22,7 @@ class ornstein_uhlenbeck_process{
double
ou_energy_amplitude
;
double
ou_energy_amplitude
;
field
<
rnumber
,
be
,
THREE
>
*
ou_field
;
field
<
rnumber
,
be
,
THREE
>
*
ou_field
;
field
<
rnumber
,
be
,
THREE
>
*
ou_field_vort
;
field
<
rnumber
,
be
,
THREExTHREE
>
*
B
;
field
<
rnumber
,
be
,
THREExTHREE
>
*
B
;
// field<rnumber,be,ONE> *number_of_modes;
// field<rnumber,be,ONE> *number_of_modes;
kspace
<
be
,
SMOOTH
>
*
kk
;
kspace
<
be
,
SMOOTH
>
*
kk
;
...
@@ -61,6 +62,8 @@ class ornstein_uhlenbeck_process{
...
@@ -61,6 +62,8 @@ class ornstein_uhlenbeck_process{
void
add_to_field_replace
(
void
add_to_field_replace
(
field
<
rnumber
,
be
,
THREE
>
*
src
);
field
<
rnumber
,
be
,
THREE
>
*
src
);
void
calc_ou_vorticity
(
void
);
};
};
...
...
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