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

Implements the source vector field on the right-hand side of the partial differential equation (i) of the vector boundary value problem. More...

#include <static_vector_input.hpp>

Inheritance diagram for StaticVectorSolver::PdeRhs< dim, stage >:
Collaboration diagram for StaticVectorSolver::PdeRhs< 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 vector field on the right-hand side of the partial differential equation. More...
 
void value_list (const std::vector< Point< 3 >> &r, types::material_id mid, unsigned int cuid, std::vector< Tensor< 1, 3 >> &values) const
 
void value_list (const std::vector< Point< 3 >> &r, types::material_id mid, unsigned int cuid, std::vector< Tensor< 1, 3 >> &values) const
 
void value_list (const std::vector< Point< 3 >> &r, types::material_id mid, unsigned int cuid, std::vector< Tensor< 1, 3 >> &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
 
void value_list (const std::vector< Point< 3 >> &r, types::material_id mid, unsigned int cuid, std::vector< Tensor< 1, 3 >> &values) const
 
void value_list (const std::vector< Point< 3 >> &r, types::material_id mid, unsigned int cuid, std::vector< Tensor< 1, 3 >> &values) const
 
void value_list (const std::vector< Point< 3 >> &r, types::material_id mid, unsigned int cuid, std::vector< Tensor< 1, 3 >> &values) const
 
void value_list (const std::vector< Point< 3 >> &r, types::material_id mid, unsigned int cuid, std::vector< Tensor< 1, 3 >> &values) const
 

Detailed Description

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

Implements the source vector field on the right-hand side of the partial differential equation (i) of the vector boundary value problem.

How the source vector field modeled by this function is interpreted by the StaticVectorSolver::Solver1 class template depends on the second parameter passed to the constructor of StaticVectorSolver::Solver1, i.e., the parameter type_of_pde_rhs. It can be interpreted as current density, \(\vec{J}_f\), or as the current vector potential, \(\vec{T}\). See the documentation of StaticVectorSolver::Solver1 for more details. The StaticVectorSolver::Solver2 class template does not use StaticVectorSolver::PdeRhs as the right-hand-side of the PDE is fed to the StaticVectorSolver::Solver2 via the input parameters of the constructor dof_handler and solution.

This class is declared in shared/include/static_vector_input.hpp but must be implemented in xyz/src/static_vector_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 vector field on the right-hand side of the partial differential equation.

member function of this class.

Definition at line 139 of file static_vector_input.hpp.

Member Function Documentation

◆ value_list()

template<int dim, int stage = 1>
void StaticVectorSolver::PdeRhs< 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 vector field on the right-hand side of the partial differential equation.

This function is called by the StaticVectorSolver::Solver1 class during the assembly of the right-hand side. It is called ones per each cell. This function must fill values vector with the source vectors sampled at quadrature points. The values[i] is interpreted as the source vector at quadrature point r[i]. The code snippet below provides an example in which the source field equals

\[ \vec{J}_f = (1 / \mu_0)(x^2+y^2) \hat{k}, \]

where \(\mu_0\) is the permeability of free space.

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
template<>
const std::vector<Point<3>> &r,
types::material_id mid,
unsigned int cuid,
std::vector<Tensor<1,3>> & values) const
{
Assert(r.size() == values.size(),
ExcDimensionMismatch(r.size(), values.size()));
auto v = values.begin();
for (auto p: r)
{
(*v)[0] = 0.0;
(*v)[1] = 0.0;
(*v)[2] = (1 / MU0) * ( pow(p[0],2) + pow(p[1],2) );
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: