This is just a part of the code, it takes around 5 min for each iteration ( for a single el) to execute.
The length of fieldvalues is in the order of 1e6. I believe that multiple appends are eating away the time, Is there any alternative way for this ?
PK2=[]
E_pl=[]
E_tot=[]
for k in range(103,109):
PK2_k=[]
E_pl_k=[]
E_tot_k=[]
b=frame.fieldOutputs['SDV'+str(k)]
fieldValues=b.values
for v in fieldValues:
PK2_k.append(v.data)
PK2.append(PK2_k)
b=frame.fieldOutputs['SDV'+str(k+6)]
fieldValues=b.values
for v in fieldValues:
E_tot_k.append(v.data)
E_tot.append(E_tot_k)
b=frame.fieldOutputs['SDV'+str(k+12)]
fieldValues=b.values
for v in fieldValues:
E_pl_k.append(v.data)
E_pl.append(E_pl_k)
t3=time.time()
print stepName,"All PK,E terms written",t3-at,"Sec"
PK2=np.array(PK2)
PK2=np.transpose(PK2)
E_tot=np.array(E_tot)
E_tot=np.transpose(E_tot)
E_pl=np.array(E_pl)
E_pl=np.transpose(E_pl)
Thanks in Advance !