Gyselalib++
 
Loading...
Searching...
No Matches
collisioninfo_radial.hpp
1// SPDX-License-Identifier: MIT
2
3#pragma once
4#include <paraconf.h>
5
6#include "ddc_alias_inline_functions.hpp"
7#include "ddc_aliases.hpp"
8#include "paraconfpp.hpp"
9#include "species_info.hpp"
10
12template <class GridR>
14{
15private:
16 using IdxR = Idx<GridR>;
17 using IdxRangeR = IdxRange<GridR>;
18
19public:
21 using DFieldMemR = DFieldMem<IdxRangeR>;
23 using DFieldR = DField<IdxRangeR>;
25 using DConstFieldR = DConstField<IdxRangeR>;
28
29private:
31 double m_nustar0_rpeak;
32
34 // read in the YAML input file
35 std::int8_t m_collisions_interspecies;
36
37 // [TODO] Values that are temporarily need for the interface with koliop
38 // but that will be deleted as soon as no more required
39 double const m_rpeak;
40 double const m_q_rpeak;
41 double const m_R0;
42
43 DConstFieldR m_rg; //VG ?
44 DConstFieldR m_safety_factor; //VG?
45
47 DFieldMemR m_coeff_AD;
48
49public:
60 void compute_coeff_AD(IdxRangeR idxrange_r)
61 {
62 double const rpeak = m_rpeak;
63 double const q_rpeak = m_q_rpeak;
64 double const R0 = m_R0;
65 double const nustar0_rpeak = m_nustar0_rpeak;
66
67 // Compute coeff_AD_rpeak
68 DFieldR coeff_AD = get_field(m_coeff_AD);
69 double const eps_rpeak = rpeak / R0;
70 double const coeff_AD_rpeak
71 = std::sqrt(2.) * eps_rpeak * std::sqrt(eps_rpeak) * nustar0_rpeak / (q_rpeak * R0);
72
73 // [TODO] coeff_AD should be a scalar and not a radial profile
74 // but to change that koliop interface must be changed
75 // so coeff_AD(r) is fixed equal to coeff_AD_rpeak
76 ddc::parallel_for_each(
77 Kokkos::DefaultExecutionSpace(),
78 idxrange_r,
79 KOKKOS_LAMBDA(Idx<GridR> idx_r) { coeff_AD(idx_r) = coeff_AD_rpeak; });
80 }
81
82public:
93 double const rpeak,
94 double const q_rpeak,
95 double const R0,
96 double const nustar0_rpeak,
97 std::int8_t const collisions_interspecies,
98 IdxRangeR idxrange_r)
99 : m_rpeak(rpeak)
100 , m_q_rpeak(q_rpeak)
101 , m_R0(R0)
102 , m_nustar0_rpeak(nustar0_rpeak)
103 , m_collisions_interspecies(collisions_interspecies)
104 , m_coeff_AD(idxrange_r)
105 {
106 compute_coeff_AD(idxrange_r);
107 };
108
109 ~CollisionInfoRadial() = default;
110
111
116 std::int8_t collisions_interspecies() const
117 {
118 return m_collisions_interspecies;
119 }
120
121
127 {
128 return get_const_field(m_coeff_AD);
129 }
130};
Class to collect information to initialize the collision operator.
Definition collisioninfo_radial.hpp:14
DConstField< IdxRangeR > DConstFieldR
Type alias for a field defined on a grid of radial values.
Definition collisioninfo_radial.hpp:25
DField< IdxRangeR > DFieldR
Type alias for a field defined on a grid of radial values.
Definition collisioninfo_radial.hpp:23
DConstFieldR coeff_AD() const
A method for accessing coeff_AD (the radial profile of AD coeff) variable of the class.
Definition collisioninfo_radial.hpp:126
void compute_coeff_AD(IdxRangeR idxrange_r)
Computation of the radial profile of AD.
Definition collisioninfo_radial.hpp:60
DFieldMem< IdxRangeR > DFieldMemR
Type alias for a field memory block on a grid of radial values.
Definition collisioninfo_radial.hpp:21
DConstFieldR radial_chunk_type
radial_chunk_type used to treat the 0D case for radial profile
Definition collisioninfo_radial.hpp:27
std::int8_t collisions_interspecies() const
A method for accessing the collisions_interspecies member variable of the class.
Definition collisioninfo_radial.hpp:116
CollisionInfoRadial(double const rpeak, double const q_rpeak, double const R0, double const nustar0_rpeak, std::int8_t const collisions_interspecies, IdxRangeR idxrange_r)
The constructor for the CollisionInfoRadial class.
Definition collisioninfo_radial.hpp:92