Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
SWIFT
SWIFTsim
Commits
dec4b91a
Commit
dec4b91a
authored
5 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Moved and documented parallel_replicatye_ICs.py script.
parent
db2de652
No related branches found
No related tags found
1 merge request
!930
Parco 2019 debug
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/parallel_replicate_ICs.py
+44
-0
44 additions, 0 deletions
tools/parallel_replicate_ICs.py
with
44 additions
and
0 deletions
examples/EAGLE_low_z/EAGLE_50
/parallel_replicate_ICs.py
→
tools
/parallel_replicate_ICs.py
+
44
−
0
View file @
dec4b91a
#!/usr/bin/env python
#
# Usage:
# python parallel_replicate_ICs.py EAGLE_ICs_50.hdf5 4
#
# Description:
# Reads in a ICs file and replicates the particles in each dimension Plots speed up, parallel efficiency and time to solution given a "timesteps" output file generated by SWIFT.
"""
Usage:
python parallel_replicate_ICs.py IC_file.hdf5 rep_fac
where IC_file.hdf5 is the ICs file that you want to replicate and rep_fac is the
replication factor in each dimension
Description:
Reads in a ICs file and replicates the particles in each dimension by the
replication factor given and write a new IC called IC_file_xrep_fac.hdf5.
Example:
python parallel_replicate_ICs.py EAGLE_ICs_50.hdf5 4
Running the above example will produce a tiled 50MPc box in each dimension to
give a 200MPc box.
Note: the script only replicates dark matter particles, but can be easily
extended to support other particle types.
This file is part of SWIFT.
Copyright (C) 2019 James Willis (james.s.willis@durham.ac.uk)
All Rights Reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import
h5py
as
h
import
numpy
as
np
...
...
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