Skip to content
Snippets Groups Projects
Commit 8281d860 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

get around precision argument problem

parent 171ab746
No related branches found
No related tags found
No related merge requests found
......@@ -40,14 +40,31 @@ def main():
parser.add_argument(
'base_class',
choices = ['NavierStokes',
'FluidResize'],
'NavierStokes-single',
'NavierStokes-double',
'NS',
'NS-single',
'NS-double',
'FluidResize',
'FluidResize-single',
'FluidResize-double',
'FR',
'FR-single',
'FR-double'],
type = str)
# first option is the choice of base class or -h or -v
# all other options are passed on to the base_class instance
opt = parser.parse_args(sys.argv[1:2])
# error is thrown if first option is not a base class, so launch
# cannot be executed by mistake.
c = eval('{0}(fluid_precision = {1})'.format(opt.base_class, opt.precision))
if opt.base_class in ['NavierStokes-double',
'NS-double',
'FluidResize-double',
'FR-double']:
precision = 'double'
else:
precision = 'single'
c = eval('{0}(fluid_precision = {1})'.format(opt.base_class, precision))
c.launch(args = sys.argv[2:])
return None
......
......@@ -399,9 +399,5 @@ class _fluid_particle_base(_code):
self,
parser):
_code.specific_parser_arguments(self, parser)
parser.add_argument(
'--precision',
type = str, dest = 'precision',
default = 'single')
return None
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment