Line data Source code
1 : // The libMesh Finite Element Library. 2 : // Copyright (C) 2002-2026 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 3 : 4 : // This library is free software; you can redistribute it and/or 5 : // modify it under the terms of the GNU Lesser General Public 6 : // License as published by the Free Software Foundation; either 7 : // version 2.1 of the License, or (at your option) any later version. 8 : 9 : // This library is distributed in the hope that it will be useful, 10 : // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 : // Lesser General Public License for more details. 13 : 14 : // You should have received a copy of the GNU Lesser General Public 15 : // License along with this library; if not, write to the Free Software 16 : // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 : 18 : #include "libmesh/libmesh_config.h" 19 : 20 : #ifdef LIBMESH_HAVE_PETSC 21 : 22 : // Local includes 23 : #include "libmesh/petsc_matrix_shell_matrix.h" 24 : 25 : namespace libMesh 26 : { 27 : 28 : template <typename T> 29 : void 30 0 : PetscMatrixShellMatrix<T>::init(const numeric_index_type m, 31 : const numeric_index_type n, 32 : const numeric_index_type m_l, 33 : const numeric_index_type n_l, 34 : const numeric_index_type, 35 : const numeric_index_type, 36 : const numeric_index_type blocksize) 37 : { 38 0 : init_shell_mat(*this, m, n, m_l, n_l, blocksize); 39 0 : this->set_context(); 40 0 : } 41 : 42 : template <typename T> 43 : void 44 4130 : PetscMatrixShellMatrix<T>::init(ParallelType libmesh_dbg_var(type)) 45 : { 46 : #ifndef NDEBUG 47 118 : libmesh_assert(this->_dof_map); 48 118 : const auto m = this->_dof_map->n_dofs(); 49 118 : const auto m_l = this->_dof_map->n_local_dofs(); 50 118 : if (m != m_l) 51 118 : libmesh_assert(type != SERIAL); 52 : #endif 53 4130 : init_shell_mat(*this); 54 4130 : this->set_context(); 55 4130 : } 56 : 57 : template <typename T> 58 : void 59 0 : PetscMatrixShellMatrix<T>::zero() 60 : { 61 0 : libmesh_error(); 62 : } 63 : 64 : template <typename T> 65 : std::unique_ptr<SparseMatrix<T>> 66 0 : PetscMatrixShellMatrix<T>::zero_clone() const 67 : { 68 0 : libmesh_error(); 69 : } 70 : 71 : template <typename T> 72 : std::unique_ptr<SparseMatrix<T>> 73 0 : PetscMatrixShellMatrix<T>::clone() const 74 : { 75 0 : libmesh_not_implemented(); 76 : } 77 : 78 : template <typename T> 79 : void 80 0 : PetscMatrixShellMatrix<T>::set(const numeric_index_type, const numeric_index_type, const T) 81 : { 82 0 : libmesh_error(); 83 : } 84 : 85 : template <typename T> 86 : void 87 0 : PetscMatrixShellMatrix<T>::add(const numeric_index_type, const numeric_index_type, const T) 88 : { 89 0 : libmesh_error(); 90 : } 91 : 92 : template <typename T> 93 : void 94 0 : PetscMatrixShellMatrix<T>::add_matrix(const DenseMatrix<T> &, 95 : const std::vector<numeric_index_type> &, 96 : const std::vector<numeric_index_type> &) 97 : { 98 0 : libmesh_error(); 99 : } 100 : 101 : template <typename T> 102 : void 103 0 : PetscMatrixShellMatrix<T>::add_matrix(const DenseMatrix<T> &, 104 : const std::vector<numeric_index_type> &) 105 : { 106 0 : libmesh_error(); 107 : } 108 : 109 : template <typename T> 110 : void 111 0 : PetscMatrixShellMatrix<T>::add(const T, const SparseMatrix<T> &) 112 : { 113 0 : libmesh_error(); 114 : } 115 : 116 : template <typename T> 117 : T 118 0 : PetscMatrixShellMatrix<T>::operator()(const numeric_index_type, const numeric_index_type) const 119 : { 120 0 : libmesh_error(); 121 : } 122 : 123 : template <typename T> 124 : Real 125 0 : PetscMatrixShellMatrix<T>::l1_norm() const 126 : { 127 0 : libmesh_error(); 128 : } 129 : 130 : template <typename T> 131 : Real 132 0 : PetscMatrixShellMatrix<T>::linfty_norm() const 133 : { 134 0 : libmesh_error(); 135 : } 136 : 137 : template <typename T> 138 : void 139 0 : PetscMatrixShellMatrix<T>::print_personal(std::ostream &) const 140 : { 141 0 : libmesh_error(); 142 : } 143 : 144 : template <typename T> 145 : void 146 0 : PetscMatrixShellMatrix<T>::get_diagonal(NumericVector<T> &) const 147 : { 148 0 : libmesh_error(); 149 : } 150 : 151 : template <typename T> 152 : void 153 0 : PetscMatrixShellMatrix<T>::get_transpose(SparseMatrix<T> &) const 154 : { 155 0 : libmesh_error(); 156 : } 157 : 158 : template <typename T> 159 : void 160 0 : PetscMatrixShellMatrix<T>::get_row(numeric_index_type, 161 : std::vector<numeric_index_type> &, 162 : std::vector<T> &) const 163 : { 164 0 : libmesh_error(); 165 : } 166 : 167 : template class LIBMESH_EXPORT PetscMatrixShellMatrix<Number>; 168 : 169 : } // namespace libMesh 170 : 171 : #endif