ryujin 2.5.0 revision c64172211cf21344cb9b9b0f3a1266aa6400d392
Loading...
Searching...
No Matches
electrostatic_configuration_constant.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2026 by the ryujin authors
4//
5
6#pragma once
7
8#include <ryujin/base/compile_time_options.h>
10
11namespace ryujin
12{
13 namespace ElectrostaticConfigurations
14 {
20 template <int dim, typename Number = double>
21 class Constant : public ElectrostaticConfiguration<dim, Number>
22 {
23 public:
25
26 Constant(const std::string &subsection)
27 : ElectrostaticConfiguration<dim, Number>("constant", subsection)
28 {
29 background_density_ = 0.;
30 this->add_parameter("background density",
31 background_density_,
32 "a constant background (charge) density value");
33
34 magnetic_field_ = curl_type{};
35 this->add_parameter("magnetic field",
36 magnetic_field_,
37 "a constant background magnetic field density");
38 }
39
40 double background_density(const dealii::Point<dim> & /*point*/,
41 Number /*t*/) const final
42 {
43 return background_density_;
44 }
45
46 curl_type magnetic_field(const dealii::Point<dim> & /*point*/,
47 Number /*t*/) const final
48 {
49 return magnetic_field_;
50 }
51
52 private:
53 double background_density_;
54 curl_type magnetic_field_;
55 };
56 } // namespace ElectrostaticConfigurations
57} // namespace ryujin
dealii::Tensor< 1, dim==2 ? 1 :dim, Number > curl_type
curl_type magnetic_field(const dealii::Point< dim > &, Number) const final
double background_density(const dealii::Point< dim > &, Number) const final
ElectrostaticConfiguration< dim, Number >::curl_type curl_type