From 59d60ba578c0a9f180e923b0c943b4dc7bdb027a Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Fri, 22 May 2026 13:15:19 -0700 Subject: [PATCH] Make atomic matrix init methods public I have a matrix which is not rectangular, hence not initializable with the DofMap, and I want to be able to initialize said matrix with hash table based matrix assembly. Making `init_without_preallocation` and `finish_initialization` public allows me to easily do this --- include/numerics/petsc_matrix.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/numerics/petsc_matrix.h b/include/numerics/petsc_matrix.h index c01dfe0eb04..7e2e4d5737e 100644 --- a/include/numerics/petsc_matrix.h +++ b/include/numerics/petsc_matrix.h @@ -293,7 +293,6 @@ class PetscMatrix final : public PetscMatrixBase virtual void restore_original_nonzero_pattern() override; -protected: /** * Perform matrix initialization steps sans preallocation * @param m The global number of rows @@ -308,6 +307,15 @@ class PetscMatrix final : public PetscMatrixBase numeric_index_type n_l, numeric_index_type blocksize); + /** + * Finish up the initialization process. This method does a few things which include + * - Setting the option to make new nonzeroes an error (otherwise users will just have a silent + (often huge) performance penalty + * - Marking the matrix as initialized + */ + void finish_initialization(); + +protected: /* * Performs matrix preallcation * \param m_l The local number of rows. @@ -319,14 +327,6 @@ class PetscMatrix final : public PetscMatrixBase const std::vector & n_oz, numeric_index_type blocksize); - /** - * Finish up the initialization process. This method does a few things which include - * - Setting the option to make new nonzeroes an error (otherwise users will just have a silent - (often huge) performance penalty - * - Marking the matrix as initialized - */ - void finish_initialization(); - /** * This function either creates or re-initializes a matrix called \p * submatrix which is defined by the indices given in the \p rows