18#include <libmesh/libmesh_config.h>
20#ifdef LIBMESH_HAVE_PETSC
22#include <libmesh/petsc_matrix_shell_matrix.h>
23#include <libmesh/petsc_vector.h>
35petsc_matrix_shell_matrix_test_mult(Mat, Vec x, Vec y)
37 PetscFunctionBeginUser;
68 CPPUNIT_ASSERT_EQUAL(mat.
m(), m);
69 CPPUNIT_ASSERT_EQUAL(mat.
n(), m);
75 CPPUNIT_ASSERT(std::string(type) == MATSHELL);
100 MatShellSetOperation(mat.
mat(), MATOP_MULT,
101 (void (*)(
void))petsc_matrix_shell_matrix_test_mult));
CPPUNIT_TEST(testGetContext)
LIBMESH_CPPUNIT_TEST_SUITE(PetscMatrixShellMatrixTest)
CPPUNIT_TEST(testInitSizes)
This class provides a nice interface to the PETSc C-based data structures for parallel,...
virtual numeric_index_type n() const override
virtual numeric_index_type local_m() const final
Get the number of rows owned by this process.
virtual numeric_index_type m() const override
virtual numeric_index_type local_n() const final
Get the number of columns owned by this process.
This class allows to use a PETSc shell matrix as a PetscMatrix.
virtual void init(const numeric_index_type m, const numeric_index_type n, const numeric_index_type m_l, const numeric_index_type n_l, const numeric_index_type=30, const numeric_index_type=10, const numeric_index_type blocksize=1) override
Initialize SparseMatrix with the specified sizes.
This class provides a nice interface to PETSc's Vec object.
virtual void set(const numeric_index_type i, const T value) override
Sets v(i) = value.
virtual void close() override
Calls the NumericVector's internal assembly routines, ensuring that the values are consistent across ...
Communicator * TestCommWorld
The libMesh namespace provides an interface to certain functionality in the library.
PetscFunctionReturn(LIBMESH_PETSC_SUCCESS)
dof_id_type numeric_index_type
static constexpr Real TOLERANCE
LibmeshPetscCallQ(DMShellGetContext(dm, &ctx))
CPPUNIT_TEST_SUITE_REGISTRATION(PetscMatrixShellMatrixTest)