ug4
ug::OverlapWriter< TAlgebra > Class Template Reference

Writes overlapping matrices and vectors. More...

#include <overlap_writer.h>

Public Types

typedef TAlgebra::matrix_type matrix_type
 
typedef TAlgebra::vector_type vector_type
 

Public Member Functions

void init (const AlgebraLayouts &layouts, IVectorDebugWriter< vector_type > &dbgWriter, size_t overlapVecSize)
 
template<class vector_t >
void init (const AlgebraLayouts &layouts, size_t nonOverlapVecSize, vector_t *nonOverlapPositions, size_t overlapVecSize)
 
 OverlapWriter ()
 
template<class T >
void write (const T &t, std::string name)
 

Private Member Functions

std::vector< MathVector< 1 > > & get_pos (Int2Type< 1 >)
 
std::vector< MathVector< 2 > > & get_pos (Int2Type< 2 >)
 
std::vector< MathVector< 3 > > & get_pos (Int2Type< 3 >)
 
template<int dim>
void write_dim_ (const matrix_type &A, std::string name)
 
template<int dim>
void write_dim_ (const vector_type &v, std::string name)
 

Private Attributes

int m_dim
 
std::vector< MathVector< 1 > > m_pos1d
 
std::vector< MathVector< 2 > > m_pos2d
 
std::vector< MathVector< 3 > > m_pos3d
 

Detailed Description

template<class TAlgebra>
class ug::OverlapWriter< TAlgebra >

Writes overlapping matrices and vectors.

Since local positions of overlapping matrices and vectors are not present in the DebugWriter, we have to first communicate missing positions and then use those positions to write the vectors and matrices.

See also
CreateOverlap

Member Typedef Documentation

◆ matrix_type

template<class TAlgebra >
typedef TAlgebra::matrix_type ug::OverlapWriter< TAlgebra >::matrix_type

◆ vector_type

template<class TAlgebra >
typedef TAlgebra::vector_type ug::OverlapWriter< TAlgebra >::vector_type

Constructor & Destructor Documentation

◆ OverlapWriter()

template<class TAlgebra >
ug::OverlapWriter< TAlgebra >::OverlapWriter ( )
inline

Member Function Documentation

◆ get_pos() [1/3]

template<class TAlgebra >
std::vector<MathVector<1> >& ug::OverlapWriter< TAlgebra >::get_pos ( Int2Type< 1 >  )
inlineprivate

◆ get_pos() [2/3]

template<class TAlgebra >
std::vector<MathVector<2> >& ug::OverlapWriter< TAlgebra >::get_pos ( Int2Type< 2 >  )
inlineprivate

◆ get_pos() [3/3]

template<class TAlgebra >
std::vector<MathVector<3> >& ug::OverlapWriter< TAlgebra >::get_pos ( Int2Type< 3 >  )
inlineprivate

◆ init() [1/2]

template<class TAlgebra >
void ug::OverlapWriter< TAlgebra >::init ( const AlgebraLayouts layouts,
IVectorDebugWriter< vector_type > &  dbgWriter,
size_t  overlapVecSize 
)
inline
Parameters
dbgWriterUsed to extract position data. The size of the position data is assumed to be the size of the underlying non-overlapping vector.
overlapVecSizeSize of the overlapping vector.

References ug::IVectorDebugWriter< TVector >::get_dim(), ug::OverlapWriter< TAlgebra >::init(), ug::OverlapWriter< TAlgebra >::m_dim, and UG_THROW.

◆ init() [2/2]

template<class TAlgebra >
template<class vector_t >
void ug::OverlapWriter< TAlgebra >::init ( const AlgebraLayouts layouts,
size_t  nonOverlapVecSize,
vector_t *  nonOverlapPositions,
size_t  overlapVecSize 
)
inline

vector_t has to be a MathVector<dim> compatible type.

Parameters
nonOverlapVecSizeSize of the underlying non-overlapping vector.
nonOverlapPositionsArray of length 'nonOverlapVecSize' containing the positions of each vector entry in the underlying non-overlapping vector.
overlapVecSizeSize of the overlapping vector.

References ug::HorizontalAlgebraLayouts::comm(), ug::CopyValues(), ug::OverlapWriter< TAlgebra >::get_pos(), ug::OverlapWriter< TAlgebra >::m_dim, ug::HorizontalAlgebraLayouts::master_overlap(), ug::HorizontalAlgebraLayouts::slave_overlap(), and UG_COND_THROW.

Referenced by ug::OverlapWriter< TAlgebra >::init().

◆ write()

template<class TAlgebra >
template<class T >
void ug::OverlapWriter< TAlgebra >::write ( const T &  t,
std::string  name 
)
inline

Writes a matrix or a vector to a connection viewer file. T has to be either of type TAlgebra::vector_type or TAlgebra::matrix_type.

References ug::OverlapWriter< TAlgebra >::m_dim, name, and UG_COND_THROW.

◆ write_dim_() [1/2]

template<class TAlgebra >
template<int dim>
void ug::OverlapWriter< TAlgebra >::write_dim_ ( const matrix_type A,
std::string  name 
)
inlineprivate

◆ write_dim_() [2/2]

template<class TAlgebra >
template<int dim>
void ug::OverlapWriter< TAlgebra >::write_dim_ ( const vector_type v,
std::string  name 
)
inlineprivate

Member Data Documentation

◆ m_dim

◆ m_pos1d

template<class TAlgebra >
std::vector<MathVector<1> > ug::OverlapWriter< TAlgebra >::m_pos1d
private

◆ m_pos2d

template<class TAlgebra >
std::vector<MathVector<2> > ug::OverlapWriter< TAlgebra >::m_pos2d
private

◆ m_pos3d

template<class TAlgebra >
std::vector<MathVector<3> > ug::OverlapWriter< TAlgebra >::m_pos3d
private

The documentation for this class was generated from the following file: