forked from BrieucD/prop-solid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lanceur_prop_solide.py
47 lines (38 loc) · 1.67 KB
/
lanceur_prop_solide.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- coding: utf-8 -*-
"""
lanceur_prop_solide.py generated by WhatsOpt 1.7.1
"""
from optparse import OptionParser
from openmdao.api import Problem
from openmdao.api import NonlinearBlockGS, ScipyKrylov
# from openmdao_extensions.reckless_nonlinear_block_gs import RecklessNonlinearBlockGS
from lanceur_prop_solide_base import LanceurPropSolideBase, LanceurPropSolideFactoryBase
class LanceurPropSolide(LanceurPropSolideBase):
""" An OpenMDAO component to encapsulate LanceurPropSolide analysis """
def __init__(self, **kwargs):
super(LanceurPropSolide, self).__init__(**kwargs)
# Example of manual solver adjusments (imports should be adjusted accordingly)
# self.nonlinear_solver = NewtonSolver()
# self.nonlinear_solver.options['maxiter'] = 20
# self.linear_solver = DirectSolver()
def setup(self):
super(LanceurPropSolide, self).setup()
class LanceurPropSolideFactory(LanceurPropSolideFactoryBase):
""" A factory to create disciplines of LanceurPropSolide analysis """
pass
if __name__ == "__main__":
parser = OptionParser()
parser.add_option("-n", "--no-n2", action="store_false", dest='n2_view', default=True,
help="display N2 openmdao viewer")
(options, args) = parser.parse_args()
problem = Problem()
problem.model = LanceurPropSolide()
problem.setup()
problem.final_setup()
if options.n2_view:
from packaging import version
if version.parse(OPENMDAO_VERSION) < version.parse("2.10.0"):
from openmdao.api import view_model as n2
else:
from openmdao.visualization.n2_viewer.n2_viewer import n2
n2(problem)