Commit cd0c9fcd authored by Mikkel Friis-Møller's avatar Mikkel Friis-Møller
Browse files

added bathymetry.ipynb

parent cba70b20
Pipeline #27975 passed with stages
in 14 minutes and 29 seconds
from openmdao.core.explicitcomponent import ExplicitComponent
from openmdao.drivers.genetic_algorithm_driver import SimpleGADriver
from topfarm.constraint_components.post_constraint import PostConstraint
import numpy as np
......@@ -34,6 +35,8 @@ class PostPenaltyComponent(ExplicitComponent):
if isinstance(comp[1], dict):
# for key in comp[1]:
self.add_input(comp[0], val=comp[1][next(iter(comp[1]))])
elif isinstance(comp, PostConstraint):
self.add_input(comp.key, val=comp.upper)
else:
self.add_input(comp[0], val=np.zeros(max([len(np.atleast_1d(c)) for c in comp[1:]])))
self.add_output('post_penalty', val=0.0)
......
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