9#include <kernel/solver/base.hpp> 
   10#include <kernel/global/alg_dof_parti.hpp> 
   11#include <kernel/global/matrix.hpp> 
   12#include <kernel/global/filter.hpp> 
   13#include <kernel/global/vector.hpp> 
   14#include <kernel/global/pmdcdsc_matrix.hpp> 
   44    template<
typename Matrix_, 
typename Filter_, 
typename SolverBase_ = Solver::SolverBase<
typename Matrix_::VectorTypeL>>
 
   53      explicit ADPSolverBase(
const GlobalMatrixType& matrix, 
const GlobalFilterType& filter);
 
  116    template<
typename LocalMatrix_, 
typename Mirror_, 
typename GlobalFilter_, 
typename SolverBase_>
 
  117    class ADPSolverBase<Global::Matrix<LocalMatrix_, Mirror_, Mirror_>, GlobalFilter_, SolverBase_> :
 
  122      typedef LocalMatrix_ LocalMatrixType;
 
  123      typedef typename LocalMatrixType::VectorTypeL LocalVectorType;
 
  124      typedef Mirror_ MirrorType;
 
  128      typedef GlobalFilter_ GlobalFilterType;
 
  131      typedef SolverBase_ BaseClass;
 
  139      typedef typename AlgDofPartiType::DataType DataType;
 
  140      typedef typename AlgDofPartiType::IndexType IndexType;
 
  162        _system_matrix(matrix),
 
  163        _system_filter(filter)
 
  171        return this->_system_matrix.
get_comm();
 
  182        BaseClass::init_symbolic();
 
  185        _alg_dof_parti.assemble_by_gate(*this->_system_matrix.
get_row_gate());
 
  209        BaseClass::init_numeric();
 
  220        _adp_vec_cor.
clear();
 
  221        _adp_vec_def.
clear();
 
  223        _alg_dof_parti.clear();
 
  225        BaseClass::done_symbolic();
 
  231        return this->_alg_dof_parti.get_num_owned_dofs();
 
  236        return this->_alg_dof_parti.get_num_global_dofs();
 
  241        return this->_alg_dof_parti.get_global_dof_offset();
 
  251        return this->_adp_matrix.
owned().
val();
 
  281        this->_adp_vec_def.
upload(vec_def);
 
  286        this->_adp_vec_cor.
upload(vec_cor);
 
  291        this->_adp_vec_def.
download(vec_def);
 
  296        this->_adp_vec_cor.
download(vec_cor);
 
  315    template<
typename MatrixB_, 
typename MatrixD_, 
typename GlobalFilter_, 
typename SolverBase_>
 
  316    class ADPSolverBase<Global::PMDCDSCMatrix<MatrixB_, MatrixD_>, GlobalFilter_, SolverBase_> :
 
  322      typedef GlobalFilter_ GlobalFilterType;
 
  324      typedef typename GlobalMatrixType::LocalMatrixTypeS LocalMatrixTypeS;
 
  326      typedef typename GlobalMatrixType::VectorTypeL GlobalVectorType;
 
  329      typedef SolverBase_ BaseClass;
 
  333      typedef typename LocalMatrixTypeS::DataType DataType;
 
  334      typedef typename LocalMatrixTypeS::IndexType IndexType;
 
  340      Index _glob_dof_count;
 
  354        _system_matrix(matrix),
 
  355        _system_filter(filter)
 
  363        return this->_system_matrix.get_comm();
 
  368        BaseClass::init_symbolic();
 
  371        _matrix_slice = _system_matrix.asm_adp_symbolic(_glob_dof_offset, _glob_dof_count);
 
  376        BaseClass::init_numeric();
 
  379        _system_matrix.asm_adp_numeric(_matrix_slice);
 
  382        this->_system_filter.local().filter_mat(_matrix_slice);
 
  387        _matrix_slice.clear();
 
  388        BaseClass::done_symbolic();
 
  395        return _glob_dof_count;
 
  400        return _glob_dof_offset;
 
  405        return _matrix_slice.rows();
 
  410        return _matrix_slice.used_elements();
 
  415        return _matrix_slice.val();
 
  420        return _matrix_slice.row_ptr();
 
  425        return _matrix_slice.col_ind();
 
  430        return vec_def.local().elements();
 
  435        return vec_def.local().elements();
 
  440        return vec_cor.local().elements();
 
