CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 (https://www.cfd-online.com/Forums/su2/)
-   -   Output of Jacobian matrix from SU2 (https://www.cfd-online.com/Forums/su2/159601-output-jacobian-matrix-su2.html)

kmandar September 18, 2015 15:34

Output of Jacobian matrix from SU2
 
Hi,

I am implementing a method of obtaining flow sensitivities using Continuum Sensitivity Method. My current focus is Euler analysis. In the process, I want to output the Jacobain matrix and punch the elements of the matrix with high precision to text file, similar to what is done in the restart file.

a) Is there already a routine to punch out a matrix which I may use?

b) Is the structure (i.e. which elements are nonzero) of the sparse matrix available? I see that it is initialized in CSysMatrix::Initialize, but I could not follow the code to understand the structure.


Thanks,
Mandar

kmandar September 26, 2015 12:15

I found these variables declared in matrix.hpp

Code:

    unsigned long *row_ptr;    /*!< \brief Pointers to the first element in each row. */
    unsigned long *col_ind;    /*!< \brief Column index for each of the elements in val(). */

I understand *row_ptr, but what is the meaning of *col_ind ?

I think these variables are related to the elements in the sparse matrix. Am I right?

Thanks,
Mandar

talbring October 6, 2015 04:51

Hi kmandar,

you are right, these variables are related to the sparse matrix entries. The matrix is stored using a (block) CRS format (http://netlib.org/linalg/html_templates/node91.html). To see how to loop through the entries take a look at the routine CSysMatrix::MatrixVectorProduct in matrix_structure.cpp.

kmandar October 7, 2015 14:15

Hi talbring,

Thanks a lot. This is very helpful.

Regards,
Mandar


All times are GMT -4. The time now is 13:35.