AFEPack
公有类型 | 公有成员 | 私有类型 | 私有成员 | 私有属性
MPI::FaceData::Syncer< FOREST, PACKER >模板类参考

#include <MPI_FaceData.h>

所有成员的列表。

公有类型

enum  { dim = FOREST::dim, dow = FOREST::dow }
typedef FOREST forest_t
typedef PACKER packer_t
typedef packer_t::data_t data_t
typedef HGeometry< dim-1, dowgeometry_t

公有成员

 Syncer ()
 Syncer (const forest_t &forest)
 Syncer (const forest_t &forest, const packer_t &packer)
 Syncer (const this_t &syncer)
void set_forest (const forest_t &forest)
const forest_tforest () const
void set_packer (const packer_t &packer)
const packer_t::packer_t * packer () const
template<class OBJ >
data_tget_send_buffer (const OBJ &obj) const
template<class OBJ >
data_tget_recv_buffer (const OBJ &obj) const
void free_data_buffer ()
void update_transmit_map ()
void sync (bool is_update_transmit_map=true)
bool is_pack_data (geometry_t *geo) const
void pack_data (geometry_t *geo, int remote_rank, AFEPack::ostream<> &os)
void unpack_data (geometry_t *geo, int remote_rank, AFEPack::istream<> &is)

私有类型

typedef Syncer< forest_t,
packer_t
this_t

私有成员

void new_property ()
void free_property ()

私有属性

const forest_t_forest
packer_t _packer
property_id_t< data_t_pid_out
property_id_t< data_t_pid_in
Transmit_map< geometry_t_transmit_map

详细描述

template<class FOREST, class PACKER>
class MPI::FaceData::Syncer< FOREST, PACKER >

Syncer 主要用来提供一个方便的对面上的双边数据进行交换的接口,这 是有限体积类型方法中最主要的数据交换方式。其特点在于,每个需要交 换的数据是双边的,即只需要发送给一个邻居分区和从一个邻居分区获取。 如果数据事实上不是双边的,操作结果是未知的。

FOREST 模板参数用来指定所依赖的几何遗传树。PACKER 模板参数是完成 交换的最主要的实现部分,我们要求其提供需要进行交换的数据类型

typename PACKER::data_t;

和提供用户方面接口的

DATA * PACKER::new_property(const OBJ&, const property_id_t<DATA>&) const DATA * PACKER::get_property(const OBJ&, const property_id_t<DATA>&) cosnt

成员函数,其中 OBJ 是模板。PACKER 的设计主要由库完成,对于用户这 应该是困难的工作。为了方便,我们提供另外一个包装方案Packer,使得 对于 RegularMeshDGFEMSpace 这两种实用情况的得以实现。

下面是对这个类进行使用的例子代码:

/// 需要交换的数据类型为 std::vector<double> typedef MPI::FaceData::FESpace<std::vector<double>,fe_space_t> data_packer_t; typedef MPI::FaceData::Syncer<forest_t,typename data_packer_t::packer_t> syncer_t;

