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