Logbook  (07-04-2025)
Static problems
StaticScalarSolver::PdeRhs< dim, stage > Class Template Reference

Implements the right-hand side ( \(\rho_f\), \(\rho_t\), \(\rho_r\), or \(J_f\)) in the div-grad partial differential equation (i) of the scalar boundary value problem. More...

#include <static_scalar_input.hpp>

Inheritance diagram for StaticScalarSolver::PdeRhs< dim, stage >:
Collaboration diagram for StaticScalarSolver::PdeRhs< dim, stage >:

Public Member Functions

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. More...
 
void value_list (const std::vector< Point< 2 >> &r, types::material_id mid, unsigned int cuid, std::vector< double > &values) const
 
void value_list (const std::vector< Point< 2 >> &r, types::material_id mid, unsigned int cuid, std::vector< double > &values) const
 

Detailed Description

template<int dim, int stage = 1>
class StaticScalarSolver::PdeRhs< dim, stage >

Implements the right-hand side ( \(\rho_f\), \(\rho_t\), \(\rho_r\), or \(J_f\)) in the div-grad partial differential equation (i) of the scalar boundary value problem.

In the case of a problem formulated in terms of the electrostatic scalar potential, \(\Phi\), the right-hand side is the volume free-charge density, \(\rho_f\). In the case of a problem formulated in terms of the total magnetic scalar potential, \(\Psi\), the right-hand side is the volume magnetic-charge density, \(\rho_t\). (Note, that normally in the literature \(\rho_t / \mu_0\) is designated as volume magnetic-charge density.) In the case of a problem formulated in terms of the reduced magnetic scalar potential, \(\Theta\), the right-hand side is the reduced volume magnetic- charge density, \(\rho_r\). In the cases of a planar two-dimensional problem formulated in terms of the magnitude of the vector potential, \(A\), and an axisymmetric two-dimensional problem formulated in terms of the scaled magnitude of the vector potential, \(A'\), the right-hand side is the magnitude of the free-current density, \(J_f\). In the case of the planar two-dimensional problem formulated in terms of the magnitude of the current vector potential, \(T\), the StaticScalarSolver::PdeRhsCvp is used instead of this class template.

This class template is declared in shared/include/static_scalar_input.hpp but must be implemented in xyz/src/static_scalar_input.cpp, where xyz is the directory of the current numerical experiment. That is, the declaration is shared between all numerical experiments while implementation is specific for each individual numerical experiment. See the structure of the code for more details.

The dim template parameter is, as per usual, the amount of spatial dimensions. The purpose of the stage template parameter is discussed in here.

The user is supposed to implement

void value_list(...)
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.

member function of this class template.

Definition at line 152 of file static_scalar_input.hpp.

Member Function Documentation

◆ value_list()

template<int dim, int stage = 1>
void StaticScalarSolver::PdeRhs< dim, stage >::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.

This function is called by objects derived from the StaticScalarSolver::Solver template during the assembly of the system right-hand side. It is called ones per each cell. This function must fill the vector values with the values of the right-hand side of the partial differential equation. The values[i] is interpreted as the right-hand side of the partial differential equation at quadrature point r[i]. The right- hand side of the partial differential equation may vary from point-to-point, or may have the same value at all points. The following code snippet provides an example.

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
template<>
const std::vector<Point<2>> &r,
types::material_id mid,
unsigned int cuid,
std::vector<double> & values) const
{
Assert(r.size() == values.size(),
ExcDimensionMismatch(r.size(), values.size()));
auto v = values.begin();
for (auto p: r)
{
*v = ep_0 * (
2*p[0]*pow(p[1],2)*sin(k*p[0]) +
2*p[1]*pow(p[0],2)*sin(k*p[1]) +
k*(pow(p[0],2)*pow(p[1],2) + 1) *
(cos(k*p[0]) + cos(k*p[1]))
);
v++;
}
}
#pragma GCC diagnostic pop
const double ep_0
The permittivity of free space.
Definition: settings.hpp:38
const double k
The scaling parameter.
Definition: settings.hpp:43
Parameters
[in]r- A vector that contains the quadrature points of the cell being processed.
[in]mid- The material ID.
[in]cuid- The cell user ID.
[out]values- The output data.

The documentation for this class was generated from the following file: