ug4
algebra_layouts.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2015: G-CSC, Goethe University Frankfurt
3  * Author: Andreas Vogel
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__UG4__LIB_ALGEBRA__PARALLELIZATION__ALGEBRA_LAYOUTS__
34 #define __H__UG4__LIB_ALGEBRA__PARALLELIZATION__ALGEBRA_LAYOUTS__
35 
36 #ifdef UG_PARALLEL
37 #include "pcl/pcl_base.h"
39 #endif
40 
41 namespace ug{
42 
43 #ifdef UG_PARALLEL
44 
46 
48 {
49  public:
51 
53  void clear()
54  {
56  }
57 
58  public:
61  const IndexLayout& master() const {return masterLayout;}
63  const IndexLayout& slave() const {return slaveLayout;}
64  const IndexLayout& slave_overlap() const {return slaveOverlapLayout;}
66 
69 
71 
79 
82  void enable_overlap(bool enable) {m_overlapEnabled = enable;}
84  bool overlap_enabled() const {return m_overlapEnabled;}
85 
86  public:
94 
100 
101  protected:
105 
109 
112 
115 
117 };
118 
121 {
122  public:
124  void clear()
125  {
128  }
129 
130  public:
136 
137  public:
143 
144  protected:
147 
150 };
151 
152 std::ostream &operator << (std::ostream &out, const HorizontalAlgebraLayouts &layouts);
153 std::ostream &operator << (std::ostream &out, const AlgebraLayouts &layouts);
154 
155 #endif
156 
157 
158 } // end namespace ug
159 
160 #endif /* __H__UG4__LIB_ALGEBRA__PARALLELIZATION__ALGEBRA_LAYOUTS__ */
Performs communication between interfaces on different processes.
Definition: pcl_interface_communicator.h:68
Definition: pcl_process_communicator.h:70
void clear()
clears the layout
Definition: pcl_communication_structs.h:522
Extends the HorizontalAlgebraLayouts by vertical layouts.
Definition: algebra_layouts.h:121
const IndexLayout & vertical_master() const
Definition: algebra_layouts.h:133
const IndexLayout & vertical_slave() const
Definition: algebra_layouts.h:134
IndexLayout verticalMasterLayout
vertical master index layout
Definition: algebra_layouts.h:146
void clear()
clears the struct
Definition: algebra_layouts.h:124
IndexLayout & vertical_master()
Definition: algebra_layouts.h:140
IndexLayout verticalSlaveLayout
vertical slave index layout
Definition: algebra_layouts.h:149
IndexLayout & vertical_slave()
Definition: algebra_layouts.h:141
Holds Interfaces and communicators for horizontal communication.
Definition: algebra_layouts.h:48
const pcl::ProcessCommunicator & proc_comm() const
returns process communicator
Definition: algebra_layouts.h:68
const IndexLayout & master_overlap() const
Definition: algebra_layouts.h:62
void enable_overlap(bool enable)
Definition: algebra_layouts.h:82
IndexLayout & master_overlap()
Definition: algebra_layouts.h:90
bool overlap_enabled() const
Tells whether overlap interfaces should be considered.
Definition: algebra_layouts.h:84
bool m_overlapEnabled
Definition: algebra_layouts.h:116
pcl::ProcessCommunicator & proc_comm()
Definition: algebra_layouts.h:98
IndexLayout & master()
Definition: algebra_layouts.h:89
IndexLayout slaveOverlapLayout
Definition: algebra_layouts.h:108
IndexLayout & slave()
Definition: algebra_layouts.h:91
IndexLayout & slave_overlap()
Definition: algebra_layouts.h:92
HorizontalAlgebraLayouts()
Definition: algebra_layouts.h:50
pcl::ProcessCommunicator processCommunicator
process communicator
Definition: algebra_layouts.h:111
const IndexLayout & slave() const
Definition: algebra_layouts.h:63
IndexLayout slaveLayout
(horizontal) slave index layout
Definition: algebra_layouts.h:107
const IndexLayout & master() const
Definition: algebra_layouts.h:61
pcl::InterfaceCommunicator< IndexLayout > & comm() const
returns (non-const !!!) communicator
Definition: algebra_layouts.h:78
pcl::InterfaceCommunicator< IndexLayout > communicator
communicator
Definition: algebra_layouts.h:114
pcl::InterfaceCommunicator< IndexLayout > & comm()
Definition: algebra_layouts.h:97
IndexLayout masterLayout
(horizontal) master index layout
Definition: algebra_layouts.h:103
IndexLayout masterOverlapLayout
Definition: algebra_layouts.h:104
void clear()
clears the struct
Definition: algebra_layouts.h:53
const IndexLayout & slave_overlap() const
Definition: algebra_layouts.h:64
std::ostream & operator<<(std::ostream &outStream, const ug::MathMatrix< 2, 2 > &m)
Definition: math_matrix.cpp:38
the ug namespace