Function opensn::InitMatrixSparsity(Mat&, const std::vector<int64_t>&, const std::vector<int64_t>&)

Function Documentation

void opensn::InitMatrixSparsity(Mat &A, const std::vector<int64_t> &nodal_nnz_in_diag, const std::vector<int64_t> &nodal_nnz_off_diag)

Initializes the sparsity pattern of a matrix.

This is a macro for:

MatMPIAIJSetPreallocation(A,0,nodal_nnz_in_diag.data(),
                            0,nodal_nnz_off_diag.data());
MatSetOption(A, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE);
MatSetOption(A, MAT_IGNORE_ZERO_ENTRIES, PETSC_TRUE);
MatSetUp(A);