25 #ifdef LIBMESH_HAVE_PETSC 40 #if PETSC_VERSION_LESS_THAN(3,3,0) 41 # undef LIBMESH_ENABLE_BLOCKED_STORAGE 46 #ifdef LIBMESH_ENABLE_BLOCKED_STORAGE 56 void transform_preallocation_arrays (
const PetscInt blocksize,
57 const std::vector<numeric_index_type> & n_nz,
58 const std::vector<numeric_index_type> & n_oz,
59 std::vector<numeric_index_type> & b_n_nz,
60 std::vector<numeric_index_type> & b_n_oz)
62 libmesh_assert_equal_to (n_nz.size(), n_oz.size());
63 libmesh_assert_equal_to (n_nz.size()%blocksize, 0);
65 b_n_nz.clear(); b_n_nz.reserve(n_nz.size()/blocksize);
66 b_n_oz.clear(); b_n_oz.reserve(n_oz.size()/blocksize);
68 for (std::size_t nn=0; nn<n_nz.size(); nn += blocksize)
70 b_n_nz.push_back (n_nz[nn]/blocksize);
71 b_n_oz.push_back (n_oz[nn]/blocksize);
92 _destroy_mat_on_exit(true),
100 template <
typename T>
104 _destroy_mat_on_exit(false),
114 template <
typename T>
120 template <
typename T>
123 _mat_type = mat_type;
126 template <
typename T>
145 PetscErrorCode
ierr = 0;
146 PetscInt m_global =
static_cast<PetscInt
>(m_in);
147 PetscInt n_global =
static_cast<PetscInt
>(n_in);
148 PetscInt m_local =
static_cast<PetscInt
>(m_l);
149 PetscInt n_local =
static_cast<PetscInt
>(n_l);
150 PetscInt n_nz =
static_cast<PetscInt
>(nnz);
151 PetscInt n_oz =
static_cast<PetscInt
>(noz);
153 ierr = MatCreate(this->comm().
get(), &_mat);
154 LIBMESH_CHKERR(
ierr);
155 ierr = MatSetSizes(_mat, m_local, n_local, m_global, n_global);
156 LIBMESH_CHKERR(
ierr);
158 #ifdef LIBMESH_ENABLE_BLOCKED_STORAGE 159 PetscInt blocksize =
static_cast<PetscInt
>(blocksize_in);
164 libmesh_assert_equal_to (m_local % blocksize, 0);
165 libmesh_assert_equal_to (n_local % blocksize, 0);
166 libmesh_assert_equal_to (m_global % blocksize, 0);
167 libmesh_assert_equal_to (n_global % blocksize, 0);
168 libmesh_assert_equal_to (n_nz % blocksize, 0);
169 libmesh_assert_equal_to (n_oz % blocksize, 0);
171 ierr = MatSetType(_mat, MATBAIJ);
172 LIBMESH_CHKERR(
ierr);
173 ierr = MatSetBlockSize(_mat, blocksize);
174 LIBMESH_CHKERR(
ierr);
175 ierr = MatSeqBAIJSetPreallocation(_mat, blocksize, n_nz/blocksize, PETSC_NULL);
176 LIBMESH_CHKERR(
ierr);
177 ierr = MatMPIBAIJSetPreallocation(_mat, blocksize,
178 n_nz/blocksize, PETSC_NULL,
179 n_oz/blocksize, PETSC_NULL);
180 LIBMESH_CHKERR(
ierr);
187 ierr = MatSetType(_mat, MATAIJ);
188 LIBMESH_CHKERR(
ierr);
189 ierr = MatSeqAIJSetPreallocation(_mat, n_nz, PETSC_NULL);
190 LIBMESH_CHKERR(
ierr);
191 ierr = MatMPIAIJSetPreallocation(_mat, n_nz, PETSC_NULL, n_oz, PETSC_NULL);
192 LIBMESH_CHKERR(
ierr);
196 #if !PETSC_VERSION_LESS_THAN(3,9,4) && LIBMESH_HAVE_PETSC_HYPRE 197 ierr = MatSetType(_mat, MATHYPRE);
198 LIBMESH_CHKERR(
ierr);
199 ierr = MatHYPRESetPreallocation(_mat, n_nz, PETSC_NULL, n_oz, PETSC_NULL);
200 LIBMESH_CHKERR(
ierr);
202 libmesh_error_msg(
"PETSc 3.9.4 or higher with hypre is required for MatHypre");
206 default: libmesh_error_msg(
"Unsupported petsc matrix type");
211 #if PETSC_VERSION_LESS_THAN(3,0,0) 212 ierr = MatSetOption(_mat, MAT_NEW_NONZERO_ALLOCATION_ERR);
214 ierr = MatSetOption(_mat, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_TRUE);
216 LIBMESH_CHKERR(
ierr);
219 ierr = MatSetOptionsPrefix(_mat,
"");
220 LIBMESH_CHKERR(
ierr);
221 ierr = MatSetFromOptions(_mat);
222 LIBMESH_CHKERR(
ierr);
228 template <
typename T>
233 const std::vector<numeric_index_type> & n_nz,
234 const std::vector<numeric_index_type> & n_oz,
247 libmesh_assert_equal_to (n_nz.size(), m_l);
248 libmesh_assert_equal_to (n_oz.size(), m_l);
250 PetscErrorCode
ierr = 0;
251 PetscInt m_global =
static_cast<PetscInt
>(m_in);
252 PetscInt n_global =
static_cast<PetscInt
>(n_in);
253 PetscInt m_local =
static_cast<PetscInt
>(m_l);
254 PetscInt n_local =
static_cast<PetscInt
>(n_l);
256 ierr = MatCreate(this->comm().
get(), &_mat);
257 LIBMESH_CHKERR(
ierr);
258 ierr = MatSetSizes(_mat, m_local, n_local, m_global, n_global);
259 LIBMESH_CHKERR(
ierr);
261 #ifdef LIBMESH_ENABLE_BLOCKED_STORAGE 262 PetscInt blocksize =
static_cast<PetscInt
>(blocksize_in);
267 libmesh_assert_equal_to (m_local % blocksize, 0);
268 libmesh_assert_equal_to (n_local % blocksize, 0);
269 libmesh_assert_equal_to (m_global % blocksize, 0);
270 libmesh_assert_equal_to (n_global % blocksize, 0);
272 ierr = MatSetType(_mat, MATBAIJ);
273 LIBMESH_CHKERR(
ierr);
274 ierr = MatSetBlockSize(_mat, blocksize);
275 LIBMESH_CHKERR(
ierr);
278 std::vector<numeric_index_type> b_n_nz, b_n_oz;
280 transform_preallocation_arrays (blocksize,
284 ierr = MatSeqBAIJSetPreallocation (_mat,
288 LIBMESH_CHKERR(
ierr);
290 ierr = MatMPIBAIJSetPreallocation (_mat,
296 LIBMESH_CHKERR(
ierr);
303 ierr = MatSetType(_mat, MATAIJ);
304 LIBMESH_CHKERR(
ierr);
305 ierr = MatSeqAIJSetPreallocation (_mat,
308 LIBMESH_CHKERR(
ierr);
309 ierr = MatMPIAIJSetPreallocation (_mat,
317 #if !PETSC_VERSION_LESS_THAN(3,9,4) && LIBMESH_HAVE_PETSC_HYPRE 318 ierr = MatSetType(_mat, MATHYPRE);
319 LIBMESH_CHKERR(
ierr);
320 ierr = MatHYPRESetPreallocation (_mat,
325 LIBMESH_CHKERR(
ierr);
327 libmesh_error_msg(
"PETSc 3.9.4 or higher with hypre is required for MatHypre");
331 default: libmesh_error_msg(
"Unsupported petsc matrix type");
337 ierr = MatSetOptionsPrefix(_mat,
"");
338 LIBMESH_CHKERR(
ierr);
339 ierr = MatSetFromOptions(_mat);
340 LIBMESH_CHKERR(
ierr);
347 template <
typename T>
350 libmesh_assert(this->_dof_map);
361 const numeric_index_type n_l = this->_dof_map->n_dofs_on_processor(this->processor_id());
365 const std::vector<numeric_index_type> & n_nz = this->_dof_map->get_n_nz();
366 const std::vector<numeric_index_type> & n_oz = this->_dof_map->get_n_oz();
369 libmesh_assert_equal_to (n_nz.size(), m_l);
370 libmesh_assert_equal_to (n_oz.size(), m_l);
372 PetscErrorCode
ierr = 0;
373 PetscInt m_global =
static_cast<PetscInt
>(my_m);
374 PetscInt n_global =
static_cast<PetscInt
>(my_n);
375 PetscInt m_local =
static_cast<PetscInt
>(m_l);
376 PetscInt n_local =
static_cast<PetscInt
>(n_l);
378 ierr = MatCreate(this->comm().
get(), &_mat);
379 LIBMESH_CHKERR(
ierr);
380 ierr = MatSetSizes(_mat, m_local, n_local, m_global, n_global);
381 LIBMESH_CHKERR(
ierr);
383 #ifdef LIBMESH_ENABLE_BLOCKED_STORAGE 384 PetscInt blocksize =
static_cast<PetscInt
>(this->_dof_map->block_size());
389 libmesh_assert_equal_to (m_local % blocksize, 0);
390 libmesh_assert_equal_to (n_local % blocksize, 0);
391 libmesh_assert_equal_to (m_global % blocksize, 0);
392 libmesh_assert_equal_to (n_global % blocksize, 0);
394 ierr = MatSetType(_mat, MATBAIJ);
395 LIBMESH_CHKERR(
ierr);
396 ierr = MatSetBlockSize(_mat, blocksize);
397 LIBMESH_CHKERR(
ierr);
400 std::vector<numeric_index_type> b_n_nz, b_n_oz;
402 transform_preallocation_arrays (blocksize,
406 ierr = MatSeqBAIJSetPreallocation (_mat,
410 LIBMESH_CHKERR(
ierr);
412 ierr = MatMPIBAIJSetPreallocation (_mat,
418 LIBMESH_CHKERR(
ierr);
425 ierr = MatSetType(_mat, MATAIJ);
426 LIBMESH_CHKERR(
ierr);
427 ierr = MatSeqAIJSetPreallocation (_mat,
430 LIBMESH_CHKERR(
ierr);
431 ierr = MatMPIAIJSetPreallocation (_mat,
439 #if !PETSC_VERSION_LESS_THAN(3,9,4) && LIBMESH_HAVE_PETSC_HYPRE 440 ierr = MatSetType(_mat, MATHYPRE);
441 LIBMESH_CHKERR(
ierr);
442 ierr = MatHYPRESetPreallocation (_mat,
447 LIBMESH_CHKERR(
ierr);
449 libmesh_error_msg(
"PETSc 3.9.4 or higher with hypre is required for MatHypre");
453 default: libmesh_error_msg(
"Unsupported petsc matrix type");
458 ierr = MatSetOptionsPrefix(_mat,
"");
459 LIBMESH_CHKERR(
ierr);
460 ierr = MatSetFromOptions(_mat);
461 LIBMESH_CHKERR(
ierr);
467 template <
typename T>
470 libmesh_not_implemented();
474 template <
typename T>
481 PetscErrorCode
ierr=0;
485 ierr = MatGetLocalSize(_mat,&m_l,&n_l);
486 LIBMESH_CHKERR(
ierr);
490 ierr = MatZeroEntries(_mat);
491 LIBMESH_CHKERR(
ierr);
495 template <
typename T>
502 PetscErrorCode
ierr=0;
504 #if PETSC_RELEASE_LESS_THAN(3,1,1) 506 ierr = MatZeroRows(_mat, rows.size(),
509 ierr = MatZeroRows(_mat, 0, PETSC_NULL, diag_value);
516 ierr = MatZeroRows(_mat, cast_int<PetscInt>(rows.size()),
518 PETSC_NULL, PETSC_NULL);
520 ierr = MatZeroRows(_mat, 0, PETSC_NULL, diag_value, PETSC_NULL,
524 LIBMESH_CHKERR(
ierr);
527 template <
typename T>
530 PetscErrorCode
ierr=0;
532 if ((this->
initialized()) && (this->_destroy_mat_on_exit))
536 ierr = LibMeshMatDestroy (&_mat);
537 LIBMESH_CHKERR(
ierr);
545 template <
typename T>
552 PetscErrorCode
ierr=0;
553 PetscReal petsc_value;
556 libmesh_assert (this->
closed());
558 ierr = MatNorm(_mat, NORM_1, &petsc_value);
559 LIBMESH_CHKERR(
ierr);
568 template <
typename T>
575 PetscErrorCode
ierr=0;
576 PetscReal petsc_value;
579 libmesh_assert (this->
closed());
581 ierr = MatNorm(_mat, NORM_INFINITY, &petsc_value);
582 LIBMESH_CHKERR(
ierr);
591 template <
typename T>
600 libmesh_deprecated();
601 libmesh_warning(
"The matrix must be assembled before calling PetscMatrix::print_matlab().\n" 602 "Please update your code, as this warning will become an error in a future release.");
606 PetscErrorCode
ierr=0;
607 PetscViewer petsc_viewer;
610 ierr = PetscViewerCreate (this->comm().
get(),
612 LIBMESH_CHKERR(
ierr);
620 ierr = PetscViewerASCIIOpen( this->comm().
get(),
623 LIBMESH_CHKERR(
ierr);
625 #if PETSC_VERSION_LESS_THAN(3,7,0) 626 ierr = PetscViewerSetFormat (petsc_viewer,
627 PETSC_VIEWER_ASCII_MATLAB);
629 ierr = PetscViewerPushFormat (petsc_viewer,
630 PETSC_VIEWER_ASCII_MATLAB);
633 LIBMESH_CHKERR(
ierr);
635 ierr = MatView (_mat, petsc_viewer);
636 LIBMESH_CHKERR(
ierr);
644 #if PETSC_VERSION_LESS_THAN(3,7,0) 645 ierr = PetscViewerSetFormat (PETSC_VIEWER_STDOUT_WORLD,
646 PETSC_VIEWER_ASCII_MATLAB);
648 ierr = PetscViewerPushFormat (PETSC_VIEWER_STDOUT_WORLD,
649 PETSC_VIEWER_ASCII_MATLAB);
652 LIBMESH_CHKERR(
ierr);
654 ierr = MatView (_mat, PETSC_VIEWER_STDOUT_WORLD);
655 LIBMESH_CHKERR(
ierr);
662 ierr = LibMeshPetscViewerDestroy (&petsc_viewer);
663 LIBMESH_CHKERR(
ierr);
670 template <
typename T>
687 libmesh_deprecated();
688 libmesh_warning(
"The matrix must be assembled before calling PetscMatrix::print_personal().\n" 689 "Please update your code, as this warning will become an error in a future release.");
693 PetscErrorCode
ierr=0;
696 if (os.rdbuf() == std::cout.rdbuf())
698 ierr = MatView(_mat, PETSC_VIEWER_STDOUT_SELF);
699 LIBMESH_CHKERR(
ierr);
707 std::string temp_filename;
711 char c[] =
"temp_petsc_matrix.XXXXXX";
716 if (this->processor_id() == 0)
722 libmesh_error_msg(
"mkstemp failed in PetscMatrix::print_personal()");
734 this->comm().broadcast(temp_filename);
737 PetscViewer petsc_viewer;
743 ierr = PetscViewerASCIIOpen( this->comm().
get(),
744 temp_filename.c_str(),
746 LIBMESH_CHKERR(
ierr);
754 ierr = MatView (_mat, petsc_viewer);
755 LIBMESH_CHKERR(
ierr);
757 if (this->processor_id() == 0)
761 std::ifstream input_stream(temp_filename.c_str());
762 os << input_stream.rdbuf();
766 input_stream.close();
767 std::remove(temp_filename.c_str());
777 template <
typename T>
779 const std::vector<numeric_index_type> & rows,
780 const std::vector<numeric_index_type> & cols)
787 libmesh_assert_equal_to (rows.size(), n_rows);
788 libmesh_assert_equal_to (cols.size(), n_cols);
790 PetscErrorCode
ierr=0;
791 ierr = MatSetValues(_mat,
794 const_cast<PetscScalar *>(dm.
get_values().data()),
796 LIBMESH_CHKERR(
ierr);
804 template <
typename T>
806 const std::vector<numeric_index_type> & brows,
807 const std::vector<numeric_index_type> & bcols)
812 cast_int<numeric_index_type>(brows.size());
814 cast_int<numeric_index_type>(bcols.size());
816 PetscErrorCode
ierr=0;
820 cast_int<numeric_index_type>(dm.
m());
822 cast_int<numeric_index_type>(dm.
n());
825 libmesh_assert_equal_to (n_cols / n_bcols, blocksize);
826 libmesh_assert_equal_to (blocksize*n_brows, n_rows);
827 libmesh_assert_equal_to (blocksize*n_bcols, n_cols);
829 PetscInt petsc_blocksize;
830 ierr = MatGetBlockSize(_mat, &petsc_blocksize);
831 LIBMESH_CHKERR(
ierr);
832 libmesh_assert_equal_to (blocksize, static_cast<numeric_index_type>(petsc_blocksize));
836 ierr = MatSetValuesBlocked(_mat,
839 const_cast<PetscScalar *>(dm.
get_values().data()),
841 LIBMESH_CHKERR(
ierr);
848 template <
typename T>
850 const std::vector<numeric_index_type> & rows,
851 const std::vector<numeric_index_type> & cols,
852 const bool reuse_submatrix)
const 856 libmesh_deprecated();
857 libmesh_warning(
"The matrix must be assembled before calling PetscMatrix::create_submatrix().\n" 858 "Please update your code, as this warning will become an error in a future release.");
863 PetscMatrix<T> * petsc_submatrix = cast_ptr<PetscMatrix<T> *>(&submatrix);
871 PetscErrorCode
ierr=0;
874 ierr = ISCreateLibMesh(this->comm().
get(),
875 cast_int<PetscInt>(rows.size()),
878 &isrow); LIBMESH_CHKERR(
ierr);
880 ierr = ISCreateLibMesh(this->comm().
get(),
881 cast_int<PetscInt>(cols.size()),
884 &iscol); LIBMESH_CHKERR(
ierr);
887 ierr = LibMeshCreateSubMatrix(_mat,
890 #
if PETSC_RELEASE_LESS_THAN(3,0,1)
893 (reuse_submatrix ? MAT_REUSE_MATRIX : MAT_INITIAL_MATRIX),
894 &(petsc_submatrix->
_mat)); LIBMESH_CHKERR(
ierr);
898 petsc_submatrix->
close();
901 ierr = LibMeshISDestroy(&isrow); LIBMESH_CHKERR(
ierr);
902 ierr = LibMeshISDestroy(&iscol); LIBMESH_CHKERR(
ierr);
907 template <
typename T>
914 PetscErrorCode
ierr =
920 template <
typename T>
928 if (&petsc_dest !=
this)
932 #if PETSC_VERSION_LESS_THAN(3,0,0) 933 if (&petsc_dest ==
this)
934 ierr = MatTranspose(_mat,PETSC_NULL);
936 ierr = MatTranspose(_mat,&petsc_dest.
_mat);
937 LIBMESH_CHKERR(
ierr);
940 if (&petsc_dest ==
this)
941 ierr = MatTranspose(_mat,MAT_REUSE_MATRIX,&petsc_dest.
_mat);
943 ierr = MatTranspose(_mat,MAT_INITIAL_MATRIX,&petsc_dest.
_mat);
944 LIBMESH_CHKERR(
ierr);
956 template <
typename T>
968 PetscErrorCode
ierr=0;
970 ierr = MatAssemblyBegin (_mat, MAT_FINAL_ASSEMBLY);
971 LIBMESH_CHKERR(
ierr);
972 ierr = MatAssemblyEnd (_mat, MAT_FINAL_ASSEMBLY);
973 LIBMESH_CHKERR(
ierr);
976 template <
typename T>
981 PetscErrorCode
ierr=0;
983 ierr = MatAssemblyBegin (_mat, MAT_FLUSH_ASSEMBLY);
984 LIBMESH_CHKERR(
ierr);
985 ierr = MatAssemblyEnd (_mat, MAT_FLUSH_ASSEMBLY);
986 LIBMESH_CHKERR(
ierr);
991 template <
typename T>
996 PetscInt petsc_m=0, petsc_n=0;
997 PetscErrorCode
ierr=0;
999 ierr = MatGetSize (_mat, &petsc_m, &petsc_n);
1000 LIBMESH_CHKERR(
ierr);
1007 template <
typename T>
1012 PetscInt petsc_m=0, petsc_n=0;
1013 PetscErrorCode
ierr=0;
1015 ierr = MatGetSize (_mat, &petsc_m, &petsc_n);
1016 LIBMESH_CHKERR(
ierr);
1023 template <
typename T>
1028 PetscInt start=0,
stop=0;
1029 PetscErrorCode
ierr=0;
1031 ierr = MatGetOwnershipRange(_mat, &start, &
stop);
1032 LIBMESH_CHKERR(
ierr);
1039 template <
typename T>
1044 PetscInt start=0,
stop=0;
1045 PetscErrorCode
ierr=0;
1047 ierr = MatGetOwnershipRange(_mat, &start, &
stop);
1048 LIBMESH_CHKERR(
ierr);
1055 template <
typename T>
1062 PetscErrorCode
ierr=0;
1063 PetscInt i_val=i, j_val=j;
1065 PetscScalar petsc_value =
static_cast<PetscScalar
>(
value);
1066 ierr = MatSetValues(_mat, 1, &i_val, 1, &j_val,
1067 &petsc_value, INSERT_VALUES);
1068 LIBMESH_CHKERR(
ierr);
1073 template <
typename T>
1080 PetscErrorCode
ierr=0;
1081 PetscInt i_val=i, j_val=j;
1083 PetscScalar petsc_value =
static_cast<PetscScalar
>(
value);
1084 ierr = MatSetValues(_mat, 1, &i_val, 1, &j_val,
1085 &petsc_value, ADD_VALUES);
1086 LIBMESH_CHKERR(
ierr);
1091 template <
typename T>
1093 const std::vector<numeric_index_type> & dof_indices)
1095 this->add_matrix (dm, dof_indices, dof_indices);
1104 template <
typename T>
1111 libmesh_assert_equal_to (this->m(), X_in.
m());
1112 libmesh_assert_equal_to (this->n(), X_in.
n());
1114 PetscScalar a =
static_cast<PetscScalar
> (a_in);
1115 const PetscMatrix<T> * X = cast_ptr<const PetscMatrix<T> *> (&X_in);
1119 PetscErrorCode
ierr=0;
1122 libmesh_assert(X->
closed());
1124 semiparallel_only();
1126 ierr = MatAXPY(_mat, a, X->
_mat, DIFFERENT_NONZERO_PATTERN);
1127 LIBMESH_CHKERR(
ierr);
1133 template <
typename T>
1140 const PetscScalar * petsc_row;
1141 const PetscInt * petsc_cols;
1150 i_val=
static_cast<PetscInt
>(i_in),
1151 j_val=static_cast<PetscInt>(j_in);
1158 libmesh_assert(this->
closed());
1160 ierr = MatGetRow(_mat, i_val, &ncols, &petsc_cols, &petsc_row);
1161 LIBMESH_CHKERR(
ierr);
1165 std::pair<const PetscInt *, const PetscInt *> p =
1166 std::equal_range (petsc_cols, petsc_cols + ncols, j_val);
1169 if (p.first != p.second)
1173 const std::size_t j =
1174 std::distance (const_cast<PetscInt *>(petsc_cols),
1175 const_cast<PetscInt *>(p.first));
1177 libmesh_assert_less (static_cast<PetscInt>(j), ncols);
1178 libmesh_assert_equal_to (petsc_cols[j], j_val);
1180 value =
static_cast<T
> (petsc_row[j]);
1183 ierr = MatRestoreRow(_mat, i_val,
1184 &ncols, &petsc_cols, &petsc_row);
1185 LIBMESH_CHKERR(
ierr);
1193 template <
typename T>
1198 PetscErrorCode
ierr=0;
1201 ierr = MatAssembled(_mat, &assembled);
1202 LIBMESH_CHKERR(
ierr);
1204 return (assembled == PETSC_TRUE);
1209 template <
typename T>
1225 #endif // #ifdef LIBMESH_HAVE_PETSC std::string name(const ElemQuality q)
virtual bool initialized() const
virtual T operator()(const numeric_index_type i, const numeric_index_type j) const override
NumericVector interface to PETSc Vec.
void set_matrix_type(PetscMatrixType mat_type)
virtual void print_matlab(const std::string &name="") const override
bool _destroy_mat_on_exit
virtual void zero() override
PetscMatrix(const Parallel::Communicator &comm_in)
virtual numeric_index_type n() const override
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
void update_preallocation_and_zero()
virtual void init() override
virtual void add_block_matrix(const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &brows, const std::vector< numeric_index_type > &bcols) override
virtual void print_personal(std::ostream &os=libMesh::out) const override
void swap(PetscMatrix< T > &)
PetscInt * numeric_petsc_cast(const numeric_index_type *p)
void libmesh_ignore(const Args &...)
dof_id_type numeric_index_type
virtual numeric_index_type m() const =0
void stop(const char *file, int line, const char *date, const char *time)
virtual numeric_index_type row_stop() const override
std::vector< T > & get_values()
virtual numeric_index_type m() const override
virtual void add(const numeric_index_type i, const numeric_index_type j, const T value) override
virtual void get_diagonal(NumericVector< T > &dest) const override
virtual void clear() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual bool closed() const override
virtual numeric_index_type row_start() const override
virtual void get_transpose(SparseMatrix< T > &dest) const override
virtual Real l1_norm() const override
void swap(Iterator &lhs, Iterator &rhs)
virtual void add_matrix(const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols) override
virtual void set(const numeric_index_type i, const numeric_index_type j, const T value) override
SparseMatrix interface to PETSc Mat.
virtual void _get_submatrix(SparseMatrix< T > &submatrix, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols, const bool reuse_submatrix) const override
virtual void zero_rows(std::vector< numeric_index_type > &rows, T diag_value=0.0) override
A matrix object used for finite element assembly and numerics.
virtual void flush() override
virtual void close() override
virtual Real linfty_norm() const override
virtual numeric_index_type n() const =0