Hello,

The code is related to the file cook_membrane.cc.


I added the content below in main function
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
        double **get_matrix=new double*[get_rows];
        for(int i=0;i<get_rows;i++){
           get_matrix[i]=new double[get_cols];


        }

         for(int i=0;i<get_rows;i++){
            for(int j=0;j<get_cols;j++){
                 get_matrix[i][j]=double(solid_3d.tangent_matrix(i,j));

             }
          }
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
But I got error by using gdb 
:[Thread 0x7fffd67fc640 (LWP 114719) exited]

Thread 1 "cook_membrane" received signal SIGSEGV, Segmentation fault.
0x00005555555be580 in dealii::BlockMatrixBase<dealii::SparseMatrix<double> 
>::operator() (j=24, i=0, this=0x7fffffffdde8) at 
/usr/include/deal.II/lac/block_matrix_base.h:2112
2112                                                  col_index.second);
(gdb) exit
A debugging session is active.

Inferior 1 [process 113432] will be killed.


But from the process information it seems the compiling is successful  and 
some result can be displayed.

In code,I wrote the content 2d array to obtain the value from 
solid_3d.tangent_matrix for inverse matrix:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

      std::cout<< "L1 norm:"<<solid_3d.system_rhs.l1_norm()<<std::endl;
         std::cout<< "L2 norm:"<<solid_3d.system_rhs.l2_norm()<<std::endl;

         int get_rows=solid_3d.tangent_matrix.m();
         int get_cols=solid_3d.tangent_matrix.n();


        double **get_matrix=new double*[get_rows];
        for(int i=0;i<get_rows;i++){
           get_matrix[i]=new double[get_cols];


        }

         for(int i=0;i<get_rows;i++){
            for(int j=0;j<get_cols;j++){
                 get_matrix[i][j]=double(solid_3d.tangent_matrix(i,j));

             }
          }
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Could anyone provide any suggestion or hint?

Thanks in advance!
Lance
On Thursday, June 22, 2023 at 2:35:52 PM UTC+2 Lance Zhang wrote:

> Hello,
>
> Currently, I met one problem when I calculate the inverse matrix with 
> datatype of class dealii::BlockSparseMatrix<double>.
>
> I searched the website of dealii for the method,but it seems there is no 
> method to get the inverse matrix in BlockSparseMatrix<double>.
>
> May I know whether there is any other method to change the matrix with 
> data type BlockSparseMatrix<double> into a matrix with 
> BlockSparseMatrix<double>?
>
> Best regards
> Lance
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/4cae4027-81b5-439c-a2f3-2c63bfd23ee2n%40googlegroups.com.

Reply via email to