ryujin 2.1.1 revision ee5cbcbf2346c1299c942d0e1f13b46449973c18
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 <compile_time_options.h>
9
11
12namespace ryujin
13{
14 namespace ElectrostaticConfigurationLibrary
15 {
21 template <int dim, typename Number = double>
22 class Constant : public ElectrostaticConfiguration<dim, Number>
23 {
24 public:
26
27 Constant(const std::string &subsection)
28 : ElectrostaticConfiguration<dim, Number>("constant", subsection)
29 {
30 background_density_ = 0.;
31 this->add_parameter("background density",
32 background_density_,
33 "a constant background (charge) density value");
34
35 magnetic_field_ = curl_type{};
36 this->add_parameter("magnetic field",
37 magnetic_field_,
38 "a constant background magnetic field density");
39 }
40
41 double background_density(const dealii::Point<dim> & /*point*/,
42 Number /*t*/) const final
43 {
44 return background_density_;
45 }
46
47 curl_type magnetic_field(const dealii::Point<dim> & /*point*/,
48 Number /*t*/) const final
49 {
50 return magnetic_field_;
51 }
52
53 private:
54 double background_density_;
55 curl_type magnetic_field_;
56 };
57 } // namespace ElectrostaticConfigurationLibrary
58} // namespace ryujin
ElectrostaticConfiguration< dim, Number >::curl_type curl_type
double background_density(const dealii::Point< dim > &, Number) const final
curl_type magnetic_field(const dealii::Point< dim > &, Number) const final