ug4
ug::ComPol_InterfaceStatus< TLayout > Class Template Reference

Exchanges information on the interface-status of connected elements. More...

#include <compol_interface_status.h>

+ Inheritance diagram for ug::ComPol_InterfaceStatus< TLayout >:

Public Types

typedef Layout::Element Element
 
typedef Layout::Type GeomObj
 
typedef Layout::Interface Interface
 
typedef Interface::const_iterator InterfaceIter
 
typedef TLayout Layout
 
- Public Types inherited from pcl::ICommunicationPolicy< TLayout >
typedef Layout::Interface Interface
 
typedef TLayout Layout
 

Public Member Functions

virtual bool begin_layout_extraction (const Layout *pLayout)
 signals the beginning of a layout extraction. More...
 
virtual void begin_level_extraction (int level)
 signals that a new layout-level will now be processed. More...
 
virtual bool collect (ug::BinaryBuffer &buff, const Interface &interface)
 should write data which is associated with the interface elements to the buffer. More...
 
virtual bool extract (ug::BinaryBuffer &buff, const Interface &interface)
 extract data from the buffer and assigns it to the interface-elements. More...
 
virtual int get_required_buffer_size (const Interface &interface)
 returns the size of the buffer in bytes, that will be required for interface-communication. More...
 
const std::map< int, std::vector< bool > > & get_result_map (int level=0)
 
const std::vector< bool > & get_result_vec (int procRank, int level=0)
 returns the vector which holds the results for the interface to the given process More...
 
uint get_status ()
 returns the current status More...
 
void set_distributed_grid_manager (DistributedGridManager *distGridMgr)
 set the distributed grid manager More...
 
 ComPol_InterfaceStatus (uint status=INT_NONE)
 
 ComPol_InterfaceStatus (DistributedGridManager *distGridMgr, uint status=INT_NONE)
 
void set_status (uint status)
 
- Public Member Functions inherited from pcl::ICommunicationPolicy< TLayout >
virtual bool begin_layout_collection (const Layout *pLayout)
 signals the beginning of a layout collection. More...
 
virtual bool end_layout_collection (const Layout *pLayout)
 signals the end of a layout collection More...
 
virtual bool end_layout_extraction (const Layout *pLayout)
 signals the end of a layout extraction More...
 
virtual ~ICommunicationPolicy ()
 

Private Types

typedef std::map< int, std::vector< bool > > VecMap
 

Private Attributes

int m_curLevel
 
DistributedGridManagerm_distGridMgr
 
const TLayout * m_pLayout
 
uint m_status
 
std::vector< VecMapm_vecMaps
 

Detailed Description

template<class TLayout>
class ug::ComPol_InterfaceStatus< TLayout >

Exchanges information on the interface-status of connected elements.

The policy fills bool-vectors for each interface, telling whether the associated elements on the connected processes contain the given status. (at least one of both has to contain it).

The vectors are organized in a map. The rank of the process, to which the interface connects, is used as the key.

Member Typedef Documentation

◆ Element

template<class TLayout >
typedef Layout::Element ug::ComPol_InterfaceStatus< TLayout >::Element

◆ GeomObj

template<class TLayout >
typedef Layout::Type ug::ComPol_InterfaceStatus< TLayout >::GeomObj

◆ Interface

template<class TLayout >
typedef Layout::Interface ug::ComPol_InterfaceStatus< TLayout >::Interface

◆ InterfaceIter

template<class TLayout >
typedef Interface::const_iterator ug::ComPol_InterfaceStatus< TLayout >::InterfaceIter

◆ Layout

template<class TLayout >
typedef TLayout ug::ComPol_InterfaceStatus< TLayout >::Layout

◆ VecMap

template<class TLayout >
typedef std::map<int, std::vector<bool> > ug::ComPol_InterfaceStatus< TLayout >::VecMap
private

Constructor & Destructor Documentation

◆ ComPol_InterfaceStatus() [1/2]

template<class TLayout >
ug::ComPol_InterfaceStatus< TLayout >::ComPol_InterfaceStatus ( uint  status = INT_NONE)
inline
Parameters
status(optional - default: INT_NONE). An or-combination of the constants enumerated in InterfaceNodeTypes.

◆ ComPol_InterfaceStatus() [2/2]

template<class TLayout >
ug::ComPol_InterfaceStatus< TLayout >::ComPol_InterfaceStatus ( DistributedGridManager distGridMgr,
uint  status = INT_NONE 
)
inline
Parameters
status(optional - default: INT_NONE). An or-combination of the constants enumerated in InterfaceNodeTypes.

Member Function Documentation

◆ begin_layout_extraction()

template<class TLayout >
virtual bool ug::ComPol_InterfaceStatus< TLayout >::begin_layout_extraction ( const Layout pLayout)
inlinevirtual

