Advanced Multi-Physics (AMP)
On-Line Documentation
DenseSerialMatrixData.h
Go to the documentation of this file.
1#ifndef included_AMP_DenseSerialMatrixData
2#define included_AMP_DenseSerialMatrixData
3
4#include "AMP/discretization/DOF_Manager.h"
5#include "AMP/matrices/Matrix.h"
6#include "AMP/vectors/Vector.h"
7
8#include <memory>
9
10class DenseSerialMatrix;
11class DenseSerialMatrixOperations;
12
13namespace AMP::LinearAlgebra {
14
15
22{
23public:
27 explicit DenseSerialMatrixData( std::shared_ptr<MatrixParametersBase> params );
28
32
36
38 std::string type() const override { return "DenseSerialMatrixData"; }
39
43 std::shared_ptr<MatrixData> cloneMatrixData() const override;
44
45 std::shared_ptr<MatrixData> transpose() const override;
46
47 void removeRange( AMP::Scalar, AMP::Scalar ) override { AMP_ERROR( "Not implemented" ); }
48
60 void addValuesByGlobalID( size_t num_rows,
61 size_t num_cols,
62 const size_t *rows,
63 const size_t *cols,
64 const void *values,
65 const typeID &id ) override;
66
78 void setValuesByGlobalID( size_t num_rows,
79 size_t num_cols,
80 const size_t *rows,
81 const size_t *cols,
82 const void *values,
83 const typeID &id ) override;
84
95 void getValuesByGlobalID( size_t num_rows,
96 size_t num_cols,
97 const size_t *rows,
98 const size_t *cols,
99 void *values,
100 const typeID &id ) const override;
101
102
108 void getRowByGlobalID( size_t row,
109 std::vector<size_t> &cols,
110 std::vector<double> &values ) const override;
111
115 size_t numberColumnIDs( size_t row ) const override;
116
120 std::vector<size_t> getColumnIDs( size_t row ) const override;
121
126
132 std::shared_ptr<Discretization::DOFManager> getRightDOFManager() const override;
133
139 std::shared_ptr<Discretization::DOFManager> getLeftDOFManager() const override;
140
144 size_t numLocalRows() const override { return d_rows; }
145
149 size_t numGlobalRows() const override { return d_rows; }
150
154 size_t numLocalColumns() const override { return d_cols; }
155
159 size_t numGlobalColumns() const override { return d_cols; }
160
163 typeID getCoeffType() const override
164 {
165 constexpr auto type = getTypeID<double>();
166 return type;
167 }
168
169protected:
170 // AMP variables and DOFManagers for the left and right vectors
171 std::shared_ptr<AMP::Discretization::DOFManager> d_DOFManagerLeft;
172 std::shared_ptr<AMP::Discretization::DOFManager> d_DOFManagerRight;
173
174 // Data for the matrix
175 size_t d_rows;
176 size_t d_cols;
177 double *d_M = nullptr;
178
179 friend class DenseSerialMatrix;
181};
182} // namespace AMP::LinearAlgebra
183
184
185#endif
An concrete class for dealing with dense serial matrices.
std::shared_ptr< MatrixData > transpose() const override
Transpose.
size_t numLocalRows() const override
Get the number of local rows in the matrix.
void getRowByGlobalID(size_t row, std::vector< size_t > &cols, std::vector< double > &values) const override
Retrieve a row of the matrix in compressed format.
std::shared_ptr< AMP::Discretization::DOFManager > d_DOFManagerRight
std::string type() const override
Return the type of the matrix.
size_t numGlobalColumns() const override
Get the number of global columns in the matrix.
size_t numLocalColumns() const override
Get the number of local columns in the matrix.
DenseSerialMatrixData(std::shared_ptr< MatrixParametersBase > params)
Constructor.
size_t numGlobalRows() const override
Get the number of global rows in the matrix.
size_t numberColumnIDs(size_t row) const override
Given a row, retrieve the number of non-zero column indices of the matrix.
std::shared_ptr< Discretization::DOFManager > getLeftDOFManager() const override
Get the DOFManager associated with a left vector( For , is a left vector )
void getValuesByGlobalID(size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, void *values, const typeID &id) const override
Get values in the matrix.
void setValuesByGlobalID(size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, const void *values, const typeID &id) override
Set values in the matrix.
void removeRange(AMP::Scalar, AMP::Scalar) override
Remove matrix entries within given range.
std::shared_ptr< Discretization::DOFManager > getRightDOFManager() const override
Get the DOFManager associated with a right vector( For , is a right vector )
std::shared_ptr< AMP::Discretization::DOFManager > d_DOFManagerLeft
DenseSerialMatrixData & operator=(const DenseSerialMatrixData &)=delete
DenseSerialMatrixData(const DenseSerialMatrixData &)=delete
void makeConsistent(AMP::LinearAlgebra::ScatterType) override
Perform communication to ensure values in the matrix are the same across cores.
typeID getCoeffType() const override
Return the typeid of the matrix coeffs.
std::shared_ptr< MatrixData > cloneMatrixData() const override
Return a matrix with the same non-zero and distributed structure.
void addValuesByGlobalID(size_t num_rows, size_t num_cols, const size_t *rows, const size_t *cols, const void *values, const typeID &id) override
Add values to those in the matrix.
std::vector< size_t > getColumnIDs(size_t row) const override
Given a row, retrieve the non-zero column indices of the matrix in compressed format.
An concrete class for dealing with dense serial matrices.
Scalar is a class used to store a scalar variable that may be different types/precision.
Definition Scalar.h:21
#define AMP_ERROR(MSG)
Throw error.
ScatterType
Flag to choose algorithm for makeConsistent.
Definition Variable.h:21
Class to store type info.
Definition typeid.h:210



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