ug4
lib_grid_messages.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2015: G-CSC, Goethe University Frankfurt
3  * Author: Sebastian Reiter
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__UG__lib_grid_messages__
34 #define __H__UG__lib_grid_messages__
35 
39 
40 namespace ug
41 {
42 
46  GMMGCT_REMOVED = 2
47 };
48 
51 {
52  public:
54  int numLevels) :
55  m_msgType(msgType),
56  m_numLevels(numLevels)
57  {}
58 
61 
63  int num_levels_in_grid() const {return m_numLevels;}
64 
65  private:
68 };
69 
70 
87 };
88 
91 {
92  public:
94  m_adaptionType(adaptionType) {}
95 
97  const GridObjectCollection& affectedElements) :
98  m_adaptionType(adaptionType),
99  m_affectedElements(affectedElements){}
100 
102 
104 
107  bool adaption_begins() const;
108  bool adaption_ends() const;
112 
114  bool step_begins() const;
115  bool step_ends() const;
119  bool adaptive() const;
120 
122  bool global() const;
123 
125 
126  bool refinement() const;
127 
129 
130  bool coarsening() const;
131 
133 
151 
152  protected:
155 };
156 
157 
163 };
164 
166 {
167  public:
170  m_msg(msg),
172  {}
173 
175 
177  {
178  return m_serializationHandler;
179  }
180 
181  private:
184 };
185 
186 
192 };
193 
195 {
196  public:
198  m_msg(msg), m_procId(procId) {}
199 
201  int proc_id() const {return m_procId;}
202 
203  private:
205  int m_procId;
206 };
207 
208 }// end of namespace
209 
210 #endif
Serialization of data associated with grid elements.
Definition: serialization.h:186
A message sent along with "GridRefinement" messages.
Definition: lib_grid_messages.h:91
GridMessage_Adaption(GridMessageAdaptionType adaptionType)
Definition: lib_grid_messages.h:93
GridMessageAdaptionType adaption_type() const
Definition: lib_grid_messages.h:101
const GridObjectCollection & affected_elements() const
returns the geometric-object-collection, which holds lists with affected elements.
Definition: lib_grid_messages.h:150
bool step_begins() const
tells whether an adaption step has just been started or has been finished.
Definition: lib_grid_messages.cpp:50
bool global() const
tells whether refinement / coarsening is global (global() == !adaptive())
Definition: lib_grid_messages.cpp:91
GridMessage_Adaption(GridMessageAdaptionType adaptionType, const GridObjectCollection &affectedElements)
Definition: lib_grid_messages.h:96
GridObjectCollection m_affectedElements
Definition: lib_grid_messages.h:154
GridMessageAdaptionType m_adaptionType
Definition: lib_grid_messages.h:153
bool adaptive() const
tells whether refinement / coarsening is adaptive (adaptive() == !global())
Definition: lib_grid_messages.cpp:76
bool adaption_ends() const
tells whether grid adaption has just been started or has been finished.
Definition: lib_grid_messages.cpp:44
bool adaption_begins() const
tells whether grid adaption has just been started or has been finished.
Definition: lib_grid_messages.cpp:38
bool step_ends() const
tells whether an adaption step has just been started or has been finished.
Definition: lib_grid_messages.cpp:63
bool coarsening() const
tells whether a step is a coarsen step
Definition: lib_grid_messages.cpp:119
bool refinement() const
tells whether a step is a refinement step.
Definition: lib_grid_messages.cpp:106
Definition: lib_grid_messages.h:195
int proc_id() const
Definition: lib_grid_messages.h:201
GridMessage_Creation(GridMessageCreationType msg=GMCT_NONE, int procId=-1)
Definition: lib_grid_messages.h:197
GridMessageCreationType m_msg
Definition: lib_grid_messages.h:204
GridMessageCreationType msg() const
Definition: lib_grid_messages.h:200
int m_procId
Definition: lib_grid_messages.h:205
Definition: lib_grid_messages.h:166
GridDataSerializationHandler & serialization_handler() const
Definition: lib_grid_messages.h:176
GridDataSerializationHandler & m_serializationHandler
Definition: lib_grid_messages.h:183
GridMessage_Distribution(GridMessageDistributionType msg, GridDataSerializationHandler &gdsh)
Definition: lib_grid_messages.h:168
GridMessageDistributionType m_msg
Definition: lib_grid_messages.h:182
GridMessageDistributionType msg() const
Definition: lib_grid_messages.h:174
A message sent by the MultiGrid, if something special happened.
Definition: lib_grid_messages.h:51
GridMessage_MultiGridChanged(GridMessageMultiGridChangedType msgType, int numLevels)
Definition: lib_grid_messages.h:53
GridMessageMultiGridChangedType m_msgType
Definition: lib_grid_messages.h:66
int m_numLevels
Definition: lib_grid_messages.h:67
int num_levels_in_grid() const
returns the current number of levels in the multigrid, which did send the message.
Definition: lib_grid_messages.h:63
GridMessageMultiGridChangedType message_type() const
returns the type of the message
Definition: lib_grid_messages.h:60
a helper class that holds a collection of possibly unconnected geometric-objects.
Definition: grid_object_collection.h:96
This is the base class of all messages, which may be passed to callbacks.
Definition: message_hub.h:133
the ug namespace
GridMessageCreationType
Instances of this class inform about grid creation (e.g. during load or distribution)
Definition: lib_grid_messages.h:188
@ GMCT_CREATION_STOPS
Definition: lib_grid_messages.h:191
@ GMCT_NONE
Definition: lib_grid_messages.h:189
@ GMCT_CREATION_STARTS
Definition: lib_grid_messages.h:190
GridMessageDistributionType
Instances of this class inform about distribution.
Definition: lib_grid_messages.h:159
@ GMDT_NONE
Definition: lib_grid_messages.h:160
@ GMDT_DISTRIBUTION_STARTS
Definition: lib_grid_messages.h:161
@ GMDT_DISTRIBUTION_STOPS
Definition: lib_grid_messages.h:162
GridMessageAdaptionType
constants which indicate the adaption type in a grid refinement message.
Definition: lib_grid_messages.h:73
@ GMAT_HNODE_COARSENING_ENDS
Definition: lib_grid_messages.h:86
@ GMAT_GLOBAL_REFINEMENT_BEGINS
Definition: lib_grid_messages.h:79
@ GMAT_GLOBAL_COARSENING_ENDS
Definition: lib_grid_messages.h:85
@ GMAT_UNKNOWN
Definition: lib_grid_messages.h:74
@ GMAT_GLOBAL_ADAPTION_ENDS
Definition: lib_grid_messages.h:77
@ GMAT_GLOBAL_COARSENING_BEGINS
Definition: lib_grid_messages.h:83
@ GMAT_HNODE_ADAPTION_ENDS
Definition: lib_grid_messages.h:78
@ GMAT_HNODE_ADAPTION_BEGINS
Definition: lib_grid_messages.h:76
@ GMAT_GLOBAL_REFINEMENT_ENDS
Definition: lib_grid_messages.h:81
@ GMAT_GLOBAL_ADAPTION_BEGINS
Definition: lib_grid_messages.h:75
@ GMAT_HNODE_REFINEMENT_ENDS
Definition: lib_grid_messages.h:82
@ GMAT_HNODE_REFINEMENT_BEGINS
Definition: lib_grid_messages.h:80
@ GMAT_HNODE_COARSENING_BEGINS
Definition: lib_grid_messages.h:84
GridMessageMultiGridChangedType
Definition: lib_grid_messages.h:44
@ GMMGCT_LEVEL_ADDED
Definition: lib_grid_messages.h:45
@ GMMGCT_REMOVED
Definition: lib_grid_messages.h:46