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

Hello,

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:

SELECT
print(matrix)
print(grid)
reorder off
VARIABLES
u
EQUATIONS
div(grad(u))=0
BOUNDARIES
REGION 1
START(0,0) value(u) = 1 LINE TO (1,0) TO (1,1) TO (0,1) value(u) = 0 line TO CLOSE
MONITORS
PLOTS
CONTOUR(u)
END

Alright, have a good day.

Jared
Jared Barber
 
Posts: 46
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.
moderator
 
Posts: 711
Joined: Tue Jan 11, 2011 1:45 pm

Re: Exporting mass matrix and load vector?

Postby Jared Barber on Fri Mar 23, 2018 11:19 am

Hello,

Are there any updates on this (i.e. increased precision)?

Also, is there such a facility for this in FlexPDE7? I tried print(matrix), print(grid), reorder off but can't find where FlexPDE7 may have hidden the information.

We are interested in comparing multiple different methods (all employed using FlexPDE) and believe that having a reasonably accurate estimate of the matrix condition number, during all iterations if possible, would help our comparison. Any ideas on how to get that? We could extract it from the matrix printouts but perhaps there is something easier we could try? Perhaps it is already there?

Any info on these things would be helpful. Thanks,

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

Re: Exporting mass matrix and load vector?

Postby moderator on Mon Mar 26, 2018 3:44 pm

We have posted developmental version 7.10x3 at http://www.pdesolutions.com/download/xf ... 3win64.exe
In this version, we have done two things:
1) For some reason, the PRINT(MATRIX) selector was never activated in the FlexPDE 7 release version. We have now made it functional. You will get the coupling matrix and RHS every time FlexPDE calls the solver. But reading the output requires some explanation: FlexPDE7 reorders the coupling matrix so that rows are grouped in what we call the I,B,G and K blocks. The I block is the interior nodes, the B block is the (value) boundary nodes, G is the global equations and K is the constraints. The matrix printout is presented as the sixteen matrix blocks II,IB,IG,IK, BI,BB,BG,BK, GI,GB,GG,GK, KI,KB,KG,KK, describing the internal-internal coupling, internal-boundary coupling, etc. There is a reordering map which is not printed, but we can make it available if you need it.
We have added a second command, PRINT(MATRIX15), which will export the same data, but with 15 digits of precision in the values. (This was not the ideal way to do it, but there is no mechanism to specify arbitrary integers in the DEBUG/PRINT handler.)
2) There is a facility which has heretofore been accessible only in our debug versions to compute the eigenvalues of the coupling matrix. We have now made this available in the release version. SELECT DEBUG(MXMODES) to activate this facility. It will print two blocks of data, LambdaR ad LambdaI, the real and imaginary parts of the eigenvalues. It is similar to the DIRECT option, in that it expands the matrix from sparse storage into full storage, so it is a memory hog.
moderator
 
Posts: 711
Joined: Tue Jan 11, 2011 1:45 pm

Exporting mass matrix and load vector?

Postby Jared Barber on Thu Mar 29, 2018 1:28 pm

Hello,

Just thought I would note that I am currently running flexpde7 on linux. Hopefully we can get a linux version of 710x3 sometime soon. Thanks,

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

Re: Exporting mass matrix and load vector?

Postby moderator on Thu Mar 29, 2018 1:59 pm

We have formally released 7.10 on all platforms. The changes made in 7.10x3 are present in that release.
moderator
 
Posts: 711
Joined: Tue Jan 11, 2011 1:45 pm

Re: Exporting mass matrix and load vector?

Postby Jared Barber on Fri Mar 30, 2018 2:14 pm

Oh, ok, thanks. Seems to work. Should be pretty easy to get the condition number using the eigenvalues. Have a good day.
Jared Barber
 
Posts: 46
Joined: Thu Jan 24, 2013 10:37 am


Return to FlexPDE Discussion

Who is online

Users browsing this forum: No registered users and 2 guests