Sierra Toolkit
Version of the Day
|
#include <AggregateLinearSystem.hpp>
Inherits stk_classic::linsys::LinearSystemInterface.
Public Member Functions | |
AggregateLinearSystem (MPI_Comm comm, fei::SharedPtr< fei::Factory > factory, size_t num_matrices=1, size_t num_rhsvecs=1) | |
virtual | ~AggregateLinearSystem () |
void | set_parameters (Teuchos::ParameterList ¶mlist) |
void | set_num_matrices_rhsvecs (size_t num_matrices, size_t num_rhsvecs) |
void | synchronize_mappings_and_structure () |
void | create_fei_LinearSystem () |
fei::SharedPtr< fei::Matrix > | get_matrix (size_t index) |
fei::SharedPtr< fei::Vector > | get_rhsvec (size_t index) |
void | aggregate_system (const std::vector< double > &mat_scalars, const std::vector< double > &rhs_scalars) |
void | finalize_assembly () |
const DofMapper & | get_DofMapper () const |
DofMapper & | get_DofMapper () |
void | reset_to_zero () |
const fei::SharedPtr< fei::MatrixGraph > | get_fei_MatrixGraph () const |
fei::SharedPtr< fei::MatrixGraph > | get_fei_MatrixGraph () |
const fei::SharedPtr< fei::LinearSystem > | get_fei_LinearSystem () const |
fei::SharedPtr< fei::LinearSystem > | get_fei_LinearSystem () |
void | write_files (const std::string &base_name) const |
int | solve (int &status, const Teuchos::ParameterList ¶ms) |
Container for holding and manipulating collections of matrices and vectors.
This class provides the ability to form a linear system in which the matrix is a linear combination of other matrices, and the right-hand-side is a linear combination of other vectors. If n matrices A[0..n-1] and m vectors b[0..n-1] are each assembled, then the 'aggregate' linear-system is formed with A = sum(alpha[i]*A[i]) and b = sum(beta[i]*b[i]) where alpha and beta are arrays of scalars provided by the calling code.
Definition at line 32 of file AggregateLinearSystem.hpp.
stk_classic::linsys::AggregateLinearSystem::AggregateLinearSystem | ( | MPI_Comm | comm, |
fei::SharedPtr< fei::Factory > | factory, | ||
size_t | num_matrices = 1 , |
||
size_t | num_rhsvecs = 1 |
||
) |
Constructor
Definition at line 20 of file AggregateLinearSystem.cpp.
|
virtual |
Destructor
Definition at line 28 of file AggregateLinearSystem.cpp.
void stk_classic::linsys::AggregateLinearSystem::set_num_matrices_rhsvecs | ( | size_t | num_matrices, |
size_t | num_rhsvecs | ||
) |
set the number of matrices and right-hand-sides
Definition at line 39 of file AggregateLinearSystem.cpp.
void stk_classic::linsys::AggregateLinearSystem::synchronize_mappings_and_structure | ( | ) |
This is a collective call – will hang if only a subset of processors call it. Internally calls fei::MatrixGraph::initComplete() and DofMapper::finalize().
Definition at line 46 of file AggregateLinearSystem.cpp.
void stk_classic::linsys::AggregateLinearSystem::create_fei_LinearSystem | ( | ) |
Uses the fei::Factory (that was passed as a constructor argument) to create a fei::LinearSystem and populate it with a fei::Matrix and fei::Vectors.
Definition at line 52 of file AggregateLinearSystem.cpp.
fei::SharedPtr< fei::Matrix > stk_classic::linsys::AggregateLinearSystem::get_matrix | ( | size_t | index | ) |
Return the matrix at offset 'index' in the internally-stored array of matrices.
Definition at line 69 of file AggregateLinearSystem.cpp.
fei::SharedPtr< fei::Vector > stk_classic::linsys::AggregateLinearSystem::get_rhsvec | ( | size_t | index | ) |
Return the rhs-vec at offset 'index' in the internally-stored array of rhs-vectors.
Definition at line 79 of file AggregateLinearSystem.cpp.
void stk_classic::linsys::AggregateLinearSystem::aggregate_system | ( | const std::vector< double > & | mat_scalars, |
const std::vector< double > & | rhs_scalars | ||
) |
Given arrays of scalars (which must have the same lengths as specified when this class was constructed), form an aggregate linear system as described in the class-description comments above.
Definition at line 89 of file AggregateLinearSystem.cpp.
void stk_classic::linsys::AggregateLinearSystem::finalize_assembly | ( | ) |
This is a collective call – will hang if only a subset of processors call it. Internally calls fei::LinearSystem::loadComplete(), which in turn calls fei::Matrix::globalAssemble() and fei::Vector::gatherFromOverlap(). These operations perform communication to move shared contributions to owning processors, etc.
Definition at line 120 of file AggregateLinearSystem.cpp.
const DofMapper & stk_classic::linsys::AggregateLinearSystem::get_DofMapper | ( | ) | const |
Return DOF-mapping object
Definition at line 126 of file AggregateLinearSystem.cpp.
DofMapper & stk_classic::linsys::AggregateLinearSystem::get_DofMapper | ( | ) |
Return DOF-mapping object
Definition at line 132 of file AggregateLinearSystem.cpp.
const fei::SharedPtr< fei::MatrixGraph > stk_classic::linsys::AggregateLinearSystem::get_fei_MatrixGraph | ( | ) | const |
Return fei::MatrixGraph object
Definition at line 149 of file AggregateLinearSystem.cpp.
fei::SharedPtr< fei::MatrixGraph > stk_classic::linsys::AggregateLinearSystem::get_fei_MatrixGraph | ( | ) |
Return fei::MatrixGraph object
Definition at line 155 of file AggregateLinearSystem.cpp.
const fei::SharedPtr< fei::LinearSystem > stk_classic::linsys::AggregateLinearSystem::get_fei_LinearSystem | ( | ) | const |
Return fei::LinearSystem object
Definition at line 161 of file AggregateLinearSystem.cpp.
fei::SharedPtr< fei::LinearSystem > stk_classic::linsys::AggregateLinearSystem::get_fei_LinearSystem | ( | ) |
Return fei::LinearSystem object
Definition at line 167 of file AggregateLinearSystem.cpp.
int stk_classic::linsys::AggregateLinearSystem::solve | ( | int & | status, |
const Teuchos::ParameterList & | params | ||
) |
Solve the linear system Note that the caller is expected to have already called the method 'aggregate_system' if multiple matrices/rhs-vectors are being used.
status | Output flag indicating the termination condition of the underlying linear-solver. Values are solver-specific. In general, 0 indicates that the solver achieved a solution that satisfied the stopping test, within the iteration limit, etc. If an iterative solver fails to converge, this status value will generally be non-zero, but the actual value can vary by solver-library. |
params | Teuchos::ParameterList for the solver |
Definition at line 192 of file AggregateLinearSystem.cpp.