libMesh
Functions
matrixconvert.C File Reference

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 28 of file matrixconvert.C.

References libMesh::SparseMatrix< T >::build(), libMesh::TriangleWrapper::init(), and libMesh::out.

29 {
30  LibMeshInit init(argc, argv);
31 
32  if (argc != 3)
33  libmesh_error_msg
34  ("Usage: " << argv[0] <<
35  " inputmatrix outputmatrix");
36 
37  auto mat = SparseMatrix<Number>::build(init.comm());
38 
39  LOG_CALL("mat.read()", "main", mat->read(argv[1]));
40 
41  libMesh::out << "Loaded " << mat->m() << " by " << mat->n() <<
42  " matrix " << argv[1] << std::endl;
43 
44  LOG_CALL("mat.print_matlab()", "main", mat->print_matlab(argv[2]));
45 
46  libMesh::out << "Wrote output " << argv[2] << std::endl;
47 
48  return 0;
49 }
The LibMeshInit class, when constructed, initializes the dependent libraries (e.g.
Definition: libmesh.h:90
Generic sparse matrix.
Definition: vector_fe_ex5.C:46
void init(triangulateio &t)
Initializes the fields of t to nullptr/0 as necessary.
OStreamProxy out