Advanced Multi-Physics (AMP)
On-Line Documentation
Aggregator.h
Go to the documentation of this file.
1#ifndef included_AMP_Aggregator_H_
2#define included_AMP_Aggregator_H_
3
4#include "AMP/matrices/CSRMatrix.h"
5#include "AMP/matrices/Matrix.h"
6#include "AMP/matrices/MatrixParameters.h"
7#include "AMP/matrices/data/CSRLocalMatrixData.h"
8#include "AMP/matrices/data/CSRMatrixData.h"
9#include "AMP/solvers/amg/AggregationSettings.h"
10
11#include <memory>
12#include <numeric>
13
14namespace AMP::Solver::AMG {
15
16// Base class for all aggregators
17struct Aggregator {
18 Aggregator( const CoarsenSettings &settings )
19 : d_strength_threshold( settings.strength_threshold ),
20 d_strength_measure( settings.strength_measure ),
21 d_checkdd( settings.checkdd )
22 {
23 }
24
25 virtual ~Aggregator() {}
26
27 // This function must be supplied by each specific aggregator implementation
28 virtual int assignLocalAggregates( std::shared_ptr<LinearAlgebra::Matrix> A, int *agg_ids ) = 0;
29
30 // Invoke aggregator and return in the form of a tentative prolongator
31 std::shared_ptr<LinearAlgebra::Matrix>
32 getAggregateMatrix( std::shared_ptr<LinearAlgebra::Matrix> A,
33 std::shared_ptr<LinearAlgebra::MatrixParameters> matParams = {} );
34
35 // Produce non-type erased matrix for above tentative prolongator
36 template<typename Config>
37 std::shared_ptr<LinearAlgebra::Matrix>
39 std::shared_ptr<LinearAlgebra::MatrixParameters> matParams = {} );
40
42 const std::string d_strength_measure;
43 const bool d_checkdd;
44};
45
46} // namespace AMP::Solver::AMG
47
48#endif
An concrete class for dealing with dense serial matrices.
Definition CSRMatrix.h:26
const std::string d_strength_measure
Definition Aggregator.h:42
Aggregator(const CoarsenSettings &settings)
Definition Aggregator.h:18
std::shared_ptr< LinearAlgebra::Matrix > getAggregateMatrix(std::shared_ptr< LinearAlgebra::CSRMatrix< Config > > A, std::shared_ptr< LinearAlgebra::MatrixParameters > matParams={})
virtual int assignLocalAggregates(std::shared_ptr< LinearAlgebra::Matrix > A, int *agg_ids)=0
std::shared_ptr< LinearAlgebra::Matrix > getAggregateMatrix(std::shared_ptr< LinearAlgebra::Matrix > A, std::shared_ptr< LinearAlgebra::MatrixParameters > matParams={})



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:41.
Comments on this page