Commit 8281d860 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

get around precision argument problem

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