signals the beginning of a layout extraction.

the default implementation returns true and does nothing else. This method is only called on processes which extract data.

Reimplemented from pcl::ICommunicationPolicy< TLayout >.

References ug::ComPol_InterfaceStatus< TLayout >::m_pLayout, and ug::ComPol_InterfaceStatus< TLayout >::m_vecMaps.

◆ begin_level_extraction()

template<class TLayout >
virtual void ug::ComPol_InterfaceStatus< TLayout >::begin_level_extraction ( int  level)
inlinevirtual

signals that a new layout-level will now be processed.

This is primarily interesting for layout-extraction of multi-level-layouts. Before extract is called for the interfaces of one level of a layout, begin_level_extraction(level) is called. If single-level-layouts are processed, this method is called once with level = 0. This method is called after begin_layout_extraction and before the associated extract calls.

Reimplemented from pcl::ICommunicationPolicy< TLayout >.

References ug::ComPol_InterfaceStatus< TLayout >::m_curLevel, ug::ComPol_InterfaceStatus< TLayout >::m_vecMaps, and UG_ASSERT.

◆ collect()

template<class TLayout >
virtual bool ug::ComPol_InterfaceStatus< TLayout >::collect ( ug::BinaryBuffer buff,
const Interface interface 
)
inlinevirtual

◆ extract()

template<class TLayout >
virtual bool ug::ComPol_InterfaceStatus< TLayout >::extract ( ug::BinaryBuffer buff,
const Interface interface 
)
inlinevirtual

extract data from the buffer and assigns it to the interface-elements.

If this method is called between calls to begin_layout_extraction and end_layout_extraction, the interface that is passed to this method belongs to the layout.

Implements pcl::ICommunicationPolicy< TLayout >.

References ug::DistributedGridManager::contains_status(), ug::ComPol_InterfaceStatus< TLayout >::m_curLevel, ug::ComPol_InterfaceStatus< TLayout >::m_distGridMgr, ug::ComPol_InterfaceStatus< TLayout >::m_status, ug::ComPol_InterfaceStatus< TLayout >::m_vecMaps, and ug::BinaryBuffer::read().

◆ get_required_buffer_size()

template<class TLayout >
virtual int ug::ComPol_InterfaceStatus< TLayout >::get_required_buffer_size ( const Interface interface)
inlinevirtual

returns the size of the buffer in bytes, that will be required for interface-communication.

Determines the size of the buffer on which the extract and receive methods for the given interface will operate. If the buffer-size can't be calculated on both sides (sender and receiver) this method should return -1. This will lead to an additional communication step in which buffer-sizes will be exchanged. If the buffer-size can be calculated on both sides, it makes sense to do so, since this leads to less communication and overall improved performance. The buffer-size has to exactly match the size of required memory. Make sure that you completely fill the buffer during collect(...) and that you read all data during extract(...). The default implementation returns -1.

Reimplemented from pcl::ICommunicationPolicy< TLayout >.

◆ get_result_map()

template<class TLayout >
const std::map<int, std::vector<bool> >& ug::ComPol_InterfaceStatus< TLayout >::get_result_map ( int  level = 0)
inline

◆ get_result_vec()

template<class TLayout >
const std::vector<bool>& ug::ComPol_InterfaceStatus< TLayout >::get_result_vec ( int  procRank,
int  level = 0 
)
inline

returns the vector which holds the results for the interface to the given process

This vector should not be accessed until after communication. After communication the vector has the size of the specified interface in the layout, for which communication was performed.

References ug::ComPol_InterfaceStatus< TLayout >::m_pLayout, ug::ComPol_InterfaceStatus< TLayout >::m_vecMaps, and UG_ASSERT.

◆ get_status()

template<class TLayout >
uint ug::ComPol_InterfaceStatus< TLayout >::get_status ( )
inline

returns the current status

References ug::ComPol_InterfaceStatus< TLayout >::m_status.

◆ set_distributed_grid_manager()

template<class TLayout >
void ug::ComPol_InterfaceStatus< TLayout >::set_distributed_grid_manager ( DistributedGridManager distGridMgr)
inline

set the distributed grid manager

References ug::ComPol_InterfaceStatus< TLayout >::m_distGridMgr.

◆ set_status()

template<class TLayout >
void ug::ComPol_InterfaceStatus< TLayout >::set_status ( uint  status)
inline
Parameters
status(optional - default: INT_NONE). An or-combination of the constants enumerated in InterfaceNodeTypes.

References ug::ComPol_InterfaceStatus< TLayout >::m_status.

Member Data Documentation

◆ m_curLevel

◆ m_distGridMgr

◆ m_pLayout

◆ m_status

◆ m_vecMaps


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