version 3.11-dev
Loading...
Searching...
No Matches
dumuxmessage.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_MESSAGE_HH
13#define DUMUX_MESSAGE_HH
14
15#include <iomanip>
16#include <iostream>
17#include <ctime>
18
19#include <dumux/io/format.hh>
20
21namespace Dumux {
22
28{
30 static const int nMessages_ = 34;
31
32public:
33
38 static void print(bool firstCall = false)
39 {
40 // initialize in case someone forgets to set first call
41 static int dice = 8;
42
43 if(firstCall)
44 {
45 // roll the dice to decide which start message will be displayed
46 std::srand(std::time(0));
47 dice = std::rand() % (nMessages_ + 1);
48 }
49
50 std::cout << std::endl;
51
52 switch (dice)
53 {
54 case 0:
55 if(firstCall)
56 std::cout << "Welcome aboard DuMuX airlines. Please fasten your seatbelts! "
57 << "Emergency exits are near the time integration." << std::endl;
58 else
59 std::cout << "We hope that you enjoyed simulating with us " << std::endl
60 << "and that you will choose us next time, too." << std::endl;
61 break;
62 case 1:
63 if(firstCall)
64 std::cout << "Let's get the cow off the ice." << std::endl;
65 else
66 std::cout << "DuMuX got the cow off the ice." << std::endl;
67 break;
68 case 2:
69 if(firstCall)
70 std::cout << "Science, my lad, is made up of mistakes, but they are "
71 << "mistakes which it is useful to make, because they lead little "
72 << "by little to the truth." << std::endl
73 << " - Jules Verne, A journey to the center of the earth" << std::endl;
74 else
75 std::cout << "[We see that] science is eminently perfectible, and that each theory has "
76 << "constantly to give way to a fresh one." << std::endl
77 << " - Jules Verne, Journey to the Center of the Earth" << std::endl;
78
79 break;
80 case 3:
81 if(firstCall)
82 std::cout << "Wherever he saw a hole he always wanted to know the depth of it. "
83 << "To him this was important." << std::endl
84 << " - Jules Verne, A journey to the center of the earth" << std::endl;
85 else
86 std::cout << "We may brave human laws, but we cannot resist natural ones." << std::endl
87 << " - Jules Verne, 20,000 Leagues Under the Sea" << std::endl;
88 break;
89 case 4:
90 if(firstCall)
91 std::cout << "Silence - to delight Bernd." << std::endl;
92 else
93 std::cout << std::endl << std::endl;
94 break;
95 case 5:
96 std::cout << "Don't panic... !" << std::endl;
97 break;
98 case 6:
99 if(firstCall)
100 std::cout << "You idiot! You signed the order to destroy Earth!" << std::endl
101 << " - Douglas Adams, HGttG" << std::endl;
102 else
103 std::cout << "Marvin: I've been talking to the main computer." << std::endl
104 << "Arthur: And?" << std::endl
105 << "Marvin: It hates me." << std::endl
106 << " - Douglas Adams, HGttG" << std::endl;
107 break;
108 case 7:
109 if(firstCall)
110 std::cout << "In the beginning the Universe was created. This has made a lot of "
111 << "people very angry and has been widely regarded as a bad move.!" << std::endl
112 << " - Douglas Adams, HGttG " << std::endl;
113 else
114 std::cout << "Forty-two. I checked it very thoroughly, and that quite definitely is the answer. I think "
115 << "the problem, to be quite honest with you, is that you\'ve never actually known what the question is." << std::endl
116 << " - Douglas Adams, HGttG " << std::endl;
117 break;
118 case 8:
119 std::cout << " ## @@@@ @ @ @ @" << std::endl;
120 std::cout << " ### # @ @ @@ @@ @ " << std::endl;
121 std::cout << " ## # @ @ @ @ @ @ @ @ @ @ @" << std::endl;
122 std::cout << " ## # @ @ @ @ @ @ @ @ " << std::endl;
123 std::cout << " # # @@@@ @@@ @ @ @@@ " << std::endl;
124 std::cout << " # # " << std::endl;
125 std::cout << " # # " << std::endl;
126 std::cout << " # ## %%% " << std::setw(8) << std::right << DUMUX_VERSION << std::endl;
127 std::cout << " # ### % % %% %% " << std::endl;
128 std::cout << "#### #%%% %% %%%%% %%%%%%%%%%%%%%%%%" << std::endl;
129 break;
130 case 9:
131 std::cout << "### # # # # " << std::endl;
132 std::cout << "# # # # ## ## # # # " << std::endl;
133 std::cout << "# # # # # # # # # # # " << std::endl;
134 std::cout << "### ## # # ## " << std::endl;
135 std::cout << " " << std::endl;
136 std::cout << "Dune for Multi-{ Phase, " << std::endl;
137 std::cout << " Component, " << std::endl;
138 std::cout << " Scale, " << std::endl;
139 std::cout << " Physics, " << std::endl;
140 std::cout << " Domain, " << std::endl;
141 std::cout << " ...} flow, transport and deformation " << std::endl;
142 break;
143 case 10:
144 if(firstCall)
145 std::cout << "Elliot Carver: Mr. Jones, are we ready to release our new software?" << std::endl
146 << "Jones: Yes, sir. As requested, it's full of bugs, which means people will be forced to upgrade for years." << std::endl
147 << " - James Bond, Tomorrow Never Dies" << std::endl;
148 else
149 {
150 std::cout << "Elliot Carver: Outstanding." << std::endl
151 << " - James Bond, Tomorrow Never Dies" << std::endl;
152 }
153 break;
154 case 11:
155 if(firstCall)
156 std::cout << "Chuck Norris has successfully compiled DuMuX." << std::endl;
157 else
158 std::cout << "Chuck Norris has compiled DuMuX even two times in a row!" << std::endl;
159 break;
160 case 12:
161 if (firstCall)
162 {
163 std::cout << " ┌──────────────────┐" << std::endl;
164 std::cout << Fmt::format(" │{:^20}│", Fmt::format("DuMuX {} \u2661", DUMUX_VERSION)) << std::endl;
165 std::cout << " └──────────────────┘" << std::endl;
166 }
167 else
168 std::cout << "\n" << std::endl;
169 break;
170 case 13:
171 if(firstCall)
172 {
173 std::cout << "Everything starts somewhere, though many physicists disagree." << std::endl
174 << " - Terry Pratchett " << std::endl;
175 }
176 else
177 {
178 std::cout << "Opera happens because a large number of things amazingly fail to go wrong." << std::endl
179 << " - Terry Pratchett " << std::endl;
180 }
181 break;
182 case 14:
183 std::cout << "To infinity and beyond." << std::endl
184 << " - Buzz Lightyear, Toy Story" << std::endl;
185 break;
186 case 15:
187 if(firstCall)
188 {
189 std::cout << "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off." << std::endl
190 << " - Bjarne Stroustrup " << std::endl;
191 }
192 else
193 {
194 std::cout << "There's an old story about the person who wished his computer were as easy to use as his telephone." << std::endl
195 << "That wish has come true, since I no longer know how to use my telephone." << std::endl
196 << " - Bjarne Stroustrup " << std::endl;
197 }
198 break;
199 case 16:
200 if(firstCall)
201 {
202 std::cout << "Now, all we need is a little Energon and a lot of luck!" << std::endl
203 << " - Optimus Prime, The Transformers: The Movie " << std::endl;
204 }
205 else
206 {
207 std::cout << "Sometimes even the wisest of men and machines can be in error." << std::endl
208 << " - Optimus Prime, The Transformers: The Movie " << std::endl;
209 }
210 break;
211 case 17:
212 if(firstCall)
213 {
214 std::cout << "Let's go. In and out, 20 minutes adventure." << std::endl
215 << " - Rick Sanchez, Rick & Morty " << std::endl;
216 }
217 else
218 {
219 std::cout << "Losers look stuff up while the rest of us are carpin' all them diems." << std::endl
220 << " - Summer Smith, Rick & Morty" << std::endl;
221 }
222 break;
223 case 18:
224 if(firstCall)
225 {
226 std::cout << "It's the job that's never started as takes longest to finish." << std::endl
227 << " - Sam Gamgee, LotR " << std::endl;
228 }
229 else
230 {
231 std::cout << "He that breaks a thing to find out what it is, has left the path of wisdom." << std::endl
232 << " - Gandalf, LotR " << std::endl;
233 }
234 break;
235 case 19:
236 if(firstCall)
237 {
238 std::cout << "The Ring has awoken, it's heard its master's call." << std::endl
239 << " - Gandalf, LotR " << std::endl;
240 }
241 else
242 {
243 std::cout << "It's a dangerous business, Frodo, going out your door. " << std::endl
244 << "You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to." << std::endl
245 << " - Bilbo Baggins, LotR " << std::endl; // This line is technically said by Frodo in the books, but he is quoting Bilbo, so the quote should be attributed to Bilbo.
246 }
247 break;
248 case 20:
249 if(firstCall)
250 {
251 std::cout << "Who knows? Have patience. Go where you must go, and hope!" << std::endl
252 << " - Gandalf, LotR " << std::endl;
253 }
254 else
255 {
256 std::cout << "Don't adventures ever have an end? I suppose not. Someone else always has to carry on the story." << std::endl
257 << " - Bilbo Baggins, LotR " << std::endl;
258 }
259 break;
260 case 21:
261 if(firstCall)
262 {
263 std::cout << "As long as I'm better than everyone else I suppose it doesn't matter." << std::endl
264 << " - Jamie Lannister, GoT" << std::endl;
265 }
266 else
267 {
268 std::cout << "My watch has ended." << std::endl
269 << " - Jon Snow, GoT" << std::endl;
270 }
271 break;
272 case 22:
273 if(firstCall)
274 {
275 std::cout << "You'll find I'm full of surprises." << std::endl
276 << " - Luke Skywalker, Star Wars: The Empire Strikes Back " << std::endl;
277 }
278 else
279 {
280 std::cout << "I find your lack of faith disturbing." << std::endl
281 << " - Darth Vader, Star Wars: A New Hope " << std::endl;
282 }
283 break;
284 case 23:
285 if(firstCall)
286 {
287 std::cout << "Here goes nothing." << std::endl
288 << " - Lando Calrissian, Star Wars: Return of the Jedi" << std::endl;
289 }
290 else
291 {
292 std::cout << "Chewie, we're home." << std::endl
293 << " - Han Solo, Star Wars: The Force Awakens" << std::endl;
294 }
295 break;
296 case 24:
297 if(firstCall)
298 {
299 std::cout << "The Force is strong with this one." << std::endl
300 << " - Darth Vader, Star Wars: A New Hope " << std::endl;
301 }
302 else
303 {
304 std::cout << "In my experience, there's no such thing as luck." << std::endl
305 << " - Obi-Wan Kenobi, Star Wars: A New Hope " << std::endl;
306 }
307 break;
308 case 25:
309 if(firstCall)
310 {
311 std::cout << "The city's central computer told you? R2D2, you know better than to trust a strange computer!" << std::endl
312 << " - C3PO, Star Wars: The Empire Strikes Back " << std::endl;
313 }
314 else
315 {
316 std::cout << "He's quite clever, you know...for a human being." << std::endl
317 << " - C3PO, Star Wars: The Empire Strikes Back " << std::endl;
318 }
319 break;
320 case 26:
321 if(firstCall)
322 {
323 std::cout << "I know some things. I can, you know, do math and stuff." << std::endl
324 << " - Harry Potter " << std::endl;
325 }
326 else
327 {
328 std::cout << "Harry then did something that was both very brave and very stupid." << std::endl
329 << " - Harry Potter and the Sorcerer's Stone " << std::endl;
330 }
331 break;
332 case 27:
333 if(firstCall)
334 {
335 std::cout << "I'll be in my bedroom, making no noise and pretending I'm not there." << std::endl
336 << " - Harry Potter " << std::endl;
337 }
338 else
339 {
340 std::cout << "Honestly, if you were any slower, you'd be going backward." << std::endl
341 << " - Draco Malfoy " << std::endl;
342 }
343 break;
344 case 28:
345 std::cout << "I can do this all day." << std::endl
346 << " - Captain America " << std::endl;
347 break;
348 case 29:
349 if(firstCall)
350 {
351 std::cout << "Your scientists were so preoccupied with whether or not they could, they didn't stop to think if they should." << std::endl
352 << " - Ian Malcolm, Jurassic Park " << std::endl;
353 }
354 else
355 {
356 std::cout << "Boy, do I hate being right all the time." << std::endl
357 << " - Ian Malcolm, Jurassic Park " << std::endl;
358 }
359 break;
360 case 30:
361 if(firstCall)
362 {
363 std::cout << "It's a UNIX System! I know this! "
364 << " - Lex Murphy, Jurassic Park " << std::endl;
365 }
366 else
367 {
368 std::cout << "When you gotta go, you gotta go." << std::endl
369 << " - Ian Malcolm, Jurassic Park " << std::endl;
370 }
371 break;
372 case 31:
373 if(firstCall)
374 {
375 std::cout << "Whatever happens, that's the plan. "
376 << " - Kayla Watts, Jurassic World Dominion " << std::endl;
377 }
378 else
379 {
380 std::cout << "Can we start over?" << std::endl
381 << " - Claire Dearing, Jurassic World Dominion " << std::endl;
382 }
383 break;
384 case 32:
385 if(firstCall)
386 {
387 std::cout << "The code is more what you'd call 'guidelines' than actual rules. "
388 << " - Hector Barbossa, Pirates of the Caribbean " << std::endl;
389 }
390 else
391 {
392 std::cout << "Did everyone see that? Because I will not be doing it again." << std::endl
393 << " - Jack Sparrow, Pirates of the Caribbean " << std::endl;
394 }
395 break;
396 case 33:
397 if(firstCall)
398 {
399 std::cout << "If you were waiting for the opportune moment, that was it. "
400 << " - Jack Sparrow, Pirates of the Caribbean " << std::endl;
401 }
402 else
403 {
404 std::cout << "I love those moments. I like to wave at them as they pass by." << std::endl
405 << " - Jack Sparrow, Pirates of the Caribbean " << std::endl;
406 }
407 break;
408 case 34:
409 std::cout << "And that was without even a single drop of rum." << std::endl
410 << " - Jack Sparrow, Pirates of the Caribbean " << std::endl;
411 break;
412
413 // Note: If you add a case, you have to increase the number of messages (nMessages_ variable).
414
415 default: // silence to delight Bernd
416 return;
417 }
418 std::cout << std::endl;
419 }
420};
421
422} // end namespace Dumux
423
424#endif
DuMux start and end message.
Definition dumuxmessage.hh:28
static void print(bool firstCall=false)
Selects random messages to write out at the start and end of a simulation run.
Definition dumuxmessage.hh:38
Formatting based on the fmt-library which implements std::format of C++20.
Definition adapt.hh:17