Advanced Multi-Physics (AMP)
On-Line Documentation
MatrixFactory.h
Go to the documentation of this file.
1#ifndef included_AMP_Matrix_MatrixFactory
2#define included_AMP_Matrix_MatrixFactory
3
4#include "AMP/utils/FactoryStrategy.hpp"
5
6
7namespace AMP::IO {
8class RestartManager;
9}
10
11
12namespace AMP::LinearAlgebra {
13
14class Matrix;
15
16template<class MATRIX>
17std::unique_ptr<MATRIX> createMatrixFromRestart( int64_t fid, AMP::IO::RestartManager *manager )
18{
19 return std::make_unique<MATRIX>( fid, manager );
20}
21
22
25{
26public:
29 {
30 static MatrixFactory singletonInstance;
31 return singletonInstance;
32 }
33
35 static std::shared_ptr<Matrix> create( int64_t fid, AMP::IO::RestartManager *manager );
36
38 template<class MATRIX>
39 static void registerMatrix( const std::string &name )
40 {
41 FactoryStrategy<Matrix, int64_t, AMP::IO::RestartManager *>::registerFactory(
42 name, createMatrixFromRestart<MATRIX> );
43 }
44};
45
46
47} // namespace AMP::LinearAlgebra
48
49#endif
Class to manage reading/writing restart data.
virtual std::string name() const =0
static MatrixFactory & getFactory()
get a singleton instance of the factory
static std::shared_ptr< Matrix > create(int64_t fid, AMP::IO::RestartManager *manager)
Create the matrix from the restart file.
static void registerMatrix(const std::string &name)
Register a matrix with the factory.
std::unique_ptr< MATRIX > createMatrixFromRestart(int64_t fid, AMP::IO::RestartManager *manager)



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:40.
Comments on this page