Line data Source code
1 : // The libMesh Finite Element Library. 2 : // Copyright (C) 2002-2025 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 490 : PetscMatrixShellMatrix<T>::init(ParallelType libmesh_dbg_var(type)) 45 : { 46 : #ifndef NDEBUG 47 14 : libmesh_assert(this->_dof_map); 48 14 : const auto m = this->_dof_map->n_dofs(); 49 14 : const auto m_l = this->_dof_map->n_local_dofs(); 50 14 : if (m != m_l) 51 14 : libmesh_assert(type != SERIAL); 52 : #endif 53 490 : init_shell_mat(*this); 54 490 : this->set_context(); 55 490 : } 56 : 57 : template class LIBMESH_EXPORT PetscMatrixShellMatrix<Number>; 58 : 59 : } // namespace libMesh 60 : 61 : #endif