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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TurTLE
TurTLE
Commits
f8808bc9
"README.rst" did not exist on "809b71ad1b2f9c2891603d56600395736907c3ad"
Commit
f8808bc9
authored
9 years ago
by
Cristian Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
fix base_class value
parent
41dd558e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bfps/__main__.py
+19
-17
19 additions, 17 deletions
bfps/__main__.py
with
19 additions
and
17 deletions
bfps/__main__.py
+
19
−
17
View file @
f8808bc9
...
@@ -37,34 +37,36 @@ def main():
...
@@ -37,34 +37,36 @@ def main():
'
-v
'
,
'
--version
'
,
'
-v
'
,
'
--version
'
,
action
=
'
version
'
,
action
=
'
version
'
,
version
=
'
%(prog)s
'
+
bfps
.
__version__
)
version
=
'
%(prog)s
'
+
bfps
.
__version__
)
NSoptions
=
[
'
NavierStokes
'
,
'
NavierStokes-single
'
,
'
NavierStokes-double
'
,
'
NS
'
,
'
NS-single
'
,
'
NS-double
'
]
FRoptions
=
[
'
FluidResize
'
,
'
FluidResize-single
'
,
'
FluidResize-double
'
,
'
FR
'
,
'
FR-single
'
,
'
FR-double
'
]
parser
.
add_argument
(
parser
.
add_argument
(
'
base_class
'
,
'
base_class
'
,
choices
=
[
'
NavierStokes
'
,
choices
=
NSoptions
+
FRoptions
,
'
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.
if
opt
.
base_class
in
[
'
NavierStokes-double
'
,
if
'
double
'
in
opt
.
base_class
:
'
NS-double
'
,
'
FluidResize-double
'
,
'
FR-double
'
]:
precision
=
'
double
'
precision
=
'
double
'
else
:
else
:
precision
=
'
single
'
precision
=
'
single
'
c
=
eval
(
'
{0}(fluid_precision =
\'
{1}
\'
)
'
.
format
(
opt
.
base_class
,
precision
))
if
opt
.
base_class
in
NSoptions
:
base_class
=
NavierStokes
elif
opt
.
base_class
in
FRoptions
:
base_class
=
FluidResize
c
=
base_class
(
fluid_precision
=
precision
)
c
.
launch
(
args
=
sys
.
argv
[
2
:])
c
.
launch
(
args
=
sys
.
argv
[
2
:])
return
None
return
None
...
...
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