program DG_flow use f90_kind use petsc_stuff implicit none integer :: row,col,no_rows,no_cols real(dp) :: mat_entry type(petsc_matrix_type) :: A_petsc_wrapper type(petsc_matrix_type) :: B_petsc_wrapper type(petsc_matrix_type) :: C_petsc_wrapper ! Initialize Petsc call init_petsc ! Build the A and B matrices (just simple example) no_rows = 10 no_cols = 10 call init_petsc_matrix(A_petsc_wrapper,no_rows,no_cols,no_cols) call init_petsc_matrix(B_petsc_wrapper,no_rows,no_cols,no_cols) do row=1,no_rows mat_entry = 1.d0 call addcoef_petsc_matrix(A_petsc_wrapper%A_PetSC,row,row,mat_entry) call addcoef_petsc_matrix(B_petsc_wrapper%A_PetSC,row,row,mat_entry) enddo ! Finalize the A and B matrices call finalize_petsc_matrix(A_petsc_wrapper) call finalize_petsc_matrix(B_petsc_wrapper) ! Fail 1: print some info of the matrix A call get_info(A_petsc_wrapper) ! Fail 2: Construct matrix C = A * B call mat_prod(A_petsc_wrapper%A_PetSC,B_petsc_wrapper%A_PetSC,C_petsc_wrapper%A_PetSC) ! Stop Petsc call stop_petsc end program DG_flow !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!