- Timestamp:
- 02/11/19 04:14:06 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/py3/classes/qmu/@dakota_method/dakota_method.py
r23677 r23709 1 1 #move this later 2 2 from helpers import * 3 4 from MatlabFuncs import * 3 5 import numpy as np 4 6 … … 44 46 45 47 def __init__(self,*args): 46 self.method =''47 self.type =''48 self.variables =[]49 self.lcspec =[]50 self.responses =[]51 self.ghspec =[]48 self.method ='' 49 self.type ='' 50 self.variables=[] 51 self.lcspec =[] 52 self.responses=[] 53 self.ghspec =[] 52 54 #properites 53 self.params =struct()55 self.params =struct() 54 56 55 57 @staticmethod … … 75 77 #given argument was a way of constructing a method 76 78 else: 77 mlist=[ 78 'dot_bfgs', 79 'dot_frcg', 80 'dot_mmfd', 81 'dot_slp', 82 'dot_sqp', 83 'npsol_sqp', 84 'conmin_frcg', 85 'conmin_mfd', 86 'optpp_cg', 87 'optpp_q_newton', 88 'optpp_fd_newton', 89 'optpp_newton', 90 'optpp_pds', 91 'asynch_pattern_search', 92 'coliny_cobyla', 93 'coliny_direct', 94 'coliny_ea', 95 'coliny_pattern_search', 96 'coliny_solis_wets', 97 'ncsu_direct', 98 'surrogate_based_local', 99 'surrogate_based_global', 100 'moga', 101 'soga', 102 'nl2sol', 103 'nlssol_sqp', 104 'optpp_g_newton', 105 'nond_sampling', 106 'nond_local_reliability', 107 'nond_global_reliability', 108 'nond_polynomial_chaos', 109 'nond_stoch_collocation', 110 'nond_evidence', 111 'dace', 112 'fsu_quasi_mc', 113 'fsu_cvt', 114 'vector_parameter_study', 115 'list_parameter_study', 116 'centered_parameter_study', 117 'multidim_parameter_study', 118 'bayes_calibration'] 79 mlist=['dot_bfgs', 80 'dot_frcg', 81 'dot_mmfd', 82 'dot_slp', 83 'dot_sqp', 84 'npsol_sqp', 85 'conmin_frcg', 86 'conmin_mfd', 87 'optpp_cg', 88 'optpp_q_newton', 89 'optpp_fd_newton', 90 'optpp_newton', 91 'optpp_pds', 92 'asynch_pattern_search', 93 'coliny_cobyla', 94 'coliny_direct', 95 'coliny_ea', 96 'coliny_pattern_search', 97 'coliny_solis_wets', 98 'ncsu_direct', 99 'surrogate_based_local', 100 'surrogate_based_global', 101 'moga', 102 'soga', 103 'nl2sol', 104 'nlssol_sqp', 105 'optpp_g_newton', 106 'nond_sampling', 107 'nond_local_reliability', 108 'nond_global_reliability', 109 'nond_polynomial_chaos', 110 'nond_stoch_collocation', 111 'nond_evidence', 112 'dace', 113 'fsu_quasi_mc', 114 'fsu_cvt', 115 'vector_parameter_study', 116 'list_parameter_study', 117 'centered_parameter_study', 118 'multidim_parameter_study', 119 'bayes_calibration'] 119 120 120 121 mlist2=[] … … 122 123 if strncmpi(method,mlist[i],len(method)): 123 124 mlist2.append(mlist[i]) 124 125 # check for a unique match in the list of methods 126 125 # check for a unique match in the list of methods 127 126 l = len(mlist2) 128 127 if l == 0: … … 134 133 135 134 # assign the default values for the method 135 # switch dm.method 136 136 if dm.method in ['dot_bfgs','dot_frcg']: 137 137 dm.type ='dot' 138 dm.variables=['continuous_design','continuous_state'] 138 dm.variables=['continuous_design', 139 'continuous_state'] 139 140 dm.lcspec =[] 140 141 dm.responses=['objective_function'] … … 151 152 elif dm.method in ['dot_mmfd','dot_slp','dot_sqp']: 152 153 dm.type ='dot' 153 dm.variables=['continuous_design','continuous_state'] 154 dm.variables=['continuous_design', 155 'continuous_state'] 154 156 dm.lcspec =['linear_inequality_constraint', 155 157 'linear_equality_constraint'] … … 236 238 dm.params.max_step=1000. 237 239 dm.params.gradient_tolerance=1.0e-4 238 elif dm.method in ['optpp_q_newton','optpp_fd_newton','optpp_newton']: 240 241 elif dm.method in ['optpp_q_newton', 242 'optpp_fd_newton', 243 'optpp_newton']: 239 244 dm.type ='optpp' 240 245 dm.variables=['continuous_design', … … 455 460 dm.params.vol_boxsize_limit=1.0e-8 456 461 457 # elif dm.method in ['surrogate_based_local', 458 # 'surrogate_based_global']: 462 #if dm.method in ['surrogate_based_local', 463 #'surrogate_based_global']: 464 459 465 elif dm.method == 'moga': 460 466 dm.type ='jega' … … 501 507 dm.params.postprocessor_type=False 502 508 dm.params.orthogonal_distance=[0.01] 509 503 510 elif dm.method == 'soga': 504 511 dm.type ='jega' … … 563 570 dm.params.covariance=0 564 571 dm.params.regression_stressbalances=False 572 565 573 elif dm.method == 'nlssol_sqp': 566 574 dm.type ='lsq' … … 619 627 dm.responses=['response_function'] 620 628 dm.ghspec =[] 621 # not documented, but apparently works629 # not documented, but apparently works 622 630 dm.params.output=False 623 631 dm.params.seed=False … … 658 666 dm.responses=['response_function'] 659 667 dm.ghspec =['grad'] 660 # not documented, but may work668 # not documented, but may work 661 669 dm.params.output=False 662 670 dm.params.x_gaussian_process=False … … 860 868 861 869 else: 862 raise RuntimeError('Unimplemented method: '+str(dm.method)+'.')870 raise RuntimeError('Unimplemented method: {}.'.format(dm.method)) 863 871 864 872 # if more than one argument, issue warning
Note:
See TracChangeset
for help on using the changeset viewer.