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

Implements the coefficient ( \(\epsilon\), \(\mu\), etc.) in the div-grad partial differential equation (i) of the scalar boundary value problem. More...

#include <static_scalar_input.hpp>

Inheritance diagram for StaticScalarSolver::TheCoefficient< dim, stage >:
Collaboration diagram for StaticScalarSolver::TheCoefficient< 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 values of the coefficient 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
 
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::TheCoefficient< dim, stage >

Implements the coefficient ( \(\epsilon\), \(\mu\), etc.) in the div-grad partial differential equation (i) of the scalar boundary value problem.

This class implements the coefficient of the scalar boundary value problem that reflects the property of the materials. In the case of a problem formulated in terms of the electrostatic potential, \(\Phi\), this coefficient equals permittivity, \(\epsilon\). In the case of a problem formulated in terms of the total magnetic potential, \(\Psi\), or reduced magnetic potential, \(\Theta\), this coefficient equals permeability, \(\mu\). In the case of a planar two-dimensional problem formulated in terms of the vector potential, \(A\), this coefficient equals \(1 / \mu\). In the case of an axisymmetric two-dimensional problem formulated in terms of the scaled vector potential, \(A'\), this coefficient equals \(1 / \mu'\). If the current vector potential, \(T\), is being calculated, this coefficient equals 1 at all points of the problem domain. Simply put, this is the coefficient in between the divergence and the gradient on the left-hand side of the div-grad partial differential equation.

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 values of the coefficient at quadrature points.

member function of this class template.

Definition at line 63 of file static_scalar_input.hpp.

Member Function Documentation

◆ value_list()

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

This function is called by objects derived from the StaticScalarSolver::Solver template during the assembly of the system matrix. It is called ones per each cell. This function must fill the vector values with the values of the coefficient. The values[i] is interpreted as the value of the coefficient at quadrature point r[i]. The code snippet below provides an example in which the permittivity equals the permittivity of the free space at each quadrature point.

#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()));
for (unsigned int i = 0; i < values.size(); i++)
values[i] = ep_0;
}
#pragma GCC diagnostic pop
const double ep_0
The permittivity of free space.
Definition: settings.hpp:38
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: