diff --git a/examples/EvrardCollapse_3D/makeIC.py b/examples/EvrardCollapse_3D/makeIC.py index b68f0da0e1869ce54ae7ab2ad3b33b8c3deb8b51..f4d3c4c5bf7f91e5f79cfcd4e9ae23388932144e 100644 --- a/examples/EvrardCollapse_3D/makeIC.py +++ b/examples/EvrardCollapse_3D/makeIC.py @@ -18,9 +18,24 @@ ################################################################################ import h5py +import argparse as ap from numpy import * -# Generates a swift IC file for the Evrard collapse +parser = ap.ArgumentParser( + description="Generates a swift IC file for the Evrard collapse" +) + +parser.add_argument( + "-n", + "--nparts", + help=""" + Number of particles to be used in the Evrard collapse. + """, + required=False, + default=100000 +) + +args = vars(parser.parse_args()) # Parameters gamma = 5. / 3. # Gas adiabatic index @@ -28,7 +43,7 @@ M = 1. # total mass of the sphere R = 1. # radius of the sphere u0 = 0.05 / M # initial thermal energy fileName = "evrard.hdf5" -numPart = 100000 +numPart = int(args["nparts"]) r = R * sqrt(random.random(numPart)) phi = 2. * pi * random.random(numPart)