syncer_t syncer(htree, data_packer_t::get_packer(fem_space)); for (the_dgele 是单元之间的边界) { if (the_dgele 是一个需要交换数据的分区之间的边) { /// 取出需要交换的数据缓冲区 std::vector<double> * p_buf = syncer.get_send_buffer(*the_dgele); ... ... /// 对需要交换的数据进行填充 } } syncer.sync(); /// 交换数据 for (the_dgele 是单元之间的边界) { if (the_dgele 是一个需要交换数据的分区之间的边) { /// 取出需要交换的数据缓冲区 std::vector<double> * p_buf = syncer.get_recv_buffer(*the_dgele); ... ... /// 对交换后的数据进行解码 } }


成员类型定义文档

template<class FOREST , class PACKER >
typedef packer_t::data_t MPI::FaceData::Syncer< FOREST, PACKER >::data_t
template<class FOREST , class PACKER >
typedef FOREST MPI::FaceData::Syncer< FOREST, PACKER >::forest_t
template<class FOREST , class PACKER >
typedef HGeometry<dim-1,dow> MPI::FaceData::Syncer< FOREST, PACKER >::geometry_t
template<class FOREST , class PACKER >
typedef PACKER MPI::FaceData::Syncer< FOREST, PACKER >::packer_t
template<class FOREST , class PACKER >
typedef Syncer<forest_t,packer_t> MPI::FaceData::Syncer< FOREST, PACKER >::this_t [private]

成员枚举类型文档

template<class FOREST , class PACKER >
anonymous enum
枚举值:
dim 
dow 

构造及析构函数文档

template<class FOREST , class PACKER >
MPI::FaceData::Syncer< FOREST, PACKER >::Syncer ( ) [inline]
template<class FOREST , class PACKER >
MPI::FaceData::Syncer< FOREST, PACKER >::Syncer ( const forest_t forest) [inline]
template<class FOREST , class PACKER >
MPI::FaceData::Syncer< FOREST, PACKER >::Syncer ( const forest_t forest,
const packer_t packer 
) [inline]
template<class FOREST , class PACKER >
MPI::FaceData::Syncer< FOREST, PACKER >::Syncer ( const this_t syncer) [inline]

成员函数文档

template<class FOREST , class PACKER >
const forest_t& MPI::FaceData::Syncer< FOREST, PACKER >::forest ( ) const [inline]
template<class FOREST , class PACKER >
void MPI::FaceData::Syncer< FOREST, PACKER >::free_data_buffer ( ) [inline]

显式释放数据缓冲区。

template<class FOREST , class PACKER >
void MPI::FaceData::Syncer< FOREST, PACKER >::free_property ( ) [inline, private]
template<class FOREST , class PACKER >
template<class OBJ >
data_t* MPI::FaceData::Syncer< FOREST, PACKER >::get_recv_buffer ( const OBJ obj) const [inline]

获取依附于对象上的数据接收缓冲区。OBJ 可以是面几何体或者 DGElement。

template<class FOREST , class PACKER >
template<class OBJ >
data_t* MPI::FaceData::Syncer< FOREST, PACKER >::get_send_buffer ( const OBJ obj) const [inline]

获取依附于对象上的数据发送缓冲区。OBJ 可以是面几何体或者 DGElement。如果缓冲区没有分配,则会进行分配。

template<class FOREST , class PACKER >
bool MPI::FaceData::Syncer< FOREST, PACKER >::is_pack_data ( geometry_t geo) const [inline]

此处数据应该是由使用方填入,但并不是所有的面几何体均有此数据。 此处判断仅仅对有数据发送的几何体进行操作。

template<class FOREST , class PACKER >
void MPI::FaceData::Syncer< FOREST, PACKER >::new_property ( ) [inline, private]
template<class FOREST , class PACKER >
void MPI::FaceData::Syncer< FOREST, PACKER >::pack_data ( geometry_t geo,
int  remote_rank,
AFEPack::ostream<> &  os 
) [inline]
template<class FOREST , class PACKER >
const packer_t::packer_t* MPI::FaceData::Syncer< FOREST, PACKER >::packer ( ) const [inline]
template<class FOREST , class PACKER >
void MPI::FaceData::Syncer< FOREST, PACKER >::set_forest ( const forest_t forest) [inline]
template<class FOREST , class PACKER >
void MPI::FaceData::Syncer< FOREST, PACKER >::set_packer ( const packer_t packer) [inline]
template<class FOREST , class PACKER >
void MPI::FaceData::Syncer< FOREST, PACKER >::sync ( bool  is_update_transmit_map = true) [inline]

完成数据的交换。在数据交换前,应将发送数据填入数据发送缓冲区, 在交换后可从数据接收缓冲区中获取解收到的数据。在本类的对象自 身析构后,数据缓冲区将自行释放。数据缓冲区是可以重用的,但是 也可以显式调用 free_data_buffer 将所有数据缓冲区释放。

template<class FOREST , class PACKER >
void MPI::FaceData::Syncer< FOREST, PACKER >::unpack_data ( geometry_t geo,
int  remote_rank,
AFEPack::istream<> &  is 
) [inline]
template<class FOREST , class PACKER >
void MPI::FaceData::Syncer< FOREST, PACKER >::update_transmit_map ( ) [inline]

更新数据交换图表。


成员数据文档

template<class FOREST , class PACKER >
const forest_t* MPI::FaceData::Syncer< FOREST, PACKER >::_forest [private]
template<class FOREST , class PACKER >
packer_t MPI::FaceData::Syncer< FOREST, PACKER >::_packer [private]
template<class FOREST , class PACKER >
property_id_t<data_t> MPI::FaceData::Syncer< FOREST, PACKER >::_pid_in [private]
template<class FOREST , class PACKER >
property_id_t<data_t> MPI::FaceData::Syncer< FOREST, PACKER >::_pid_out [private]
template<class FOREST , class PACKER >
Transmit_map<geometry_t> MPI::FaceData::Syncer< FOREST, PACKER >::_transmit_map [private]

该类的文档由以下文件生成: