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