Algebraic DOF Partitioning implementation class template.
Algebraic DOF Partitioned CSR matrix class template.
void upload_symbolic(const GlobalMatrixType &mat_a)
Initializes this algebraic dof-partitioned matrix from a global matrix.
void upload_numeric(const GlobalMatrixType &mat_a)
Copies the matrix entry values from the input matrix into this algebraic-dof-partitioned matrix.
void filter_matrix(const Global::Filter< LocalFilter_, MirrorType > &filter)
Applies a global unit-filter into this matrix.
OwnedMatrixType & owned()
void clear()
Resets the whole object.
Algebraic DOF Partitioned Vector class template.
OwnedVectorType & owned()
void upload(const GlobalVectorType &global_vector)
Copies the DOF values from a global vector to this algebraic-dof-partitioned vector.
void download(GlobalVectorType &global_vector) const
Copies the DOF values from this algebraic-dof-partitioned vector into a global vector.
void clear()
Resets the whole object.
Global Matrix wrapper class template.
const GateRowType * get_row_gate() const
Returns a const pointer to the internal row gate of the matrix.
const Dist::Comm * get_comm() const
Returns a const pointer to the internal communicator of the gates of the matrix.
Pre-Multiplied Discontinuous Diagonal Schur-Complement Matrix.
Global vector wrapper class template.
void format(DT_ value=DT_(0))
Reset all elements of the container to a given value or zero if missing.
DT_ * elements()
Get a pointer to the data array.
IT_ * col_ind()
Retrieve column indices array.
DT_ * val()
Retrieve non zero element array.
Index used_elements() const
Retrieve non zero element count.
IT_ * row_ptr()
Retrieve row start index array.
virtual void init_symbolic() override
Symbolic Initialization.
AlgDofPartiType _alg_dof_parti
the algebraic DOF partitioning
virtual void init_numeric() override
Numeric Initialization.
const Dist::Comm * _get_comm() const
const GlobalMatrixType & _system_matrix
the global system matrix
ADPVectorType _adp_vec_def
two ADP vectors for correction and defect vectors
ADPMatrixType _adp_matrix
the ADP matrix
const GlobalFilterType & _system_filter
the global system filter
const GlobalFilterType & _system_filter
the global system filter
LocalMatrixTypeS _matrix_slice
our Schur-complement matrix slice
Index _glob_dof_offset
our global DOF offset
const Dist::Comm * _get_comm() const
const GlobalMatrixType & _system_matrix
the global system matrix
Base-Class for Solvers based on Algebraic-DOF-Partitioning.
const Dist::Comm * _get_comm() const
const DataType * _get_mat_vals() const
Index _get_mat_num_nze() const
const IndexType * _get_mat_col_idx() const
ADPSolverBase(const GlobalMatrixType &matrix, const GlobalFilterType &filter)
constructor
DataType * _get_vec_cor_vals(VectorType &vec_cor)
DataType * _get_vec_def_vals(VectorType &vec_def)
Index _get_num_owned_dofs() const
void _download_vec_def(VectorType &vec_def)
Index _get_global_dof_offset() const
const DataType * _get_vec_def_vals(const VectorType &vec_def)
void _download_vec_cor(VectorType &vec_cor)
const IndexType * _get_mat_row_ptr() const
Index _get_num_global_dofs() const
void _upload_vec_def(const VectorType &vec_def)
void _upload_vec_cor(const VectorType &vec_cor)
virtual void init_symbolic()
Symbolic initialization method.
virtual void init_numeric()
Numeric initialization method.
virtual void done_symbolic()
Symbolic finalization method.
Vector_ VectorType
The type of vector this solver can be applied to.
std::uint64_t Index
Index data type.