Logbook  (07-04-2025)
Static problems
static_scalar_input.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 #include <deal.II/base/types.h>
13 #define BOOST_ALLOW_DEPRECATED_HEADERS
14 
15 #include "static_scalar_input.hpp"
16 #include <math.h>
17 
18 using namespace StaticScalarSolver;
19 using namespace std;
20 
21 #pragma GCC diagnostic push
22 #pragma GCC diagnostic ignored "-Wunused-parameter"
23 
24 template<>
25 void
26 TheCoefficient<2>::value_list(const std::vector<Point<2>>& r,
27  types::material_id mid,
28  unsigned int cuid,
29  std::vector<double>& values) const
30 {
31  Assert(r.size() == values.size(),
32  ExcDimensionMismatch(r.size(), values.size()));
33 
34  for (unsigned int i = 0; i < values.size(); i++)
35  values[i] = ep_0;
36 }
37 
38 template<>
39 void
40 TheCoefficient<3>::value_list(const std::vector<Point<3>>& r,
41  types::material_id mid,
42  unsigned int cuid,
43  std::vector<double>& values) const
44 {
45  Assert(r.size() == values.size(),
46  ExcDimensionMismatch(r.size(), values.size()));
47 
48  for (unsigned int i = 0; i < values.size(); i++)
49  values[i] = ep_0;
50 }
51 
52 template<>
53 void
54 PdeRhs<2>::value_list(const std::vector<Point<2>>& r,
55  types::material_id mid,
56  unsigned int cuid,
57  std::vector<double>& values) const
58 {
59  Assert(r.size() == values.size(),
60  ExcDimensionMismatch(r.size(), values.size()));
61 
62  for (unsigned int i = 0; i < values.size(); i++)
63  values[i] = 0.0;
64 }
65 
66 template<>
67 void
68 PdeRhs<3>::value_list(const std::vector<Point<3>>& r,
69  types::material_id mid,
70  unsigned int cuid,
71  std::vector<double>& values) const
72 {
73  Assert(r.size() == values.size(),
74  ExcDimensionMismatch(r.size(), values.size()));
75 
76  for (unsigned int i = 0; i < values.size(); i++)
77  values[i] = 0.0;
78 }
79 
80 template<>
81 void
82 PdeRhsCvp<2>::value_list(const std::vector<Point<2>>& r,
83  types::material_id mid,
84  unsigned int cuid,
85  std::vector<Tensor<1, 2>>& values) const
86 {
87  Assert(r.size() == values.size(),
88  ExcDimensionMismatch(r.size(), values.size()));
89 
90  for (unsigned int i = 0; i < values.size(); i++) {
91  values[i][0] = 0.0;
92  values[i][1] = 0.0;
93  }
94 }
95 
96 template<>
97 void
98 PdeRhsCvp<3>::value_list(const std::vector<Point<3>>& r,
99  types::material_id mid,
100  unsigned int cuid,
101  std::vector<Tensor<1, 3>>& values) const
102 {
103  Assert(r.size() == values.size(),
104  ExcDimensionMismatch(r.size(), values.size()));
105 
106  for (unsigned int i = 0; i < values.size(); i++) {
107  values[i][0] = 0.0;
108  values[i][1] = 0.0;
109  values[i][2] = 0.0;
110  }
111 }
112 
113 template<>
114 void
115 Gamma<2>::value_list(const std::vector<Point<2>>& r,
116  const std::vector<Tensor<1, 2>>& n,
117  types::boundary_id bid,
118  types::material_id mid,
119  unsigned int cuid,
120  unsigned int fuid,
121  std::vector<double>& values) const
122 {
123  Assert(r.size() == values.size(),
124  ExcDimensionMismatch(r.size(), values.size()));
125 
126  for (unsigned int i = 0; i < values.size(); i++)
127  values[i] = 0.0;
128 }
129 
130 template<>
131 void
132 Gamma<3>::value_list(const std::vector<Point<3>>& r,
133  const std::vector<Tensor<1, 3>>& n,
134  types::boundary_id bid,
135  types::material_id mid,
136  unsigned int cuid,
137  unsigned int fuid,
138  std::vector<double>& values) const
139 {
140  Assert(r.size() == values.size(),
141  ExcDimensionMismatch(r.size(), values.size()));
142 
143  for (unsigned int i = 0; i < values.size(); i++)
144  values[i] = 0.0;
145 }
146 
147 template<>
148 void
149 RobinRhs<2>::value_list(const std::vector<Point<2>>& r,
150  const std::vector<Tensor<1, 2>>& n,
151  types::boundary_id bid,
152  types::material_id mid,
153  unsigned int cuid,
154  unsigned int fuid,
155  std::vector<double>& values) const
156 {
157 
158  Assert(r.size() == values.size(),
159  ExcDimensionMismatch(r.size(), values.size()));
160 
161  for (unsigned int i = 0; i < values.size(); i++)
162  values[i] = 0.0;
163 }
164 
165 template<>
166 void
167 RobinRhs<3>::value_list(const std::vector<Point<3>>& r,
168  const std::vector<Tensor<1, 3>>& n,
169  types::boundary_id bid,
170  types::material_id mid,
171  unsigned int cuid,
172  unsigned int fuid,
173  std::vector<double>& values) const
174 {
175 
176  Assert(r.size() == values.size(),
177  ExcDimensionMismatch(r.size(), values.size()));
178 
179  for (unsigned int i = 0; i < values.size(); i++)
180  values[i] = 0.0;
181 }
182 
183 template<>
184 void
185 FreeSurfaceCharge<2>::value_list(const std::vector<Point<2>>& r,
186  const std::vector<Tensor<1, 2>>& n,
187  types::material_id mid,
188  unsigned int cuid,
189  unsigned int fuid,
190  std::vector<double>& values) const
191 {
192  Assert(r.size() == values.size(),
193  ExcDimensionMismatch(r.size(), values.size()));
194 
195  for (unsigned int i = 0; i < values.size(); i++)
196  values[i] = 0.0;
197 }
198 
199 template<>
200 void
201 FreeSurfaceCharge<3>::value_list(const std::vector<Point<3>>& r,
202  const std::vector<Tensor<1, 3>>& n,
203  types::material_id mid,
204  unsigned int cuid,
205  unsigned int fuid,
206  std::vector<double>& values) const
207 {
208  Assert(r.size() == values.size(),
209  ExcDimensionMismatch(r.size(), values.size()));
210 
211  for (unsigned int i = 0; i < values.size(); i++)
212  values[i] = 0.0;
213 }
214 
215 template<>
216 double
217 Weight<2>::value(const Point<2>& r, const unsigned int component) const
218 {
219  return 1.0;
220 }
221 
222 template<>
223 double
224 Weight<3>::value(const Point<3>& r, const unsigned int component) const
225 {
226  return 1.0;
227 }
228 
229 #pragma GCC diagnostic pop
void value_list(const std::vector< Point< dim >> &r, const std::vector< Tensor< 1, dim >> &n, types::material_id mid, unsigned int cuid, unsigned int fuid, std::vector< double > &values) const
Computes the right-hand side of the second continuity condition ( , , , or ).
void value_list(const std::vector< Point< dim >> &r, const std::vector< Tensor< 1, dim >> &n, types::boundary_id bid, types::material_id mid, unsigned int cuid, unsigned int fuid, std::vector< double > &values) const
Computes the coefficient at quadrature points.
void value_list(const std::vector< Point< dim >> &r, types::material_id mid, unsigned int cuid, std::vector< Tensor< 1, dim >> &values) const
Computes the two-dimensional free-current density on the right-hand side of the partial differential...
void value_list(const std::vector< Point< dim >> &r, types::material_id mid, unsigned int cuid, std::vector< double > &values) const
Computes the right-hand side of the div-grad partial differential equation at quadrature points.
void value_list(const std::vector< Point< dim >> &r, const std::vector< Tensor< 1, dim >> &n, types::boundary_id bid, types::material_id mid, unsigned int cuid, unsigned int fuid, std::vector< double > &values) const
Computes the right-hand side of the Robin boundary condition ( or ).
void value_list(const std::vector< Point< dim >> &r, types::material_id mid, unsigned int cuid, std::vector< double > &values) const
Computes the values of the coefficient at quadrature points.
virtual double value(const Point< dim > &r, const unsigned int component=0) const override final
Returns the value of weight at point r. All error norms, , , and , at point r will be multiplied by t...