これまでEMSolutionの入力ファイル(inputファイル)は固定フォーマットとしていましたが,この度JSONにも対応いたしました。
固定フォーマットは情報量が少なく,カラムでどのパラメータを設定すればよいのか慣れるまで難しいところがありますが,JSONフォーマットでは設定パラメータをキー(key)と値(value)で対応させているため,行数は長くなりますが可読性は上がるかと思います。 また,固定フォーマットは記述する順番に制約がありましたが,JSONフォーマットではそのような制約はありません。よく使用する項目を上に移動するなどのカスタマイズも可能です。 また,キーと値で読み込むため,コメントなどは新しいキーと値として記述することも可能です。
なお,リリース2024.11からは,従来のテキストベースのinputファイルでEMSolutionを実行すると,拡張子をjsonとしたJSONフォーマットのinputファイルが自動で作成されるようになっていますので,input.jsonへの移行もスムーズにできるかと思います。
JSONフォーマットの詳細説明は別途作成予定です。
{ “metaData” : { “EMSolutionVersion” : “2024.11.1”, “releaseDate” : “November 15, 2024”, “creationDate” : “Mon Dec 2 10:51:43 2024”, “comments” : “This file is converted from the EMSolution input data.” }, “0_Release_Number” : { “RLS_NO” : “r10.1” }, “1_Execution_Control” : { “PRE_PROCESSING” : 1, “MAKE_SYSTEM_MATRICES” : 1, “SOLVE_EQUATION” : 1, “POST_PROCESSING” : 1 }, “2_Analysis_Type” : { “STATIC” : 1, “AC” : 0, “TRANSIENT” : 0, “NON_LINEAR” : 1, “STEADY_CURRENT” : 0 }, “3_Potential_Gauge_Conditions” : { “POTENTIAL” : 0, “NODAL_FORCE_OPTION” : 0, “PHI_OPTION” : 0, “FIXED_COORDINATE” : 0, “TREE_GAUGE” : -1, “REGULARIZATION” : 1, “RENUMBERING” : 0, “SCALING” : 0, “LINE_SEARCH” : 0, “MATRIX_ASYMMETRICITY” : 0 }, “4_Shape_Function_Order_Added_Features” : { “NODE_ORDER” : 1, “EDGE_ORDER” : 1, “METRIC_MOD” : 0, “QUAD_TRI” : 0, “CALC_IND” : 0, “THIN_ELEM” : 0, “PARALLEL_NO” : 1, “PARALLEL_OPTION” : 0 }, “5_Convergence_Conditions” : { “ICCG_CONV” : 9.99999999999999955e-07, “ACCEL_FACTOR” : 1.02000000000000002e+00, “DIV_FACTOR” : 2.00000000000000000e+00, “DIV_ITERATIONS” : 10, “SOLVER” : 0, “THETA” : 6.66666699999999945e-01, “THETA_NETWORK” : 5.00000000000000000e-01, “THETA_MOTION” : 5.00000000000000000e-01, “MAX_ITERATIONS” : 0, “5_2_Nonlinear_Convergence_Condition” : { “NON_LINEAR_CONV” : 1.00000000000000002e-03, “RELAXATION” : 1.00000000000000000e+00, “NO_ITERATIONS” : 50, “INIT_OPTION” : 0, “ICCG_CONV_RATIO” : 0.00000000000000000e+00, “CHECK_B” : 0.00000000000000000e+00, “DELTA_A” : 0, “NON_LINEAR_METHOD” : 0 } }, “6_Gaussian_Integral_Point” : { “POINTS_IN_1D” : 3, “POINT_IN_TRIANGLE” : 7, “MAT_POINTS” : 1 }, “7_Initial_Conditions” : { “INITIAL_STEP” : -1, “DATA_TYPE” : 0, “INITIAL_PHASE” : 0.00000000000000000e+00, “MULTI” : 0, “OUTPUT_STEP_NO” : 0, “CYCLE_AC” : 0.00000000000000000e+00 }, “8_Calculation_Step” : { “NO_STEPS” : [ 4 ], “DELTA_TIME” : [ 1.00000000000000000e+00 ], “INITIAL_TIME” : 0.00000000000000000e+00, “CYCLE” : 0, “TP_EEC” : { “N_CORRECT” : 0, “N_BACK” : 0, “TP_EEC_OPTION” : 0, “MAX_NO_CORRECTION” : 0 } }, “9_Output_Step” : { “TIME_DIFF” : 3, “RESTART_FILE_OPTION” : 0, “ALL_STEP_OUTPUT” : 0, “OUTPUT_STEP_SET” : [ [ 1, 5, 1 ] ] }, “10_1_Input_Files” : { “INPUT_MESH_FILE” : 2, “UNIT” : 0, “NO_MESH” : 0, “MESHLESS” : 0 }, “10_2_Output_Files” : { “POST_DATA_FILE” : 5, “ELEM_OUT” : 1, “NODE_OUT” : 1, “AVERAGE” : 0, “WIDE” : 0 }, “10_3_Post_Files” : { “MESH” : 1, “CURRENT” : 0, “MAGNETIC” : 1, “FORCE_J_B” : 0, “FORCE_NODAL” : 1, “DISP” : 0, “HEAT” : 0 }, “11_Print_Output” : { “HEAT” : 0, “FORCE_NODAL” : { “TYPE” : 1 }, “MAG_FLUX” : { “LOOP_NODES” : [ [ 22733, 22771, 22809, 22847, 22885, 22923, 22961, 22960, 22959, 22958, 22957, 22956, 22955, 22954, 22953 ], [ 22754, 22792, 22830, 22868, 22906, 22944, 22982, 23020, 23058, 23096, 23134, 23172, 23210, 23209, 23208, 23207, 23206, 23205, 23204, 23203, 23202, 23164, 23126, 23088, 23050, 23012, 22974, 22936, 22898, 22860, 22822, 22784, 22746 ] ] } }, “12_Geometry” : { “GEOMETRY” : 0, “DELTA_Z_THETA” : 1.00000000000000000e+00 }, “13_Boundary_Conditions” : { “FAR_BOUNDARY_CONDITION” : 1, “PHI_BOUNDARY_CONDITION” : 0, “DISTANCE_JUDGE” : 1.00000000000000005e-04, “DIRICHLET_PLANE” : { “CXYZ” : [ [ 1.00000000000000000e+00, 0.00000000000000000e+00, 0.00000000000000000e+00, 0.00000000000000000e+00, 0 ], [ 0.00000000000000000e+00, 1.00000000000000000e+00, 0.00000000000000000e+00, 0.00000000000000000e+00, 0 ] ] } }, “16_Material_Properties” : { “EXTEND_TOTAL_for_COIL” : 1, “16_1_3D_Element_Properties” : [ { “MAT_ID” : 1, “POTENTIAL” : 1, “ElectricProperty” : { “conductivity” : { “comment” : “SIGMA_XYZ for anisotropic, or isotropic SIGMA if not defined.”, “SIGMA” : 0.00000000000000000e+00 } }, “MagneticProperty” : { “comment” : “MU_XYZ for anisotropic, or isotropic MU if not defined.”, “MU” : 1.00000000000000000e+00 } }, { “MAT_ID” : 11, “POTENTIAL” : 0, “ElectricProperty” : { “conductivity” : { “comment” : “SIGMA_XYZ for anisotropic, or isotropic SIGMA if not defined.”, “SIGMA” : 0.00000000000000000e+00 } }, “MagneticProperty” : { “comment” : “MU_XYZ for anisotropic, or isotropic MU if not defined.”, “MU” : 1.00000000000000000e+00, “BH_CURVE_ID” : 1 } }, { “MAT_ID” : 12, “POTENTIAL” : 0, “ElectricProperty” : { “conductivity” : { “comment” : “SIGMA_XYZ for anisotropic, or isotropic SIGMA if not defined.”, “SIGMA” : 0.00000000000000000e+00 } }, “MagneticProperty” : { “comment” : “MU_XYZ for anisotropic, or isotropic MU if not defined.”, “MU” : 1.00000000000000000e+00, “BH_CURVE_ID” : 1 } } ] }, “17_Field_Source” : [ { “COIL” : { “SERIES_ID” : 1, “TIME_ID” : 0, “IN_ROTOR” : 0, “POTENTIAL” : 0, “TO_MESHED_COIL” : 0, “data” : [ { “type” : “GCE”, “CURRENT” : 1.00000000000000000e+00, “S_XYZ” : [ 2.85000000000000010e-02, -1.45000000000000007e-02, 7.49999999999999972e-02 ], “E_XYZ” : [ 2.85000000000000010e-02, 1.45000000000000007e-02, 7.49999999999999972e-02 ], “W1_XYZ” : [ 0.00000000000000000e+00, 0.00000000000000000e+00, 4.83000000000000027e-02 ], “W2_XYZ” : [ 8.99999999999999932e-03, 0.00000000000000000e+00, 0.00000000000000000e+00 ], “COORD_ID” : 0 }, { “type” : “GCE”, “CURRENT” : 1.00000000000000000e+00, “S_XYZ” : [ 1.45000000000000007e-02, 2.85000000000000010e-02, 7.49999999999999972e-02 ], “E_XYZ” : [ -1.45000000000000007e-02, 2.85000000000000010e-02, 7.49999999999999972e-02 ], “W1_XYZ” : [ 0.00000000000000000e+00, 0.00000000000000000e+00, 4.83000000000000027e-02 ], “W2_XYZ” : [ 0.00000000000000000e+00, 8.99999999999999932e-03, 0.00000000000000000e+00 ], “COORD_ID” : 0 }, { “type” : “GCE”, “CURRENT” : 1.00000000000000000e+00, “S_XYZ” : [ -2.85000000000000010e-02, 1.45000000000000007e-02, 7.49999999999999972e-02 ], “E_XYZ” : [ -2.85000000000000010e-02, -1.45000000000000007e-02, 7.49999999999999972e-02 ], “W1_XYZ” : [ 0.00000000000000000e+00, 0.00000000000000000e+00, 4.83000000000000027e-02 ], “W2_XYZ” : [ -8.99999999999999932e-03, 0.00000000000000000e+00, 0.00000000000000000e+00 ], “COORD_ID” : 0 }, { “type” : “GCE”, “CURRENT” : 1.00000000000000000e+00, “S_XYZ” : [ -1.45000000000000007e-02, -2.85000000000000010e-02, 7.49999999999999972e-02 ], “E_XYZ” : [ 1.45000000000000007e-02, -2.85000000000000010e-02, 7.49999999999999972e-02 ], “W1_XYZ” : [ 0.00000000000000000e+00, 0.00000000000000000e+00, 4.83000000000000027e-02 ], “W2_XYZ” : [ 0.00000000000000000e+00, -8.99999999999999932e-03, 0.00000000000000000e+00 ], “COORD_ID” : 0 }, { “type” : “ARC”, “CURRENT” : 1.00000000000000000e+00, “XYZ” : [ 1.45000000000000007e-02, 1.45000000000000007e-02, 7.49999999999999972e-02 ], “RADIUS” : 1.40000000000000003e-02, “RADIAL_W” : 9.66000000000000053e-02, “AXIAL_W” : 1.79999999999999986e-02, “ALPHA” : 0.00000000000000000e+00, “BETA” : 0.00000000000000000e+00, “PHI1” : 0.00000000000000000e+00, “PHI2” : 9.00000000000000000e+01, “COORD_ID” : 0 }, { “type” : “ARC”, “CURRENT” : 1.00000000000000000e+00, “XYZ” : [ -1.45000000000000007e-02, 1.45000000000000007e-02, 7.49999999999999972e-02 ], “RADIUS” : 1.40000000000000003e-02, “RADIAL_W” : 9.66000000000000053e-02, “AXIAL_W” : 1.79999999999999986e-02, “ALPHA” : 0.00000000000000000e+00, “BETA” : 0.00000000000000000e+00, “PHI1” : 9.00000000000000000e+01, “PHI2” : 1.80000000000000000e+02, “COORD_ID” : 0 }, { “type” : “ARC”, “CURRENT” : 1.00000000000000000e+00, “XYZ” : [ -1.45000000000000007e-02, -1.45000000000000007e-02, 7.49999999999999972e-02 ], “RADIUS” : 1.40000000000000003e-02, “RADIAL_W” : 9.66000000000000053e-02, “AXIAL_W” : 1.79999999999999986e-02, “ALPHA” : 0.00000000000000000e+00, “BETA” : 0.00000000000000000e+00, “PHI1” : -1.80000000000000000e+02, “PHI2” : -9.00000000000000000e+01, “COORD_ID” : 0 }, { “type” : “ARC”, “CURRENT” : 1.00000000000000000e+00, “XYZ” : [ 1.45000000000000007e-02, -1.45000000000000007e-02, 7.49999999999999972e-02 ], “RADIUS” : 1.40000000000000003e-02, “RADIAL_W” : 9.66000000000000053e-02, “AXIAL_W” : 1.79999999999999986e-02, “ALPHA” : 0.00000000000000000e+00, “BETA” : 0.00000000000000000e+00, “PHI1” : -9.00000000000000000e+01, “PHI2” : 0.00000000000000000e+00, “COORD_ID” : 0 } ] } }, { “CIRCUIT” : { “REGION_FACTOR” : 4.00000000000000000e+00, “REGION_PARALLEL” : 1.00000000000000000e+00, “SERIES_IDS” : [ 1 ], “INDUCTANCE_MATRIX” : { “comment” : “IN_IND=0: lower triangular matrix. \n IN_IND=1: diagonal matrix. IN_ID=2 : not defined.”, “format” : “[1st row][2nd row][3rd row]”, “IN_IND” : 0, “MATRIX” : [ [ 0.00000000000000000e+00 ] ] }, “RESISTANCE_MATRIX” : { “comment” : “IN_IND=0: lower triangular matrix. \n IN_IND=1: diagonal matrix. IN_ID=2 : not defined.”, “format” : “[1st row][2nd row][3rd row]”, “IN_RES” : 0, “MATRIX” : [ [ 0.00000000000000000e+00 ] ] }, “CONNECTION_MATRIX” : { “comment” : “IN_CON=0: NO_SERIES * NO_POWER_SUPPLIES connection matrix. \n IN_CON=1: diagonal connection matrix.”, “IN_CON” : 0, “format” : “[1st row][2nd row][3rd row]”, “MATRIX” : [ [ 1.00000000000000000e+00 ] ] }, “POWER_SUPPLIES” : [ { “PS_ID” : 1, “TYPE” : 0, “TIME_ID” : 1, “INITIAL_CURRENT” : 0.00000000000000000e+00 } ] } } ], “18_Time_Function” : [ { “TIME_ID” : 1, “OPTION” : 1, “TIME” : [ 0.00000000000000000e+00, 1.00000000000000000e+00, 2.00000000000000000e+00, 3.00000000000000000e+00, 4.00000000000000000e+00 ], “VALUE” : [ 0.00000000000000000e+00, 1.00000000000000000e+03, 3.00000000000000000e+03, 4.50000000000000000e+03, 5.00000000000000000e+03 ] } ], “20_BH_Curve” : [ { “BH_CURVE_ID” : 1, “data” : { “H” : [ 0.00000000000000000e+00, 2.70000000000000000e+01, 5.80000000000000000e+01, 1.00000000000000000e+02, 1.53000000000000000e+02, 1.85000000000000000e+02, 2.05000000000000000e+02, 2.33000000000000000e+02, 2.55000000000000000e+02, 2.85000000000000000e+02, 3.20000000000000000e+02, 3.55000000000000000e+02, 4.05000000000000000e+02, 4.70000000000000000e+02, 5.55000000000000000e+02, 6.73000000000000000e+02, 8.36000000000000000e+02, 1.06500000000000000e+03, 1.22000000000000000e+03, 1.42000000000000000e+03, 1.72000000000000000e+03, 2.13000000000000000e+03, 2.67000000000000000e+03, 3.48000000000000000e+03, 4.50000000000000000e+03, 5.95000000000000000e+03, 7.65000000000000000e+03, 1.01000000000000000e+04, 1.30000000000000000e+04, 1.59000000000000000e+04, 2.11000000000000000e+04, 2.63000000000000000e+04, 3.29000000000000000e+04, 4.27000000000000000e+04, 6.17000000000000000e+04, 8.43000000000000000e+04, 1.10000000000000000e+05, 1.35000000000000000e+05, 6.26200000000000000e+06 ], “B” : [ 0.00000000000000000e+00, 1.00000000000000002e-02, 2.50000000000000014e-02, 5.00000000000000028e-02, 1.00000000000000006e-01, 1.49999999999999994e-01, 2.00000000000000011e-01, 2.99999999999999989e-01, 4.00000000000000022e-01, 5.00000000000000000e-01, 5.99999999999999978e-01, 6.99999999999999956e-01, 8.00000000000000044e-01, 9.00000000000000022e-01, 1.00000000000000000e+00, 1.10000000000000009e+00, 1.19999999999999996e+00, 1.30000000000000004e+00, 1.35000000000000009e+00, 1.39999999999999991e+00, 1.44999999999999996e+00, 1.50000000000000000e+00, 1.55000000000000004e+00, 1.60000000000000009e+00, 1.64999999999999991e+00, 1.69999999999999996e+00, 1.75000000000000000e+00, 1.80000000000000004e+00, 1.85000000000000009e+00, 1.89999999999999991e+00, 1.94999999999999996e+00, 2.00000000000000000e+00, 2.04999999999999982e+00, 2.10000000000000009e+00, 2.14999999999999991e+00, 2.20000000000000018e+00, 2.25000000000000000e+00, 2.29999999999999982e+00, 1.00000000000000000e+01 ] } } ] }
Pythonを使用したinput.jsonの読み込みとデータと編集例です。Time Functionを10倍して設定しなおしています。
# Read the JSON file
with open(input.json
, ‘r’) as file:
data = json.load(file)
# ’18_Time_Function’ of first data
time_function = data[“18_Time_Function”][0]
new_time_function = [x * 10 for x in time_function]
time_function[“VALUE”] = new_time_function
この先は会員の方のみご覧いただけます。
©2020 Science Solutions International Laboratory, Inc.
All Rights reserved.