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