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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TurTLE
TurTLE
Commits
ce31e6fa
There was a problem fetching the pipeline summary.
Commit
ce31e6fa
authored
Aug 18, 2017
by
Cristian Lalescu
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/sample-particle-positions' into develop
Add method to ``sample'' particle positions.
parents
6391eed6
cf6ee072
No related branches found
No related tags found
1 merge request
!23
WIP: Feature/use cmake
Pipeline
#
Changes
3
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
bfps/DNS.py
+1
-0
1 addition, 0 deletions
bfps/DNS.py
bfps/cpp/full_code/NSVEparticles.cpp
+8
-0
8 additions, 0 deletions
bfps/cpp/full_code/NSVEparticles.cpp
bfps/cpp/particles/particles_sampling.hpp
+33
-1
33 additions, 1 deletion
bfps/cpp/particles/particles_sampling.hpp
with
42 additions
and
1 deletion
bfps/DNS.py
+
1
−
0
View file @
ce31e6fa
...
@@ -865,6 +865,7 @@ class DNS(_code):
...
@@ -865,6 +865,7 @@ class DNS(_code):
rseed
=
opt
.
particle_rand_seed
)
rseed
=
opt
.
particle_rand_seed
)
if
not
os
.
path
.
exists
(
self
.
get_particle_file_name
()):
if
not
os
.
path
.
exists
(
self
.
get_particle_file_name
()):
with
h5py
.
File
(
self
.
get_particle_file_name
(),
'
w
'
)
as
particle_file
:
with
h5py
.
File
(
self
.
get_particle_file_name
(),
'
w
'
)
as
particle_file
:
particle_file
.
create_group
(
'
tracers0/position
'
)
particle_file
.
create_group
(
'
tracers0/velocity
'
)
particle_file
.
create_group
(
'
tracers0/velocity
'
)
particle_file
.
create_group
(
'
tracers0/acceleration
'
)
particle_file
.
create_group
(
'
tracers0/acceleration
'
)
return
None
return
None
...
...
...
...
This diff is collapsed.
Click to expand it.
bfps/cpp/full_code/NSVEparticles.cpp
+
8
−
0
View file @
ce31e6fa
...
@@ -77,6 +77,14 @@ int NSVEparticles<rnumber>::do_stats()
...
@@ -77,6 +77,14 @@ int NSVEparticles<rnumber>::do_stats()
if
(
!
(
this
->
iteration
%
this
->
niter_part
==
0
))
if
(
!
(
this
->
iteration
%
this
->
niter_part
==
0
))
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
/// sample position
sample_particles_system_position
(
this
->
ps
,
(
this
->
simname
+
"_particles.h5"
),
// filename
"tracers0"
,
// hdf5 parent group
"position"
// dataset basename TODO
);
/// sample velocity
/// sample velocity
sample_from_particles_system
(
*
this
->
tmp_vec_field
,
// field to save
sample_from_particles_system
(
*
this
->
tmp_vec_field
,
// field to save
this
->
ps
,
this
->
ps
,
...
...
...
...
This diff is collapsed.
Click to expand it.
bfps/cpp/particles/particles_sampling.hpp
+
33
−
1
View file @
ce31e6fa
...
@@ -48,5 +48,37 @@ void sample_from_particles_system(const field<rnumber, be, fc>& in_field, // a p
...
@@ -48,5 +48,37 @@ void sample_from_particles_system(const field<rnumber, be, fc>& in_field, // a p
ps
->
get_step_idx
());
ps
->
get_step_idx
());
}
}
#endif
template
<
class
partsize_t
,
class
particles_rnumber
>
void
sample_particles_system_position
(
std
::
unique_ptr
<
abstract_particles_system
<
partsize_t
,
particles_rnumber
>>&
ps
,
// a pointer to an particles_system<double>
const
std
::
string
&
filename
,
const
std
::
string
&
parent_groupname
,
const
std
::
string
&
fname
){
const
std
::
string
datasetname
=
fname
+
std
::
string
(
"/"
)
+
std
::
to_string
(
ps
->
get_step_idx
());
// Stop here if already exists
if
(
particles_output_sampling_hdf5
<
partsize_t
,
particles_rnumber
,
3
,
3
>::
DatasetExistsCol
(
MPI_COMM_WORLD
,
filename
,
parent_groupname
,
datasetname
)){
return
;
}
const
partsize_t
nb_particles
=
ps
->
getLocalNbParticles
();
std
::
unique_ptr
<
particles_rnumber
[]
>
sample_rhs
(
new
particles_rnumber
[
3
*
nb_particles
]);
std
::
copy
(
ps
->
getParticlesPositions
(),
ps
->
getParticlesPositions
()
+
3
*
nb_particles
,
sample_rhs
.
get
());
particles_output_sampling_hdf5
<
partsize_t
,
particles_rnumber
,
3
,
3
>
outputclass
(
MPI_COMM_WORLD
,
ps
->
getGlobalNbParticles
(),
filename
,
parent_groupname
,
datasetname
);
outputclass
.
save
(
ps
->
getParticlesPositions
(),
&
sample_rhs
,
ps
->
getParticlesIndexes
(),
ps
->
getLocalNbParticles
(),
ps
->
get_step_idx
());
}
#endif//PARTICLES_SAMPLING_HPP
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
sign in
to comment