A DataHandle class to exchange matrix sparsity patterns. More...
#include <dumux/linear/amgparallelhelpers.hh>
A DataHandle class to exchange matrix sparsity patterns.
We look at a 2D example with a nonoverlapping grid, two processes and no ghosts with Q1 discretization. Process 0 has the left part of the domain with three cells and eight vertices (1-8), Process 1 the right part with three cells and eight vertices (2,4,7-12).
1 _ 2 2 _ 9 _ 10 | | | | | 3 _ 4 _ 7 4 _ 7 _ 11 | | | | | 5 _ 6 _ 8 8 _ 12
If we look at vertex 7 and the corresponding entries in the matrix for P0, there will be entries for (7,4) and (7,8), but not for (7,2). The MatPatternExchange class will find these entries and returns a vector "sparsity", that contains all missing connections.
Public Types | |
using | DataType = IdType |
Export type of data for message buffer. More... | |
Public Member Functions | |
MatPatternExchange (const DofMapper &mapper, const std::map< IdType, int > &g2i, const std::map< int, IdType > &i2g, Matrix &A, const ParallelISTLHelper< GridView, AmgTraits > &helper) | |
Constructor. More... | |
bool | contains (int dim, int codim) const |
Returns true if data for given valid codim should be communicated. More... | |
bool | fixedsize (int dim, int codim) const |
Returns true if size of data per entity of given dim and codim is a constant. More... | |
template<class EntityType > | |
size_t | size (EntityType &e) const |
How many objects of type DataType have to be sent for a given entity. More... | |
template<class MessageBuffer , class EntityType > | |
void | gather (MessageBuffer &buff, const EntityType &e) const |
Pack data from user to message buffer. More... | |
template<class MessageBuffer , class EntityType > | |
void | scatter (MessageBuffer &buff, const EntityType &e, size_t n) |
Unpack data from message buffer to user. More... | |
std::vector< std::set< int > > & | sparsity () |
Get the communicated sparsity pattern. More... | |
using Dumux::EntityExchanger< GridView, AmgTraits >::MatPatternExchange::DataType = IdType |
Export type of data for message buffer.
|
inline |
Constructor.
[in] | mapper | The local dof mapper. |
[in] | g2i | Global to local index map. |
[in] | i2g | Local to global index map. |
[in] | A | Matrix to operate on. |
[in] | helper | parallel istl helper. |
|
inline |
Returns true if data for given valid codim should be communicated.
|
inline |
Returns true if size of data per entity of given dim and codim is a constant.
|
inline |
Pack data from user to message buffer.
|
inline |
Unpack data from message buffer to user.
|
inline |
How many objects of type DataType have to be sent for a given entity.
|
inline |
Get the communicated sparsity pattern.