Exemplo n.º 1
0
                      wrt_file)

    ## Convert the orientations from the calibration datasets from bunge euler angles
    ## to GSH coefficients
    gsh.euler_to_gsh(el, H, ns_cal, set_id_cal, step, wrt_file)

    ## Convert the orientations from the validation datasets from bunge euler angles
    ## to GSH coefficients
    gsh.euler_to_gsh(el, H, ns_val, set_id_val, step, wrt_file)

    ## Generate the fftn of the calibration microstructure function
    msf.micr_func(el, H, ns_cal, set_id_cal, step, wrt_file)

    ## Generate the fftn of the validation microstructure function
    msf.micr_func(el, H, ns_val, set_id_val, step, wrt_file)

    ## Perform the calibration
    for comp in compl:
        calibration.calibration_procedure(el, H, ns_cal, set_id_cal, step,
                                          comp, wrt_file)

    ## Perform the validation
    for comp in compl:
        validation.validation(el, H, ns_cal, ns_val, set_id_cal, set_id_val,
                              step, comp, wrt_file)

    comp_app = 0

    results.results_all(el, ns_val, set_id_val, step, 'epsilon', compl,
                        comp_app)
Exemplo n.º 2
0
        Hset = Hset_
        msg = "coefficients L=0-4"
        rr.WP(msg, wrt_file)
        rr.WP(msg, res_file)
        print(Hset)
    else:
        Hset = np.hstack([Hset_, ii])
        msg = "coefficients L=0-4 and coeff %s" % ii
        rr.WP(msg, wrt_file)
        rr.WP(msg, res_file)
        print(Hset)

    # Convert the orientations from the calibration datasets from bunge euler
    # angles to GSH coefficients
    gsh.euler_to_gsh(el, Hset, ns_cal, set_id_cal, step, wrt_file)

    # Convert the orientations from the validation datasets from bunge euler
    # angles to GSH coefficients
    gsh.euler_to_gsh(el, Hset, ns_val, set_id_val, step, wrt_file)

    # Perform the calibration
    calibration.calibration_procedure(el, Hset.size, ns_cal, set_id_cal, step,
                                      comp, 'epsilon_t', wrt_file)

    # Perform the validation
    validation.validation(el, Hset.size, ns_cal, ns_val, set_id_cal,
                          set_id_val, step, comp, 'epsilon_t', wrt_file)

    results.results(el, ns_val, set_id_val, step, 'epsilon', comp, 't', ii,
                    res_file, res_file2)
ns_cal = 40
ns_val = 10
set_id_val = 'val'
set_id_cal = 'cal'
wrt_file = 'log_file.txt'

X_cal = X[0:ns_cal, ...]
X_val = X[ns_cal:, ...]

y_cal = y[0:ns_cal, ...]
y_val = y[ns_cal:, ...]

# take fft of response fields
y_fft_cal = np.fft.fftn(y_cal, axes=[1, 2, 3])
y_fft_val = np.fft.fftn(y_val, axes=[1, 2, 3])

# Convert the orientations from the calibration datasets from bunge euler
# angles to GSH coefficients
M_cal = gsh.euler_to_gsh(X_cal, el, H, ns_cal, set_id_cal, wrt_file)

# Convert the orientations from the validation datasets from bunge euler
# angles to GSH coefficients
M_val = gsh.euler_to_gsh(X_val, el, H, ns_val, set_id_val, wrt_file)

# Perform the calibration
infl_coef = calibration.calibration_procedure(M_cal, y_fft_cal, el, H, ns_cal, wrt_file)

# Perform the validation
y_mks = validation.validation(M_val, infl_coef, el, wrt_file)

results.results(infl_coef, y_val, y_mks, el, ns_val)
Exemplo n.º 4
0
set_id_val = 'valRpc'

wrt_file = 'log_order%s_%s%s_%s%s_%s.txt' % (order, ns_cal, set_id_cal, ns_val,
                                             set_id_val,
                                             time.strftime("%Y-%m-%d_h%Hm%M"))

### TOTAL CALIBRATION PROCEDURE ###

## Read the calibration microstructures and build the microstructure function
msf.msf(el_cal, ns_cal, Hi, H, order, set_id_cal, wrt_file)

## Read the responses from the FE .dat files and perform the fftn for the calibration
fegrab.fegrab(el_cal, ns_cal, set_id_cal, wrt_file)

## Perform the calibration
calibration.calibration_procedure(el_cal, ns_cal, H, set_id_cal, wrt_file)

### TOTAL VALIDATION PROCEDURE ###

## Read the validation microstructures and build the microstructure function
msf.msf(el_val, ns_val, Hi, H, order, set_id_val, wrt_file)

## Read the responses from the FE .dat files and perform the fftn for the validation
fegrab.fegrab(el_val, ns_val, set_id_val, wrt_file)

## Perform the validation
validation_viz.validation_zero_pad(el_cal, el_val, ns_cal, ns_val, H,
                                   set_id_cal, set_id_val, wrt_file)

## Calculate the results of the validation
results.results(el_val, ns_val, set_id_val, 'epsilon', wrt_file)
vtk.read_euler(ns_val, set_id_val, vtk_filename, dir_val, wrt_file)

for comp in xrange(9):
    vtk.read_meas(ns_val, set_id_val, comp, vtk_filename, tensor_ID, dir_val,
                  wrt_file)

## Convert the orientations from the calibration datasets from bunge euler angles
## to GSH coefficients
gsh.euler_to_gsh(ns_cal, set_id_cal, wrt_file)

## Convert the orientations from the validation datasets from bunge euler angles
## to GSH coefficients
gsh.euler_to_gsh(ns_val, set_id_val, wrt_file)

## Generate the fftn of the calibration microstructure function
msf.micr_func(ns_cal, set_id_cal, wrt_file)

## Generate the fftn of the validation microstructure function
msf.micr_func(ns_val, set_id_val, wrt_file)

## Perform the calibration
for comp in xrange(9):
    calibration.calibration_procedure(ns_cal, set_id_cal, comp, wrt_file)

## Perform the validation
for comp in xrange(9):
    validation.validation_procedure(ns_cal, ns_val, set_id_cal, set_id_val,
                                    comp, wrt_file)

results.results_all(ns_val, set_id_val, 'sigma')