Line data Source code
1 : /*
2 : * Copyright (c) 2012-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 : #include "lib_grid_messages.h"
34 :
35 : namespace ug{
36 :
37 :
38 0 : bool GridMessage_Adaption::adaption_begins() const
39 : {
40 0 : return (m_adaptionType == GMAT_GLOBAL_ADAPTION_BEGINS)
41 0 : || (m_adaptionType == GMAT_HNODE_ADAPTION_BEGINS);
42 : }
43 :
44 0 : bool GridMessage_Adaption::adaption_ends() const
45 : {
46 0 : return (m_adaptionType == GMAT_GLOBAL_ADAPTION_ENDS)
47 0 : || (m_adaptionType == GMAT_HNODE_ADAPTION_ENDS);
48 : }
49 :
50 0 : bool GridMessage_Adaption::step_begins() const
51 : {
52 0 : switch(m_adaptionType){
53 : case GMAT_GLOBAL_REFINEMENT_BEGINS:
54 : case GMAT_HNODE_REFINEMENT_BEGINS:
55 : case GMAT_GLOBAL_COARSENING_BEGINS:
56 : case GMAT_HNODE_COARSENING_BEGINS:
57 : return true;
58 0 : default:
59 0 : return false;
60 : }
61 : }
62 :
63 0 : bool GridMessage_Adaption::step_ends() const
64 : {
65 0 : switch(m_adaptionType){
66 : case GMAT_GLOBAL_REFINEMENT_ENDS:
67 : case GMAT_HNODE_REFINEMENT_ENDS:
68 : case GMAT_GLOBAL_COARSENING_ENDS:
69 : case GMAT_HNODE_COARSENING_ENDS:
70 : return true;
71 0 : default:
72 0 : return false;
73 : }
74 : }
75 :
76 0 : bool GridMessage_Adaption::adaptive() const
77 : {
78 0 : switch(m_adaptionType){
79 : case GMAT_HNODE_ADAPTION_BEGINS:
80 : case GMAT_HNODE_ADAPTION_ENDS:
81 : case GMAT_HNODE_REFINEMENT_BEGINS:
82 : case GMAT_HNODE_REFINEMENT_ENDS:
83 : case GMAT_HNODE_COARSENING_BEGINS:
84 : case GMAT_HNODE_COARSENING_ENDS:
85 : return true;
86 0 : default:
87 0 : return false;
88 : }
89 : }
90 :
91 0 : bool GridMessage_Adaption::global() const
92 : {
93 0 : switch(m_adaptionType){
94 : case GMAT_GLOBAL_ADAPTION_BEGINS:
95 : case GMAT_GLOBAL_ADAPTION_ENDS:
96 : case GMAT_GLOBAL_REFINEMENT_BEGINS:
97 : case GMAT_GLOBAL_REFINEMENT_ENDS:
98 : case GMAT_GLOBAL_COARSENING_BEGINS:
99 : case GMAT_GLOBAL_COARSENING_ENDS:
100 : return true;
101 0 : default:
102 0 : return false;
103 : }
104 : }
105 :
106 0 : bool GridMessage_Adaption::refinement() const
107 : {
108 0 : switch(m_adaptionType){
109 : case GMAT_GLOBAL_REFINEMENT_BEGINS:
110 : case GMAT_HNODE_REFINEMENT_BEGINS:
111 : case GMAT_GLOBAL_REFINEMENT_ENDS:
112 : case GMAT_HNODE_REFINEMENT_ENDS:
113 : return true;
114 0 : default:
115 0 : return false;
116 : }
117 : }
118 :
119 0 : bool GridMessage_Adaption::coarsening() const
120 : {
121 0 : switch(m_adaptionType){
122 : case GMAT_GLOBAL_COARSENING_BEGINS:
123 : case GMAT_HNODE_COARSENING_BEGINS:
124 : case GMAT_GLOBAL_COARSENING_ENDS:
125 : case GMAT_HNODE_COARSENING_ENDS:
126 : return true;
127 0 : default:
128 0 : return false;
129 : }
130 : }
131 :
132 : }// end of namespace
|