Skip to content

Commit

Permalink
0709 fixed merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Su Tian committed Jul 9, 2021
1 parent 894ab48 commit ac77a26
Showing 1 changed file with 0 additions and 52 deletions.
52 changes: 0 additions & 52 deletions msgpi/dakota_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,57 +114,6 @@ def process(fn_json_args, logger=None):
# rc = None
inter = {} # Intermediate values

<<<<<<< HEAD:dakota_interface.py
if type(interface_args['post_process']).__name__ == 'list':
for pp in interface_args['post_process']:
fn = pp[0] # function name
rn = pp[1] # response name
# print(rn)
args = pp[1:]
if fn == 'self':
r = bps[args[1]]
inter[rn] = bps[args[1]]
else:
r = eval(f'dpf.{fn}')(interface_args, params, bps, inter, *args)
# results[rn].function = r
for rn in results.descriptors:
if rn in inter.keys():
results[rn].function = inter[rn]

elif type(interface_args['post_process']).__name__ == 'dict':
# Location of the origin relative to a ref point
# e.g., leading edge of the airfoil
origin_ref_2 = interface_args['origin_ref_2']
sc_ref_2 = ms.shear_center[1] + origin_ref_2

for k, v in interface_args['post_process'].items():
# print('')
# print('v[0]:', v[0])
# print(type(v[0]).__name__)
if type(v[0]).__name__ == 'str' or type(v[0]).__name__ == 'unicode':
if v[0] == 'sc2_ref' or v[0] == 'scy_ref':
bp = sc_ref_2
else:
bp = ms.getBeamProperty(v[0])
# print('bp:', bp)
if v[1] == 'self':
r = bp
elif v[1] == 'abs_rel_diff':
r = np.abs((bp - v[2]) / v[2])
else:
r = eval('dpf.{0}'.format(v[1]))(bp, v[2])
elif type(v[0]).__name__ == 'list':
# bps = [ms.getBeamProperty(s) for s in v[0]]
bps = []
for s in v[0]:
if s == 'sc2_ref' or s == 'scy_ref':
bps.append(sc_ref_2)
else:
bps.append(ms.getBeamProperty(s))
r = eval('dpf.{0}'.format(v[1]))(bps, v[2])

results[k].function = r
=======

for pp in interface_args['post_process']:
fn = pp[0] # function name
Expand All @@ -182,7 +131,6 @@ def process(fn_json_args, logger=None):
for rn in results.descriptors:
if rn in inter.keys():
results[rn].function = inter[rn]
>>>>>>> 1.3.0:msgpi/dakota_interface.py


# Write output
Expand Down

0 comments on commit ac77a26

Please sign in to comment.