Advanced Multi-Physics (AMP)
On-Line Documentation
MatrixParameters.h
Go to the documentation of this file.
1#ifndef included_AMP_MatrixParameters
2#define included_AMP_MatrixParameters
3
4#include "AMP/discretization/DOF_Manager.h"
5#include "AMP/matrices/MatrixParametersBase.h"
6#include "AMP/utils/AMP_MPI.h"
7#include "AMP/vectors/Vector.h"
8
9namespace AMP::LinearAlgebra {
10
11
16{
17public:
18 MatrixParameters() = delete;
19
28 explicit MatrixParameters( std::shared_ptr<AMP::Discretization::DOFManager> dofLeft,
29 std::shared_ptr<AMP::Discretization::DOFManager> dofRight,
30 const AMP_MPI &comm,
31 const std::function<std::vector<size_t>( size_t )> getRow = {} );
32
42 explicit MatrixParameters( std::shared_ptr<AMP::Discretization::DOFManager> dofLeft,
43 std::shared_ptr<AMP::Discretization::DOFManager> dofRight,
44 const AMP_MPI &comm,
46 const std::function<std::vector<size_t>( size_t )> getRow = {} );
47
48
59 explicit MatrixParameters( std::shared_ptr<AMP::Discretization::DOFManager> dofLeft,
60 std::shared_ptr<AMP::Discretization::DOFManager> dofRight,
61 const AMP_MPI &comm,
62 std::shared_ptr<Variable> varLeft,
63 std::shared_ptr<Variable> varRight,
64 const std::function<std::vector<size_t>( size_t )> getRow = {} );
65
77 explicit MatrixParameters( std::shared_ptr<AMP::Discretization::DOFManager> dofLeft,
78 std::shared_ptr<AMP::Discretization::DOFManager> dofRight,
79 const AMP_MPI &comm,
80 std::shared_ptr<Variable> varLeft,
81 std::shared_ptr<Variable> varRight,
83 const std::function<std::vector<size_t>( size_t )> getRow = {} );
84
95 explicit MatrixParameters( std::shared_ptr<AMP::Discretization::DOFManager> dofLeft,
96 std::shared_ptr<AMP::Discretization::DOFManager> dofRight,
97 const AMP_MPI &comm,
98 std::shared_ptr<CommunicationList> commListLeft,
99 std::shared_ptr<CommunicationList> commListRight,
100 const std::function<std::vector<size_t>( size_t )> getRow = {} );
101
113 explicit MatrixParameters( std::shared_ptr<AMP::Discretization::DOFManager> dofLeft,
114 std::shared_ptr<AMP::Discretization::DOFManager> dofRight,
115 const AMP_MPI &comm,
116 std::shared_ptr<CommunicationList> commListLeft,
117 std::shared_ptr<CommunicationList> commListRight,
119 const std::function<std::vector<size_t>( size_t )> getRow = {} );
120
133 explicit MatrixParameters( std::shared_ptr<AMP::Discretization::DOFManager> dofLeft,
134 std::shared_ptr<AMP::Discretization::DOFManager> dofRight,
135 const AMP_MPI &comm,
136 std::shared_ptr<Variable> varLeft,
137 std::shared_ptr<Variable> varRight,
138 std::shared_ptr<CommunicationList> commListLeft,
139 std::shared_ptr<CommunicationList> commListRight,
140 const std::function<std::vector<size_t>( size_t )> getRow = {} );
141
155 explicit MatrixParameters( std::shared_ptr<AMP::Discretization::DOFManager> dofLeft,
156 std::shared_ptr<AMP::Discretization::DOFManager> dofRight,
157 const AMP_MPI &comm,
158 std::shared_ptr<Variable> varLeft,
159 std::shared_ptr<Variable> varRight,
160 std::shared_ptr<CommunicationList> commListLeft,
161 std::shared_ptr<CommunicationList> commListRight,
163 const std::function<std::vector<size_t>( size_t )> getRow = {} );
164
166 virtual ~MatrixParameters() = default;
167
169 size_t getLocalNumberOfRows() const;
170
173
175 size_t getGlobalNumberOfRows() const;
176
179
181 const std::function<std::vector<size_t>( size_t )> &getRowFunction() const { return d_getRow; }
182
185 std::shared_ptr<AMP::Discretization::DOFManager> getLeftDOFManager();
186
189 std::shared_ptr<AMP::Discretization::DOFManager> getRightDOFManager();
190
192 std::shared_ptr<CommunicationList> getLeftCommList();
193
195 std::shared_ptr<CommunicationList> getRightCommList();
196
197 std::string type() const override { return "MatrixParameters"; }
198
199public: // Write/read restart data
205 void registerChildObjects( AMP::IO::RestartManager *manager ) const override;
206
212 void writeRestart( int64_t fid ) const override;
213
220
221protected:
222 // Generate communication lists internally from the dof managers if not provided
224
225 // The DOFManager for the left vector ( may be null )
226 std::shared_ptr<AMP::Discretization::DOFManager> d_DOFManagerLeft;
227
228 // The DOFManager for the right vector ( may be null )
229 std::shared_ptr<AMP::Discretization::DOFManager> d_DOFManagerRight;
230
233 std::shared_ptr<CommunicationList> d_CommListLeft;
234
237 std::shared_ptr<CommunicationList> d_CommListRight;
238
240 std::function<std::vector<size_t>( size_t )> d_getRow;
241};
242} // namespace AMP::LinearAlgebra
243
244#endif
Provides C++ wrapper around MPI routines.
Definition AMP_MPI.h:63
Class to manage reading/writing restart data.
A class used to hold basic parameters for a matrix.
A class used to hold basic parameters for a matrix.
size_t getLocalNumberOfRows() const
Return the local number of rows.
size_t getGlobalNumberOfRows() const
Return the global number of rows.
MatrixParameters(std::shared_ptr< AMP::Discretization::DOFManager > dofLeft, std::shared_ptr< AMP::Discretization::DOFManager > dofRight, const AMP_MPI &comm, std::shared_ptr< Variable > varLeft, std::shared_ptr< Variable > varRight, AMP::Utilities::Backend backend, const std::function< std::vector< size_t >(size_t)> getRow={})
Constructor.
std::shared_ptr< CommunicationList > getRightCommList()
Get the communication list for the right vector.
MatrixParameters(std::shared_ptr< AMP::Discretization::DOFManager > dofLeft, std::shared_ptr< AMP::Discretization::DOFManager > dofRight, const AMP_MPI &comm, AMP::Utilities::Backend backend, const std::function< std::vector< size_t >(size_t)> getRow={})
Constructor.
std::function< std::vector< size_t >(size_t)> d_getRow
Function that generates column ids for each row of the matrix.
std::shared_ptr< CommunicationList > d_CommListLeft
MatrixParameters(std::shared_ptr< AMP::Discretization::DOFManager > dofLeft, std::shared_ptr< AMP::Discretization::DOFManager > dofRight, const AMP_MPI &comm, std::shared_ptr< Variable > varLeft, std::shared_ptr< Variable > varRight, std::shared_ptr< CommunicationList > commListLeft, std::shared_ptr< CommunicationList > commListRight, const std::function< std::vector< size_t >(size_t)> getRow={})
Constructor.
std::shared_ptr< AMP::Discretization::DOFManager > d_DOFManagerRight
size_t getGlobalNumberOfColumns() const
Return the global number of columns.
MatrixParameters(std::shared_ptr< AMP::Discretization::DOFManager > dofLeft, std::shared_ptr< AMP::Discretization::DOFManager > dofRight, const AMP_MPI &comm, std::shared_ptr< CommunicationList > commListLeft, std::shared_ptr< CommunicationList > commListRight, AMP::Utilities::Backend backend, const std::function< std::vector< size_t >(size_t)> getRow={})
Constructor.
std::shared_ptr< AMP::Discretization::DOFManager > d_DOFManagerLeft
size_t getLocalNumberOfColumns() const
Return the local number of columns.
MatrixParameters(std::shared_ptr< AMP::Discretization::DOFManager > dofLeft, std::shared_ptr< AMP::Discretization::DOFManager > dofRight, const AMP_MPI &comm, std::shared_ptr< Variable > varLeft, std::shared_ptr< Variable > varRight, const std::function< std::vector< size_t >(size_t)> getRow={})
Constructor.
MatrixParameters(int64_t fid, AMP::IO::RestartManager *manager)
Read restart data from file.
void writeRestart(int64_t fid) const override
Write restart data to file.
std::shared_ptr< AMP::Discretization::DOFManager > getRightDOFManager()
std::string type() const override
type of this object
virtual ~MatrixParameters()=default
Destructor.
const std::function< std::vector< size_t >(size_t)> & getRowFunction() const
Get the bound function that generates column IDs for each row.
MatrixParameters(std::shared_ptr< AMP::Discretization::DOFManager > dofLeft, std::shared_ptr< AMP::Discretization::DOFManager > dofRight, const AMP_MPI &comm, std::shared_ptr< Variable > varLeft, std::shared_ptr< Variable > varRight, std::shared_ptr< CommunicationList > commListLeft, std::shared_ptr< CommunicationList > commListRight, AMP::Utilities::Backend backend, const std::function< std::vector< size_t >(size_t)> getRow={})
Constructor.
MatrixParameters(std::shared_ptr< AMP::Discretization::DOFManager > dofLeft, std::shared_ptr< AMP::Discretization::DOFManager > dofRight, const AMP_MPI &comm, const std::function< std::vector< size_t >(size_t)> getRow={})
Constructor.
std::shared_ptr< AMP::Discretization::DOFManager > getLeftDOFManager()
std::shared_ptr< CommunicationList > d_CommListRight
std::shared_ptr< CommunicationList > getLeftCommList()
Get the communication list for the left vector.
void registerChildObjects(AMP::IO::RestartManager *manager) const override
Register any child objects.
MatrixParameters(std::shared_ptr< AMP::Discretization::DOFManager > dofLeft, std::shared_ptr< AMP::Discretization::DOFManager > dofRight, const AMP_MPI &comm, std::shared_ptr< CommunicationList > commListLeft, std::shared_ptr< CommunicationList > commListRight, const std::function< std::vector< size_t >(size_t)> getRow={})
Constructor.
Backend
Enum to store the backend used for gpu acceleration.
Definition Backend.h:21



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