v0.13.1
Functions | Variables
iterations Namespace Reference

Functions

def main ()
 
def get_data_from_string (data_string, columns, delimiter=' ')
 

Variables

int markersize = 6
 
int line_width = 2
 
int font_size = 12
 
string font_weight = 'normal'
 
int nb_columns = 2
 

Function Documentation

◆ get_data_from_string()

def iterations.get_data_from_string (   data_string,
  columns,
  delimiter = ' ' 
)

Definition at line 56 of file iterations.py.

56def get_data_from_string(data_string, columns, delimiter=' '):
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)
59 return my_data
60
def get_data_from_string(data_string, columns, delimiter=' ')
Definition: iterations.py:56

◆ main()

def iterations.main ( )

Definition at line 22 of file iterations.py.

22def main():
23 # my_data1=get_data_from_string(my_multiplicative, nb_columns)
24 # my_data2=get_data_from_string(my_additive, nb_columns)
25 # my_data3=get_data_from_string(my_multifield, nb_columns)
26 # my_data3[:,[0, 1]] = my_data3[:,[1, 0]]
27 # print(my_data1[:,1])
28 # 301 TS dt 0.0053405 time 1.24046
29 # grep "SNES Function norm" log_constraint_bc_old > log_constraint_bc
30 # grep "SNES Function norm" log_classical_bc_old > log_classical_bc
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"
33
34 newton_data1=pd.read_fwf(newton_log_file1, header=None)
35 newton_data2=pd.read_fwf(newton_log_file2, header=None)
36
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")
39
40 plt.legend(loc='upper right')
41
42 # plt.gca().set_xlim(left=0, right=None)
43 # plt.gca().set_ylim(bottom=0, top=None)
44
45 # plt.plot(newton_data[7].to_numpy(),'r^-')
46 plt.title('Newton method convergence')
47 plt.ylabel('absolute residual')
48 plt.xlabel('accumulated iterations')
49 plt.yscale('log')
50 plt.grid(True)
51 plt.show()
52 plt.savefig("my_log.png")
53
54 # tikzplotlib.save("my_graph.tex")
55
def main()
Definition: iterations.py:22

Variable Documentation

◆ font_size

int iterations.font_size = 12

Definition at line 10 of file iterations.py.

◆ font_weight

string iterations.font_weight = 'normal'

Definition at line 11 of file iterations.py.

◆ line_width

int iterations.line_width = 2

Definition at line 9 of file iterations.py.

◆ markersize

int iterations.markersize = 6

Definition at line 8 of file iterations.py.

◆ nb_columns

int iterations.nb_columns = 2

Definition at line 18 of file iterations.py.