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_solver.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 PdeRhs<2>::value_list(const std::vector<Point<2>>& 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  if (mid == mid_2) {
50  values[i] = rho;
51  } else {
52  values[i] = 0.0;
53  }
54  }
55 }
56 
57 template<>
58 void
59 PdeRhsCvp<2>::value_list(const std::vector<Point<2>>& r,
60  types::material_id mid,
61  unsigned int cuid,
62  std::vector<Tensor<1, 2>>& values) const
63 {
64  Assert(r.size() == values.size(),
65  ExcDimensionMismatch(r.size(), values.size()));
66 
67  for (unsigned int i = 0; i < values.size(); i++) {
68  values[i][0] = 0.0;
69  values[i][1] = 0.0;
70  }
71 }
72 
73 template<>
74 void
75 Gamma<2>::value_list(const std::vector<Point<2>>& r,
76  const std::vector<Tensor<1, 2>>& n,
77  types::boundary_id bid,
78  types::material_id mid,
79  unsigned int cuid,
80  unsigned int fuid,
81  std::vector<double>& values) const
82 {
83  Assert(r.size() == values.size(),
84  ExcDimensionMismatch(r.size(), values.size()));
85 
86  for (unsigned int i = 0; i < values.size(); i++)
87  values[i] = 0.0;
88 }
89 
90 template<>
91 void
92 RobinRhs<2>::value_list(const std::vector<Point<2>>& r,
93  const std::vector<Tensor<1, 2>>& n,
94  types::boundary_id bid,
95  types::material_id mid,
96  unsigned int cuid,
97  unsigned int fuid,
98  std::vector<double>& values) const
99 {
100 
101  Assert(r.size() == values.size(),
102  ExcDimensionMismatch(r.size(), values.size()));
103 
104  for (unsigned int i = 0; i < values.size(); i++)
105  values[i] = 0.0;
106 }
107 
108 template<>
109 void
110 FreeSurfaceCharge<2>::value_list(const std::vector<Point<2>>& r,
111  const std::vector<Tensor<1, 2>>& n,
112  types::material_id mid,
113  unsigned int cuid,
114  unsigned int fuid,
115  std::vector<double>& values) const
116 {
117  Assert(r.size() == values.size(),
118  ExcDimensionMismatch(r.size(), values.size()));
119 
120  for (unsigned int i = 0; i < values.size(); i++)
121  values[i] = 0.0;
122 }
123 
124 template<>
125 double
126 Weight<2>::value(const Point<2>& r, const unsigned int component) const
127 {
128  return 1.0;
129 }
130 
131 #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...