Hi,
I am trying to change some of the values of the bilinear sparse matrix (a.mat) after the assemble statement (a.Assemble()) by making them equal zeros.
This is what I tried to do:
print(‘a.mat.nze1=’,a.mat.nze)
if fes.ndof > edges_no:
for i in range(edges_no):
for j in range(edges_no,fes.ndof+1):
if a.mat[i,j] != 0:
a.mat[i,j]=0
a.mat.Update()
print(‘a.mat.nze2=’,a.mat.nze)
But the number of non zeros of the matrix, before and after, is the same the change, which should be change.
I appreciate any clarification and help.
Note: Find attached a copy of the code
Attachment: Maxwell_FEP_Example1.py