<s> """<STR_LIT>""" <EOL> from openmdao . main . api import Assembly <EOL> from openmdao . main . datatypes . api import Float <EOL> from m4 . doe import DOE <EOL> from m4 . mid_fidelity import MidFidelity <EOL> from m4 . dummy_components import Model_A2d , Model_B2d <EOL> class MyModel ( Assembly ) : <EOL> """<STR_LIT>""" <EOL> def configure ( self ) : <EOL> doe = self . add ( '<STR_LIT>' , DOE ( ) ) <EOL> doe . model = self . add ( '<STR_LIT>' , VarFi ( ) ) <EOL> doe . design_variables = [ ( '<STR_LIT:x>' , <NUM_LIT:0.> , <NUM_LIT> ) , ( '<STR_LIT:y>' , <NUM_LIT:0.> , <NUM_LIT> ) ] <EOL> doe . response_variables = [ ( '<STR_LIT>' ) , ( '<STR_LIT>' ) ] <EOL> doe . type = '<STR_LIT>' <EOL> doe . n_samples = <NUM_LIT:200> <EOL> def execute ( self ) : <EOL> """<STR_LIT>""" <EOL> super ( MyModel , self ) . execute ( ) <EOL> for i , case in enumerate ( self . M4_DOE . outerator ) : <EOL> print '<STR_LIT>' % ( i + <NUM_LIT:1> ) <EOL> for name , index , value in case . inputs : <EOL> print '<STR_LIT>' , name , index , value <EOL> if case . msg : <EOL> print '<STR_LIT>' % case . msg <EOL> else : <EOL> for name , index , value in case . outputs : <EOL> print '<STR_LIT>' , name , index , value <EOL> class VarFi ( MidFidelity ) : <EOL> """<STR_LIT>""" <EOL> x = Float ( value = <NUM_LIT:0.> , low = <NUM_LIT:0.> , high = <NUM_LIT> , iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> y = Float ( default_value = <NUM_LIT:0.> , low = <NUM_LIT:0.> , high = <NUM_LIT> , units = '<STR_LIT:m>' , iotype = '<STR_LIT>' , <EOL> desc = '<STR_LIT>' ) <EOL> z1 = Float ( <NUM_LIT:0.> , iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> z2 = Float ( <NUM_LIT:0.> , iotype = '<STR_LIT>' , <EOL> desc = '<STR_LIT>' ) <EOL> def __init__ ( self ) : <EOL> super ( VarFi , self ) . __init__ ( ) <EOL> self . rs_type = '<STR_LIT>' <EOL> self . n_samples = <NUM_LIT:20> <EOL> self . tolerance = <NUM_LIT> <EOL> self . correction_function = <NUM_LIT:2> <EOL> self . w_h = <NUM_LIT> <EOL> self . accuracy_test_type = <NUM_LIT:2> <EOL> self . set_hifi_model ( Model_A2d ( ) ) <EOL> self . set_lofi_model ( Model_B2d ( ) ) <EOL> self . add_input_mapping ( '<STR_LIT:x>' , '<STR_LIT:x>' , '<STR_LIT:x>' ) <EOL> self . add_input_mapping ( '<STR_LIT:y>' , '<STR_LIT:y>' , '<STR_LIT:y>' ) <EOL> self . add_output_mapping ( '<STR_LIT>' , '<STR_LIT:z>' , '<STR_LIT>' ) <EOL> self . add_output_mapping ( '<STR_LIT>' , '<STR_LIT:z>' , '<STR_LIT>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> top = MyModel ( ) <EOL> top . run ( ) </s>
