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

Implements the two-dimensional free-current density \(\vec{J}_f\) on the right-hand side of the partial differential equation (i) of the scalar boundary value problem. More...

#include <static_scalar_input.hpp>

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

Public Member Functions

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 \(\vec{J}_f\) on the right-hand side of the 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< Tensor< 1, 2 >> &values) const
 
void value_list (const std::vector< Point< 2 >> &r, types::material_id mid, unsigned int cuid, std::vector< Tensor< 1, 2 >> &values) const
 

Detailed Description

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

Implements the two-dimensional free-current density \(\vec{J}_f\) on the right-hand side of the partial differential equation (i) of the scalar boundary value problem.

If a planar two-dimensional problem is formulated in terms of the magnitude of the current vector potential, \(T\), the div-grad equation (i) in scalar boundary value problem is replaced with

\[ -\vec{\nabla}\cdot \bigg( \vec{\nabla} T \bigg) = \vec{\nabla}\overset{S}{\times} \vec{J}_f. \]

The purpose of this class template is to implement \(\vec{J}_f\) in the last equation. This class template must be ignored if the problem formulated in terms of \(\Phi\), \(\Psi\), \(\Theta\), \(A\), and \(A'\).

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< Tensor< 1, dim >> &values) const
Computes the two-dimensional free-current density on the right-hand side of the partial differential...

member function of this class template.

Note
This class template can only be used in two-dimensional problems, so, strictly peaking, the template parameter dim is redundant. This template parameter, however, makes the code more uniform.

Definition at line 249 of file static_scalar_input.hpp.

Member Function Documentation

◆ value_list()

template<int dim, int stage = 1>
void StaticScalarSolver::PdeRhsCvp< dim, stage >::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 \(\vec{J}_f\) on the right-hand side of the 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 and each face located on the boundary. This function must fill the vector values with the values of \(\vec{J}_f\). 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<Tensor<1, 2>> & values) const
{
Assert(r.size() == values.size(),
ExcDimensionMismatch(r.size(), values.size()));
auto v = values.begin();
for (auto p: r)
{
if (mid == mid_2)
{
(*v)[0] =-p[1];
(*v)[1] = p[0];
}
else
{
(*v)[0] = 0.0;
(*v)[1] = 0.0;
}
v++;
}
}
#pragma GCC diagnostic pop
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: