libMesh
eigen_sparse_vector_test.C
Go to the documentation of this file.
1 #include <libmesh/eigen_sparse_vector.h>
2 
3 #ifdef LIBMESH_HAVE_EIGEN
4 
5 #include "numeric_vector_test.h"
6 
7 
8 using namespace libMesh;
9 
10 class EigenSparseVectorTest : public NumericVectorTest<EigenSparseVector<Number>> {
11 private:
12  // This class manages the memory for the communicator it uses,
13  // providing a dumb pointer to the managed resource for the base
14  // class.
15  std::unique_ptr<Parallel::Communicator> _managed_comm;
16 
17 public:
18  void setUp()
19  {
20  // Eigen doesn't support distributed parallel vectors, but we can
21  // build a serial vector on each processor
22  _managed_comm = std::make_unique<Parallel::Communicator>();
23 
24  // Base class communicator points to our managed communicator
25  my_comm = _managed_comm.get();
26 
28  }
29 
30  void tearDown() {}
31 
35  this->libmesh_suite_name = "NumericVectorTest";
36  else
37  this->libmesh_suite_name = "EigenSparseVectorTest";
38  }
39 
40  CPPUNIT_TEST_SUITE( EigenSparseVectorTest );
41 
42  NUMERICVECTORTEST
43 
44  CPPUNIT_TEST_SUITE_END();
45 };
46 
48 
49 #endif // #ifdef LIBMESH_HAVE_EIGEN
CPPUNIT_TEST_SUITE_REGISTRATION(EigenSparseVectorTest)
The libMesh namespace provides an interface to certain functionality in the library.
bool summarized_logs_enabled()
Definition: perf_log.h:202
libMesh::PerfLog * unitlog
Definition: driver.C:173
std::unique_ptr< Parallel::Communicator > _managed_comm
This class provides a nice interface to the Eigen C++-based data structures for serial vectors...