-
Notifications
You must be signed in to change notification settings - Fork 240
/
Group_template
29 lines (21 loc) · 1.01 KB
/
Group_template
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
from openmdao.core.group import Group
from openmdao.components.exec_comp import ExecComp
class {class_name}(Group):
def setup(self):
# most Group classes override setup() and use it to create subsystems, connections,
# and setup their linear and or nonlinear solvers. They can also declare design
# variables and constriants here.
### for example:
# indeps = self.add_subsystem('indeps', IndepVarComp())
# indeps.add_output('x', 3.0)
# self.add_subsystem('comp1', ExecComp('y=x*2.5'))
# self.add_subsystem('comp2', ExecComp('y=x-4.2'))
# self.connect('comp1.y', 'comp2.x')
# self.nonlinear_solver = NewtonSolver()
# self.nonlinear_solver.options['iprint'] = 2
# self.nonlinear_solver.options['maxiter'] = 20
# self.linear_solver = DirectSolver()
# self.add_design_var('indeps.x', lower=.5, upper=10)
# self.add_constraint('comp1.y', lower=-3.)
# self.add_objective('comp2.y')
pass