MeshColorizer< GridType > Class Template Reference

Generate a coloring of a mesh suitable for threaded assembly. The mesh is assumed structured, and is sliced in strips of alternating colors (two colors). The two color groups can then be assembled in parallel since they will never add to the same DOFs in the linear system. Currently it can only be instanced for a CpGrid. More...

#include <meshcolorizer.hpp>

Public Member Functions

 MeshColorizer (const GridType &grid_)
 Default constructor. More...
 
const IntMat & operator[] (unsigned int i)
 Return a color group. More...
 
void calcGroups ()
 Calculate the coloring. More...
 

Detailed Description

template<class GridType>
class MeshColorizer< GridType >

Generate a coloring of a mesh suitable for threaded assembly. The mesh is assumed structured, and is sliced in strips of alternating colors (two colors). The two color groups can then be assembled in parallel since they will never add to the same DOFs in the linear system. Currently it can only be instanced for a CpGrid.

Constructor & Destructor Documentation

template<class GridType>
MeshColorizer< GridType >::MeshColorizer ( const GridType &  grid_)
inline

Default constructor.

Parameters
[in]grid_The grid to colorize

References MeshColorizer< GridType >::calcGroups().

Member Function Documentation

template<class GridType>
void MeshColorizer< GridType >::calcGroups ( )

Calculate the coloring.

Referenced by MeshColorizer< GridType >::MeshColorizer().

template<class GridType>
const IntMat& MeshColorizer< GridType >::operator[] ( unsigned int  i)
inline

Return a color group.

Parameters
[in]iThe color to return, either 0 or 1

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