◆ CPPUNIT_TEST() [1/3]
◆ CPPUNIT_TEST() [2/3]
◆ CPPUNIT_TEST() [3/3]
| PetscMatrixShellMatrixTest::CPPUNIT_TEST |
( |
testMult |
| ) |
|
◆ CPPUNIT_TEST_SUITE_END()
| PetscMatrixShellMatrixTest::CPPUNIT_TEST_SUITE_END |
( |
| ) |
|
◆ LIBMESH_CPPUNIT_TEST_SUITE()
◆ setUp()
| void PetscMatrixShellMatrixTest::setUp |
( |
| ) |
|
|
inline |
◆ tearDown()
| void PetscMatrixShellMatrixTest::tearDown |
( |
| ) |
|
|
inline |
◆ testGetContext()
| void PetscMatrixShellMatrixTest::testGetContext |
( |
| ) |
|
|
inline |
◆ testInitSizes()
| void PetscMatrixShellMatrixTest::testInitSizes |
( |
| ) |
|
|
inline |
Definition at line 60 of file petsc_matrix_shell_matrix_test.C.
61 {
62 LOG_UNIT_TEST;
63
66 mat.init(m, m, 1, 1);
67
68 CPPUNIT_ASSERT_EQUAL(mat.m(), m);
69 CPPUNIT_ASSERT_EQUAL(mat.n(), m);
72
73 MatType type;
74 LibmeshPetscCall2((*TestCommWorld), MatGetType(mat.mat(), &type));
75 CPPUNIT_ASSERT(std::string(type) == MATSHELL);
76 }
References libMesh::PetscMatrixShellMatrix< T >::init(), libMesh::PetscMatrixBase< T >::local_m(), libMesh::PetscMatrixBase< T >::local_n(), libMesh::PetscMatrixBase< T >::m(), libMesh::PetscMatrixBase< T >::mat(), libMesh::PetscMatrixBase< T >::n(), and TestCommWorld.
◆ testMult()
| void PetscMatrixShellMatrixTest::testMult |
( |
| ) |
|
|
inline |
Definition at line 91 of file petsc_matrix_shell_matrix_test.C.
92 {
93 LOG_UNIT_TEST;
94
97 mat.init(m, m, 1, 1);
98
99 LibmeshPetscCall2((*TestCommWorld),
100 MatShellSetOperation(mat.mat(), MATOP_MULT,
101 (void (*)(void))petsc_matrix_shell_matrix_test_mult));
102
106 x.close();
107
108 LibmeshPetscCall2((*TestCommWorld), MatMult(mat.mat(), x.vec(), y.vec()));
109
111 }
This class provides a nice interface to PETSc's Vec object.
static constexpr Real TOLERANCE
References libMesh::PetscVector< T >::close(), libMesh::PetscMatrixShellMatrix< T >::init(), libMesh::PetscMatrixBase< T >::mat(), libMesh::PetscVector< T >::set(), TestCommWorld, libMesh::TOLERANCE, and libMesh::PetscVector< T >::vec().
The documentation for this class was generated from the following file: