2import matplotlib.pyplot
as plt
12plt.rcParams[
'figure.figsize'] = [16, 9]
13plt.rcParams[
'figure.dpi'] = 100
14plt.rcParams[
'font.family'] =
"DejaVu Serif"
15plt.rcParams[
'font.size'] = font_size
16plt.rcParams[
'font.weight'] = font_weight
31 newton_log_file1=
"/home/karol/mofem_install/users_modules_debug/multifield_plasticity/test_vertical_flow_form_3D/log_classical_bc"
32 newton_log_file2=
"/home/karol/mofem_install/users_modules_debug/multifield_plasticity/test_vertical_flow_form_3D/log_constraint_bc"
34 newton_data1=pd.read_fwf(newton_log_file1, header=
None)
35 newton_data2=pd.read_fwf(newton_log_file2, header=
None)
37 plt.plot(newton_data1[8].to_numpy(), ls=
'solid',lw=line_width, marker=
'o', markersize=markersize, c=
'blue', label=
"classical bc")
38 plt.plot(newton_data2[8].to_numpy(), ls=
'solid', lw=line_width, marker=
'x', markersize=markersize, c=
'orange', label=
"constraint bc")
40 plt.legend(loc=
'upper right')
46 plt.title(
'Newton method convergence')
47 plt.ylabel(
'absolute residual')
48 plt.xlabel(
'accumulated iterations')
52 plt.savefig(
"my_log.png")
57 my_data=np.fromstring(data_string, dtype=float, sep=delimiter)
58 my_data = my_data.reshape(int(my_data.size/nb_columns),nb_columns)
61if __name__ ==
'__main__':
def get_data_from_string(data_string, columns, delimiter=' ')