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