import numpy as np
from dat_to_file import DataToFile

path_prefix = r"C:\Users\asus\Desktop\DT_Crane_v3.0\APP_models_gyration_v2.0\\"

path_switch = r'pre_pedestal_gyration\\'
name = r'pre_pedestal_gyration_v2\\'
# 读取路径(读pre)
path_four_read = path_prefix + path_switch
# 写入路径
path_four_write = path_prefix + r"post_360\\"
# 网格类型
geometry_type = ['3D4_P']
# 训练自变量
degreeArr = [0, 21, 42, 64]
forceArr = [125, 250, 375, 500]
gyrationArr = [0, 22.5, 45]
combine = []

for iDegree in range(len(degreeArr)):
    for iForce in range(len(forceArr)):
        for iGyration in range(len(gyrationArr)):
            # combine.append((degreeArr[iDegree], forceArr[iForce]))
            combine.append(
                (degreeArr[iDegree], forceArr[iForce], gyrationArr[iGyration]))
fd = np.array(combine)
# print(fd)
dtf = DataToFile(path_four_read, path_four_write, geometry_type)
dtf.dataSaveToTXT_RBF(v_fd=fd, rbf_type='lin_a', which_part=name[4:-2])
Esempio n. 2
0
from dat_to_file import DataToFile

path_prefix = r"C:\Users\asus\Desktop\DT_Crane_v3.0\APP_models_gyration_v2.0\\"

path_switch = r'pre_pedestal_gyration\\'
name = r'pre_pedestal_gyration_v2\\'
# 读取路径(读pre)
path_four_read = path_prefix + path_switch
# 写入路径
path_four_write = path_prefix + r"post_360\\"
# 网格类型
geometry_type = ['3D4_P']
# 训练自变量
degreeArr = [0, 21, 42, 64]
forceArr = [125, 250, 375, 500]
gyrationArr = [0, 22.5, 45]
combine = []

for iDegree in range(len(degreeArr)):
    for iForce in range(len(forceArr)):
        for iGyration in range(len(gyrationArr)):
            # combine.append((degreeArr[iDegree], forceArr[iForce]))
            combine.append(
                (degreeArr[iDegree], forceArr[iForce], gyrationArr[iGyration]))
fd = np.array(combine)
# print(fd)
dtf = DataToFile(path_four_read, path_four_write, geometry_type)
dtf.dataToPostFile_v2_Bysorted(v_fd=fd,
                               rbf_type='lin_a',
                               which_part=name[4:-2])
Esempio n. 3
0
path_train_stress = r'stress_train\\'
path_read_train_stress = path_prefix + path_train_stress
path_read_real_stress = path_prefix + path_real_stress

path_real_displacement = r'dopAndCoord_point\\'
path_train_displacement = r'displacement_train\\'
path_read_train_displacement = path_prefix + path_train_displacement
path_read_real_displacement = path_prefix + path_real_displacement

# 网格类型
geometry_type = ['3D4_L']
# 训练自变量
# GPR
# fd_train = np.asarray([0, 21, 42, 64]).reshape(-1, 1)
# other
fd_train = np.asarray([0, 21, 42, 64])

# rbf_type='lin_a'
rbf_type = 'mq'
prs_type = 'simple'
# 训练模型
dtf_stress = DataToFile(path_read_train_stress, None, geometry_type)
# dtf_stress.dataToPostFile_paper_result_pulley(fd_train, path_real_data=path_read_real_stress, rbf_type=rbf_type)
dtf_stress.dataToPostFile_paper_result_pulley(
    fd_train, path_real_data=path_read_real_stress, rbf_type=prs_type)

dtf_dis = DataToFile(path_read_train_displacement, None, geometry_type)
# dtf_dis.dataToPostFile_paper_result_pulley(fd_train, path_real_data=path_read_real_displacement, rbf_type=rbf_type)
dtf_dis.dataToPostFile_paper_result_pulley(
    fd_train, path_real_data=path_read_real_displacement, rbf_type=prs_type)