Exporting mass matrix and load vector?

General discussions about how to formulate a script for FlexPDE.

Exporting mass matrix and load vector?

Postby Jared Barber on Wed May 10, 2017 9:47 am


I was trying to export mass matrices and load vectors when I saw something I did not expect.

Looking at the dbg file it appears the mass matrix for a given mesh refinement corresponds to the heading "SPACE JACOBIAN".

After the mass matrix appears a set of RHS and SOLUTION vectors. It seems that for a linear problem (like the one below that I used to check this out) there are nested iterations with the solution of the outermost iteration printed out at each outermost iteration step. Hence we see a handful of rhs's and solution's for each grid.

The issue is that the rhs, which I thought was the load vector, seems to change during these outermost iterations. I thought that for a given grid the load vector for a linear problem (and the below problem is linear) should not change.

Hopefully someone can help me understand what's going on here. Is RHS the load vector? If RHS is not the load vector, what is it? If RHS is not the load vector, where is the load vector stored? If RHS is the load vector, why is it changing?

Also while I am here, I don't suppose it might be possible to change the output for the matrix and load vector. Ideally, it would have more significant digits. Also, currently a lot of 0's are printed out though that might just be small numbers that look like zeros because only a few significant digits are printed out.

Typical mass matrix/load vector export:

reorder off
START(0,0) value(u) = 1 LINE TO (1,0) TO (1,1) TO (0,1) value(u) = 0 line TO CLOSE

Alright, have a good day.

Jared Barber
Posts: 37
Joined: Thu Jan 24, 2013 10:37 am

Re: Exporting mass matrix and load vector?

Postby moderator on Thu May 11, 2017 7:20 pm

With linear systems, FlexPDE iterates on residuals. The CG solution uses a scaled and preconditioned (actually, pre-and post-), so that minimization in the space of the CG solution is not necessarily minimization in physical space. So after solving the system, the new solution estimate is plugged in to the PDE and a new residual is calculated. Solving against this load produces a new perturbation in the solution estimate. This is repeated until the error tolerance is met or five iterations have been performed (a selectable count, define LINUPDATE). The matrix that is printed is the scaled but not preconditioned version, and it may be rescaled after the first pass. Unfortunately, all these prints were written for debugging purposes, and not for export/import of matrices and solutions.

I have added a facility to control the precision of the matrix output. It will be available in the next maintenance release.
Posts: 686
Joined: Tue Jan 11, 2011 1:45 pm

Return to FlexPDE Discussion

Who is online

Users browsing this forum: No registered users and 5 guests