|
Graph Framework
|
Utilities needed for a particle in cell code. More...
#include <numbers>#include <bit>#include "piecewise.hpp"#include "workflow.hpp"#include "random.hpp"#include "logical.hpp"Go to the source code of this file.
Classes | |
| class | graph::apply_u_node< T > |
| U Collision node. More... | |
| class | graph::apply_xi_node< T > |
| Xi Collision node. More... | |
| class | pic::characteristics< T > |
| Characteristic factors. More... | |
| class | pic::parameters< T > |
| Parameter Class. More... | |
| class | pic::ion< T > |
| ion class. More... | |
| class | pic::mesh< T > |
| Mesh class. More... | |
Namespaces | |
| namespace | graph |
| Name space for graph nodes. | |
Typedefs | |
| template<std::floating_point T> | |
| using | graph::shared_apply_u = std::shared_ptr< apply_u_node< T > > |
| Convenience type alias for shared sqrt nodes. | |
| template<std::floating_point T> | |
| using | graph::shared_apply_xi = std::shared_ptr< apply_xi_node< T > > |
| Convenience type alias for shared sqrt nodes. | |
Enumerations | |
| enum | pic::model { pic::hinton , pic::chen } |
| Model for coulomb scattering operators. More... | |
Functions | |
| template<std::floating_point T> | |
| shared_leaf< T > | graph::apply_u (shared_leaf< T > x, shared_leaf< T > i, shared_leaf< T > rand, shared_leaf< T > mof, shared_leaf< T > tbnu_e_dt, shared_leaf< T > A, shared_leaf< T > B) |
| Build apply_u node. | |
| template<std::floating_point T> | |
| shared_apply_u< T > | graph::apply_u_cast (shared_leaf< T > x) |
| Cast to a apply_u node. | |
| template<std::floating_point T> | |
| shared_leaf< T > | graph::apply_xi (shared_leaf< T > x, shared_leaf< T > i, shared_leaf< T > rand, shared_leaf< T > nu_D_dt) |
| Build apply_xi node. | |
| template<std::floating_point T> | |
| shared_apply_xi< T > | graph::apply_xi_cast (shared_leaf< T > x) |
| Cast to a apply_u node. | |
| template<std::floating_point T> | |
| std::array< graph::shared_leaf< T >, 3 > | pic::cartesian_to_sphereical (graph::shared_leaf< T > x, graph::shared_leaf< T > y) |
| Convert from cartesian to sphereical coordinates. | |
| template<std::floating_point T> | |
| std::array< graph::shared_leaf< T >, 2 > | pic::sphereical_to_cartesian (graph::shared_leaf< T > w, graph::shared_leaf< T > xi, graph::shared_leaf< T > sinphi) |
| Convert from sphereical to cartesian coordinates. | |
| template<std::floating_point T, model M> | |
| graph::shared_leaf< T > | pic::build_colision_rate (graph::shared_leaf< T > xab, const T mass_a, const T mass_b, graph::shared_leaf< T > gb, graph::shared_leaf< T > nuab0, graph::shared_leaf< T > erfp_xab) |
| Calculate ν_{E}. | |
| template<std::floating_point T, model M> | |
| std::array< graph::shared_leaf< T >, 2 > | pic::build_ion_ion_collision (const ion< T > &ion_a, const ion< T > &ion_b, const mesh< T > &mesh, const characteristics< T > &norms, const parameters< T > ¶ms, graph::shared_leaf< T > total_density, graph::shared_leaf< T > total_flux, const graph::shared_random_state< T > state) |
| Build ion ion collision. | |
| template<std::floating_point T, model M> | |
| std::array< graph::shared_leaf< T >, 2 > | pic::build_ion_electron_collision (const ion< T > &ion_a, const mesh< T > &mesh, const characteristics< T > &norms, const parameters< T > ¶ms, graph::shared_leaf< T > total_density, graph::shared_leaf< T > total_flux, const graph::shared_random_state< T > state) |
| Build ion electron collision. | |
| template<std::floating_point T, model M> | |
| std::array< graph::shared_leaf< T >, 2 > | pic::build_common_collision (const ion< T > &ion_a, const characteristics< T > &norms, graph::shared_leaf< T > uxb, graph::shared_leaf< T > tb, graph::shared_leaf< T > nb, const T mass_b, const uint8_t zb2, const T dt, const graph::shared_random_state< T > state) |
| Build common collisions graphs for all species. | |
| template<std::floating_point T> | |
| std::array< graph::shared_leaf< T >, 3 > | pic::build_initialization (const pic::ion< T > &ion, const mesh< T > &mesh, const characteristics< T > &norms, const parameters< T > ¶ms, const graph::shared_random_state< T > state) |
| Build initialization. | |
| template<std::floating_point T> | |
| std::array< graph::shared_leaf< T >, 3 > | pic::build_reinjection (const ion< T > &ion, const mesh< T > &mesh, const characteristics< T > &norms, const parameters< T > ¶ms, const graph::shared_random_state< T > state) |
| Build reinjected expressions. | |
| template<std::floating_point T> | |
| graph::shared_leaf< T > | pic::build_magnetic_field (graph::shared_leaf< T > x, const characteristics< T > &norms, const parameters< T > ¶ms) |
| Build a magnetic field. | |
| template<std::floating_point T, size_t I = 0, mesh< T >::offset O = mesh<T>::center> | |
| graph::shared_leaf< T > | pic::build_density (graph::shared_leaf< T > x, const ion< T > &ion, const mesh< T > &mesh, const characteristics< T > &norms, const parameters< T > ¶ms) |
| Build expressions for the density. | |
| template<std::floating_point T, size_t I = 0, mesh< T >::offset O = mesh<T>::center> | |
| graph::shared_leaf< T > | pic::build_density_gradient (graph::shared_leaf< T > x, const ion< T > &ion, const mesh< T > &mesh, const characteristics< T > &norms, const parameters< T > ¶ms) |
| Build expressions for the density gradient. | |
| template<std::floating_point T> | |
| graph::shared_leaf< T > | pic::build_electron_temperature (graph::shared_leaf< T > x, const characteristics< T > &norms) |
| Build Expressions for Electron temperature. | |
| template<std::floating_point T, mesh< T >::offset O = mesh<T>::center> | |
| graph::shared_leaf< T > | pic::build_electric_efield (graph::shared_leaf< T > x, const ion< T > &ion, const mesh< T > &mesh, const characteristics< T > &norms, const parameters< T > ¶ms) |
| Build expressions for the electric field. | |
| template<std::floating_point T> | |
| graph::shared_leaf< T > | pic::build_interpolate_efield (graph::shared_leaf< T > x, const ion< T > &ion, const mesh< T > &mesh, const characteristics< T > &norms, const parameters< T > ¶ms) |
| Build interpolation expression. | |
| template<std::floating_point T> | |
| std::array< graph::shared_leaf< T >, 3 > | pic::build_F_expressions (const std::array< graph::shared_leaf< T >, 3 > z, const ion< T > &ion, const mesh< T > &mesh, const characteristics< T > &norms, const parameters< T > ¶ms) |
| Build F expressions. | |
| template<std::floating_point T> | |
| std::array< graph::shared_leaf< T >, 3 > | pic::build_rk4_step (const ion< T > &ion, const mesh< T > &mesh, const characteristics< T > &norms, const parameters< T > ¶ms) |
| Build Runga Kutta step update. | |
Utilities needed for a particle in cell code.
Defines graphs for use in Particle In Cell (PIC) codes.
| enum pic::model |
| graph::shared_leaf< T > pic::build_colision_rate | ( | graph::shared_leaf< T > | xab, |
| const T | mass_a, | ||
| const T | mass_b, | ||
| graph::shared_leaf< T > | gb, | ||
| graph::shared_leaf< T > | nuab0, | ||
| graph::shared_leaf< T > | erfp_xab | ||
| ) |
Calculate ν_{E}.
| T | Base type of the calculation. |
| M | The pic::model of the calculation. |
| [in] | xab | |
| [in] | mass_a | Mass of particle a. |
| [in] | mass_b | Mass of particle b. |
| [in] | gb | |
| [in] | nuab0 | |
| [in] | erfp_xab | Derivaive of error function. |
| std::array< graph::shared_leaf< T >, 2 > pic::build_common_collision | ( | const ion< T > & | ion_a, |
| const characteristics< T > & | norms, | ||
| graph::shared_leaf< T > | uxb, | ||
| graph::shared_leaf< T > | tb, | ||
| graph::shared_leaf< T > | nb, | ||
| const T | mass_b, | ||
| const uint8_t | zb2, | ||
| const T | dt, | ||
| const graph::shared_random_state< T > | state | ||
| ) |
Build common collisions graphs for all species.
| T | Base type of the calculation. |
| M | The pic::model of the calculation. |
| [in] | ion_a | Ions for species a. |
| [in] | norms | A pic::characteristics object. |
| [in] | uxb | |
| [in] | tb | Temperature of species b. |
| [in] | nb | Density of species b. |
| [in] | mass_b | Mass of species b. |
| [in] | zb2 | Z effective squared. |
| [in] | dt | Time step. |
| [in] | state | Random state node. |
| graph::shared_leaf< T > pic::build_density | ( | graph::shared_leaf< T > | x, |
| const ion< T > & | ion, | ||
| const mesh< T > & | mesh, | ||
| const characteristics< T > & | norms, | ||
| const parameters< T > & | params | ||
| ) |
Build expressions for the density.
| T | Base type of the calculation. |
| I | Mesh index. |
| O | Mesh offset. |
| [in] | x | The x position. |
| [in] | ion | A pic::ion object. |
| [in] | mesh | A pic::mesh object. |
| [in] | norms | A pic::characteristics object. |
| [in] | params | A pic::parameters object. |
| graph::shared_leaf< T > pic::build_density_gradient | ( | graph::shared_leaf< T > | x, |
| const ion< T > & | ion, | ||
| const mesh< T > & | mesh, | ||
| const characteristics< T > & | norms, | ||
| const parameters< T > & | params | ||
| ) |
Build expressions for the density gradient.
| T | Base type of the calculation. |
| I | Mesh index. |
| O | Mesh offset. |
| [in] | x | The x position. |
| [in] | ion | A pic::ion object. |
| [in] | mesh | A pic::mesh object. |
| [in] | norms | A pic::characteristics object. |
| [in] | params | A pic::parameters object. |
| graph::shared_leaf< T > pic::build_electric_efield | ( | graph::shared_leaf< T > | x, |
| const ion< T > & | ion, | ||
| const mesh< T > & | mesh, | ||
| const characteristics< T > & | norms, | ||
| const parameters< T > & | params | ||
| ) |
Build expressions for the electric field.
| T | Base type of the calculation. |
| O | Mesh offset. |
| [in] | x | The x position. |
| [in] | ion | A pic::ion object. |
| [in] | mesh | A pic::mesh object. |
| [in] | norms | A pic::characteristics object. |
| [in] | params | A pic::parameters object. |
| graph::shared_leaf< T > pic::build_electron_temperature | ( | graph::shared_leaf< T > | x, |
| const characteristics< T > & | norms | ||
| ) |
Build Expressions for Electron temperature.
| T | Base type of the calculation. |
| [in] | x | The x position. |
| [in] | norms | A pic::characteristics object. |
| std::array< graph::shared_leaf< T >, 3 > pic::build_F_expressions | ( | const std::array< graph::shared_leaf< T >, 3 > | z, |
| const ion< T > & | ion, | ||
| const mesh< T > & | mesh, | ||
| const characteristics< T > & | norms, | ||
| const parameters< T > & | params | ||
| ) |
Build F expressions.
| T | Base type of the calculation. |
| [in] | z | Runga Kutta substep. |
| [in] | ion | A pic::ion object. |
| [in] | mesh | A pic::mesh object. |
| [in] | norms | A pic::characteristics object. |
| [in] | params | A pic::parameters object. |
| std::array< graph::shared_leaf< T >, 3 > pic::build_initialization | ( | const pic::ion< T > & | ion, |
| const mesh< T > & | mesh, | ||
| const characteristics< T > & | norms, | ||
| const parameters< T > & | params, | ||
| const graph::shared_random_state< T > | state | ||
| ) |
Build initialization.
| T | Base type of the calculation. |
| [in] | ion | A pic::ion object. |
| [in] | mesh | A pic::mesh object. |
| [in] | norms | A pic::characteristics object. |
| [in] | params | A pic::parameters object. |
| [in] | state | Random state node. |
| graph::shared_leaf< T > pic::build_interpolate_efield | ( | graph::shared_leaf< T > | x, |
| const ion< T > & | ion, | ||
| const mesh< T > & | mesh, | ||
| const characteristics< T > & | norms, | ||
| const parameters< T > & | params | ||
| ) |
Build interpolation expression.
| T | Base type of the calculation. |
| [in] | x | The x position. |
| [in] | ion | A pic::ion object. |
| [in] | mesh | A pic::mesh object. |
| [in] | norms | A pic::characteristics object. |
| [in] | params | A pic::parameters object. |
| std::array< graph::shared_leaf< T >, 2 > pic::build_ion_electron_collision | ( | const ion< T > & | ion_a, |
| const mesh< T > & | mesh, | ||
| const characteristics< T > & | norms, | ||
| const parameters< T > & | params, | ||
| graph::shared_leaf< T > | total_density, | ||
| graph::shared_leaf< T > | total_flux, | ||
| const graph::shared_random_state< T > | state | ||
| ) |
Build ion electron collision.
| T | Base type of the calculation. |
| M | The pic::model of the calculation. |
| [in] | ion_a | Ions for species a. |
| [in] | mesh | A pic::mesh object. |
| [in] | norms | A pic::characteristics object. |
| [in] | params | A pic::parameters object. |
| [in] | total_density | Accumulated density. |
| [in] | total_flux | Accumulated total_flux. |
| [in] | state | Random state node. |
| std::array< graph::shared_leaf< T >, 2 > pic::build_ion_ion_collision | ( | const ion< T > & | ion_a, |
| const ion< T > & | ion_b, | ||
| const mesh< T > & | mesh, | ||
| const characteristics< T > & | norms, | ||
| const parameters< T > & | params, | ||
| graph::shared_leaf< T > | total_density, | ||
| graph::shared_leaf< T > | total_flux, | ||
| const graph::shared_random_state< T > | state | ||
| ) |
Build ion ion collision.
| T | Base type of the calculation. |
| M | The pic::model of the calculation. |
| [in] | ion_a | Ions for species a. |
| [in] | ion_b | Ions for species b. |
| [in] | mesh | A pic::mesh object. |
| [in] | norms | A pic::characteristics object. |
| [in] | params | A pic::parameters object. |
| [in,out] | total_density | Accumulated density. |
| [in,out] | total_flux | Accumulated total_flux. |
| [in] | state | Random state node. |
| graph::shared_leaf< T > pic::build_magnetic_field | ( | graph::shared_leaf< T > | x, |
| const characteristics< T > & | norms, | ||
| const parameters< T > & | params | ||
| ) |
Build a magnetic field.
| T | Base type of the calculation. |
| [in] | x | The x position. |
| [in] | norms | A pic::characteristics object. |
| [in] | params | A pic::parameters object. |
| std::array< graph::shared_leaf< T >, 3 > pic::build_reinjection | ( | const ion< T > & | ion, |
| const mesh< T > & | mesh, | ||
| const characteristics< T > & | norms, | ||
| const parameters< T > & | params, | ||
| const graph::shared_random_state< T > | state | ||
| ) |
Build reinjected expressions.
If the particles leave the mesh, reinitalize them using the same initialization.
| T | Base type of the calculation. |
| [in] | ion | A pic::ion object. |
| [in] | mesh | A pic::mesh object. |
| [in] | norms | A pic::characteristics object. |
| [in] | params | A pic::parameters object. |
| [in] | state | Random state node. |
| std::array< graph::shared_leaf< T >, 3 > pic::build_rk4_step | ( | const ion< T > & | ion, |
| const mesh< T > & | mesh, | ||
| const characteristics< T > & | norms, | ||
| const parameters< T > & | params | ||
| ) |
Build Runga Kutta step update.
| T | Base type of the calculation. |
| [in] | ion | A pic::ion object. |
| [in] | mesh | A pic::mesh object. |
| [in] | norms | A pic::characteristics object. |
| [in] | params | A pic::parameters object. |
| std::array< graph::shared_leaf< T >, 3 > pic::cartesian_to_sphereical | ( | graph::shared_leaf< T > | x, |
| graph::shared_leaf< T > | y | ||
| ) |
Convert from cartesian to sphereical coordinates.
| T | Base type of the calculation. |
| [in] | x | |
| [in] | y |
| std::array< graph::shared_leaf< T >, 2 > pic::sphereical_to_cartesian | ( | graph::shared_leaf< T > | w, |
| graph::shared_leaf< T > | xi, | ||
| graph::shared_leaf< T > | sinphi | ||
| ) |
Convert from sphereical to cartesian coordinates.
| T | Base type of the calculation. |
| [in] | w | |
| [in] | xi | |
| [in] | sinphi |