23 return std::make_unique<PETScMatrix>();
29 return std::make_unique<PETScMatrix>(A);
35 auto const nrows = spec.nrows;
36 auto const ncols = spec.ncols;
38 if (spec.sparsity_pattern)
41 assert(spec.sparsity_pattern->size() == 1);
43 auto const max_nonzeroes = spec.sparsity_pattern->front();
46 mat_opt.
d_nz = max_nonzeroes;
47 mat_opt.o_nz = max_nonzeroes;
48 mat_opt.is_global_size =
false;
49 return std::make_unique<PETScMatrix>(nrows, ncols, mat_opt);
52 return std::make_unique<PETScMatrix>(nrows, ncols);
57 return std::make_unique<PETScVector>();
63 return std::make_unique<PETScVector>(x);
69 auto const is_global_size =
false;
71 if (spec.ghost_indices !=
nullptr)
73 return std::make_unique<PETScVector>(spec.nrows, *spec.ghost_indices,
78 return std::make_unique<PETScVector>(spec.nrows, is_global_size);
85 auto const is_global_size =
false;
87 return std::make_unique<PETScVector>(length, is_global_size);
97 return std::make_unique<EigenMatrix>(0, 0);
103 return std::make_unique<EigenMatrix>(A);
109 auto A = std::make_unique<EigenMatrix>(spec.nrows);
111 if (spec.sparsity_pattern)
121 return std::make_unique<EigenVector>();
127 return std::make_unique<EigenVector>(x);
133 return std::make_unique<EigenVector>(spec.nrows);
137 Eigen::SparseMatrix<double>::Index
const length)
139 return std::make_unique<EigenVector>(length);
Global vector based on Eigen vector.
Wrapper class for PETSc matrix routines for matrix.
Wrapper class for PETSc vector.
void setMatrixSparsity(MATRIX &matrix, SPARSITY_PATTERN const &sparsity_pattern)
This a struct data containing the configuration information to create a PETSc type matrix.
PetscInt d_nz
Number of nonzeros per row in the diagonal portion of local submatrix (same value is used for all loc...