libMesh
Loading...
Searching...
No Matches
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.

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:92
static std::unique_ptr< SparseMatrix< T > > build(const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package(), const MatrixBuildType matrix_build_type=MatrixBuildType::AUTOMATIC)
Builds a SparseMatrix<T> using the linear solver package specified by solver_package.
void init(triangulateio &t)
Initializes the fields of t to nullptr/0 as necessary.
OStreamProxy out

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