Logbook  (07-04-2025)
Static problems
constants.hpp
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 #ifndef Constants_H__
13 #define Constants_H__
14 
15 #include <deal.II/base/exceptions.h>
16 
17 #include <iostream>
18 #include <math.h>
19 #include <vector>
20 
21 namespace Constants {
22 
27 class Physics
28 {
29 public:
30  Physics(){};
31 
36  const double pi =
37  3.141592653589793238462643383279502884197169399375105820974944592307816406286;
38 
42  const double c = 299792458.0;
43 
47  const double permeability_fs = 4.0 * pi * 1.0e-7;
48 
52  const double permittivity_fs = 1.0 / (std::pow(c, 2) * permeability_fs);
53 };
54 
59 template<int dim>
61 {
62 public:
63  QuadratureTableScalar(unsigned int p)
64  : indx(p - 1)
65  {
66  Assert(indx < 4, dealii::ExcInternalError());
67  }
68 
70  : indx(qt.indx)
71  {
72  Assert(indx < 4, dealii::ExcInternalError());
73  }
74 
79  unsigned int sim() const;
80 
85  unsigned int enorm() const;
86 
87 private:
88  const unsigned int indx;
89  const std::vector<unsigned int> Table2DSimulation = { 2, 3, 4, 5 };
90  const std::vector<unsigned int> Table3DSimulation = { 2, 3, 4, 5 };
91  const std::vector<unsigned int> Table2DErrorNorm = { 4, 5, 6, 7 };
92  const std::vector<unsigned int> Table3DErrorNorm = { 4, 5, 6, 7 };
93 };
94 
99 template<int dim>
101 {
102 public:
103  QuadratureTableVector(unsigned int p)
104  : indx(p)
105  {
106  Assert(indx < 3, dealii::ExcInternalError());
107  }
108 
110  : indx(qt.indx)
111  {
112  Assert(indx < 3, dealii::ExcInternalError());
113  }
114 
119  unsigned int sim() const;
120 
125  unsigned int enorm() const;
126 
127 private:
128  const unsigned int indx;
129  const std::vector<unsigned int> Table2DSimulation = { 2, 3, 4, 5 };
130  const std::vector<unsigned int> Table3DSimulation = { 2, 3, 4, 5 };
131  const std::vector<unsigned int> Table2DErrorNorm = { 4, 5, 6, 7 };
132  const std::vector<unsigned int> Table3DErrorNorm = { 4, 5, 6, 7 };
133 };
134 
135 } // namespace Constants
136 #endif
Lists physical constants.
Definition: constants.hpp:28
const double pi
The ratio between the circumference and the diameter of any circle, .
Definition: constants.hpp:36
const double permittivity_fs
The permittivity of the free space, .
Definition: constants.hpp:52
const double c
The speed of light in free space, .
Definition: constants.hpp:42
const double permeability_fs
The permeability of the free space, .
Definition: constants.hpp:47
The tables that contain the amount of quadrature points used in the scalar problems.
Definition: constants.hpp:61
unsigned int sim() const
Returns the amount of quadrature points used when assembling system if linear equations.
unsigned int enorm() const
Returns the amount of quadrature points used when calculating the error norms.
The tables that contain the amount of quadrature points used in vector problems.
Definition: constants.hpp:101
unsigned int enorm() const
Returns the amount of quadrature points used when calculating the error norms.
unsigned int sim() const
Returns the amount of quadrature points used when assembling system if linear equations.