source: src/comm/mpi/datatypes_local.hpp@ 716da7

Last change on this file since 716da7 was 716da7, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Fix energy calculation.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1729 5161e1c8-67bf-11de-9fd5-51895aff932f

  • Property mode set to 100644
File size: 1005 bytes
Line 
1#ifndef DATATYPES_LOCAL_HPP_
2#define DATATYPES_LOCAL_HPP_
3
4#include <vector>
5
6#include "comm/mpi/datatype.hpp"
7
8namespace VMG
9{
10
11class Grid;
12
13namespace Particle
14{
15class LinkedCellList;
16}
17
18namespace MPI
19{
20
21class DatatypesLocal
22{
23public:
24 DatatypesLocal(const Grid& grid, const MPI_Comm& comm)
25 {
26 InitDatatypesLocal(grid, comm, true);
27 }
28
29 DatatypesLocal(const VMG::Particle::LinkedCellList& grid, const MPI_Comm& comm)
30 {
31 InitDatatypesLocal(grid, comm, false);
32 }
33
34 ~DatatypesLocal() {}
35
36 std::vector<Datatype>& Halo() {return _halo;}
37 std::vector<Datatype>& NB() {return _nb;}
38
39 const std::vector<Datatype>& Halo() const {return _halo;}
40 const std::vector<Datatype>& NB() const {return _nb;}
41
42 const std::vector<Index>& Offset() const {return _offset;}
43
44private:
45 template <class T>
46 void InitDatatypesLocal(const T& grid, const MPI_Comm& comm, const bool& alloc_buffer);
47
48 std::vector<Datatype> _halo, _nb;
49 std::vector<Index> _offset;
50};
51
52}
53
54}
55
56#endif /* DATATYPES_LOCAL_HPP_ */
Note: See TracBrowser for help on using the repository browser.