Logbook
(07-04-2025)
Static problems
main.cpp
1
/******************************************************************************
2
* Copyright (C) Siarhei Uzunbajakau, 2023.
3
*
4
* This program is free software. You can use, modify, and redistribute it under
5
* the terms of the GNU Lesser General Public License as published by the Free
6
* Software Foundation, either version 3 or (at your option) any later version.
7
* This program is distributed without any warranty.
8
*
9
* Refer to COPYING.LESSER for more details.
10
******************************************************************************/
11
12
#define BOOST_ALLOW_DEPRECATED_HEADERS
13
14
#include "deal.II/base/multithread_info.h"
15
16
#include <iostream>
17
#include <string>
18
19
#include "misc.hpp"
20
#include "project_PHI_to_D.hpp"
21
#include "project_PHI_to_E.hpp"
22
#include "solver.hpp"
23
24
using namespace
Misc;
25
32
class
BatchFLCAXI
:
public
SettingsFLCAXI
33
{
34
public
:
35
void
run()
36
{
37
if
(nr_threads_max > 0)
38
MultithreadInfo::set_thread_limit(nr_threads_max);
39
40
std::string dir =
41
(CYLINDER__ == 1) ?
"Data/cylinder-axi/"
:
"Data/sphere-axi/"
;
42
43
unsigned
int
mapping_degree = (CYLINDER__ == 1) ? 1 : 2;
44
45
std::cout <<
"Program: flc-axi\n"
46
<<
"Dimensions: "
<< 2 <<
"\n"
47
<<
"Condition: Cylinder = "
<< CYLINDER__ <<
"\n"
48
<<
"Mapping degree = "
<< mapping_degree <<
"\n"
49
<<
"Writing to: "
<< dir <<
"\n"
;
50
51
MainOutputTable
table_PHI(2);
52
53
for
(
unsigned
int
p = 1; p < 4; p++) {
54
55
table_PHI.clear();
56
for
(
unsigned
int
r = 3; r < 7; r++) {
57
table_PHI.add_value(
"r"
, r);
58
table_PHI.add_value(
"p"
, p);
59
60
SolverFLCAXI<static_cast<bool>
(CYLINDER__)> problem(
61
p,
62
mapping_degree,
63
r,
64
dir +
"solution_PHI_p"
+ std::to_string(p) +
"_r"
+
65
std::to_string(r));
66
table_PHI.add_value(
"ndofs"
, problem.get_n_dofs());
67
table_PHI.add_value(
"ncells"
, problem.get_n_cells());
68
table_PHI.add_value(
"L2"
, problem.get_L2_norm());
69
table_PHI.add_value(
"H1"
, problem.get_H1_norm());
70
}
71
std::cout <<
"Table PHI\n"
;
72
table_PHI.
save
(dir +
"table_PHI_p"
+ std::to_string(p));
73
}
74
}
75
};
76
77
int
78
main()
79
{
80
try
{
81
BatchFLCAXI
batch;
82
batch.run();
83
}
catch
(std::exception& exc) {
84
std::cerr << std::endl
85
<< std::endl
86
<<
"----------------------------------------------------"
87
<< std::endl;
88
std::cerr <<
"Exception on processing: "
<< std::endl
89
<< exc.what() << std::endl
90
<<
"Aborting!"
<< std::endl
91
<<
"----------------------------------------------------"
92
<< std::endl;
93
return
1;
94
}
catch
(...) {
95
std::cerr << std::endl
96
<< std::endl
97
<<
"----------------------------------------------------"
98
<< std::endl;
99
std::cerr <<
"Unknown exception!"
<< std::endl
100
<<
"Aborting!"
<< std::endl
101
<<
"----------------------------------------------------"
102
<< std::endl;
103
return
1;
104
}
105
106
return
0;
107
}
BatchFLCAXI
This is a wrap-around class. It contains the main loop of the program that implements the Axisymmetri...
Definition:
main.cpp:33
Misc::MainOutputTable
The convergence table used in multiple numerical experiments.
Definition:
misc.hpp:25
Misc::MainOutputTable::save
void save(std::string fname)
Saves the data in text and tex formats, and prints the data on screen.
Definition:
misc.cpp:47
SettingsFLCAXI
Global settings for the Axisymmetric - floating conductor (flc-axi/) numerical experiment.
Definition:
settings.hpp:26
SolverFLCAXI
Implements the solver of the Axisymmetric - floating conductor (flc-axi/) numerical experiment.
Definition:
solver.hpp:41
static
flc-axi
src
main.cpp
Generated by
1.9.1