Gyselalib++
 
Loading...
Searching...
No Matches
geometry.hpp
1// SPDX-License-Identifier: MIT
2#pragma once
3#include <ddc/ddc.hpp>
4#include <ddc/kernels/splines.hpp>
5
6#include "ddc_alias_inline_functions.hpp"
7#include "ddc_aliases.hpp"
8#include "ddc_helper.hpp"
9#include "species_info.hpp"
10
11/*
12 * @file geometry.hpp
13 *
14 */
15
19struct Vpar
20{
26 static bool constexpr PERIODIC = false;
27};
31struct Mu
32{
38 static bool constexpr PERIODIC = false;
39};
40
41// Coord = position of a coordinate in the vector space
42using CoordVpar = Coord<Vpar>;
43using CoordMu = Coord<Mu>;
44
45// Splines definition
46int constexpr BSDegreeVpar = 3;
47int constexpr BSDegreeMu = 3;
48
49bool constexpr BsplineOnUniformCellsVpar = true;
50bool constexpr BsplineOnUniformCellsMu = true;
51
53 : std::conditional_t<
54 BsplineOnUniformCellsVpar,
55 ddc::UniformBSplines<Vpar, BSDegreeVpar>,
56 ddc::NonUniformBSplines<Vpar, BSDegreeVpar>>
57{
58};
60 : std::conditional_t<
61 BsplineOnUniformCellsMu,
62 ddc::UniformBSplines<Mu, BSDegreeMu>,
63 ddc::NonUniformBSplines<Mu, BSDegreeMu>>
64{
65};
66ddc::BoundCond constexpr SplineVparBoundary = ddc::BoundCond::HERMITE;
67ddc::BoundCond constexpr SplineMuBoundary = ddc::BoundCond::HERMITE;
68
69using SplineInterpPointsVpar
70 = ddc::GrevilleInterpolationPoints<BSplinesVpar, SplineVparBoundary, SplineVparBoundary>;
71using SplineInterpPointsMu
72 = ddc::GrevilleInterpolationPoints<BSplinesMu, SplineMuBoundary, SplineMuBoundary>;
73
74struct GridVpar : SplineInterpPointsVpar::interpolation_discrete_dimension_type
75{
76};
77struct GridMu : SplineInterpPointsMu::interpolation_discrete_dimension_type
78{
79};
80
81using SplineVparBuilder = ddc::SplineBuilder<
82 Kokkos::DefaultExecutionSpace,
83 Kokkos::DefaultExecutionSpace::memory_space,
86 SplineVparBoundary,
87 SplineVparBoundary,
88 ddc::SplineSolver::LAPACK,
89 GridVpar>;
90using SplineVparEvaluator = ddc::SplineEvaluator<
91 Kokkos::DefaultExecutionSpace,
92 Kokkos::DefaultExecutionSpace::memory_space,
95 ddc::ConstantExtrapolationRule<Vpar>,
96 ddc::ConstantExtrapolationRule<Vpar>,
97 GridVpar>;
98
99using SplineMuBuilder = ddc::SplineBuilder<
100 Kokkos::DefaultExecutionSpace,
101 Kokkos::DefaultExecutionSpace::memory_space,
103 GridMu,
104 SplineMuBoundary,
105 SplineMuBoundary,
106 ddc::SplineSolver::LAPACK,
107 GridMu>;
108using SplineMuEvaluator = ddc::SplineEvaluator<
109 Kokkos::DefaultExecutionSpace,
110 Kokkos::DefaultExecutionSpace::memory_space,
112 GridMu,
113 ddc::ConstantExtrapolationRule<Mu>,
114 ddc::ConstantExtrapolationRule<Mu>,
115 GridMu>;
116
117// Idx = index of the point in the point sampling
118using IdxVpar = Idx<GridVpar>;
119using IdxMu = Idx<GridMu>;
120using IdxVparMu = Idx<GridVpar, GridMu>;
121using IdxSpVparMu = Idx<Species, GridVpar, GridMu>;
122using IdxSpVpar = Idx<Species, GridVpar>;
123
124// IdxStep = number of grid points between points in a sampling
125using IdxStepVpar = IdxStep<GridVpar>;
126using IdxStepMu = IdxStep<GridMu>;
127using IdxStepVparMu = IdxStep<GridVpar, GridMu>;
128using IdxStepSpVparMu = IdxStep<Species, GridVpar, GridMu>;
129
130// IdxRange = to describe the wole index range (or a sub-index range)
131using IdxRangeVpar = IdxRange<GridVpar>;
132using IdxRangeMu = IdxRange<GridMu>;
133using IdxRangeVparMu = IdxRange<GridVpar, GridMu>;
134using IdxRangeSpVparMu = IdxRange<Species, GridVpar, GridMu>;
135using IdxRangeSpVpar = IdxRange<Species, GridVpar>;
136
137// template for the fields
138template <class ElementType>
139using FieldMemVpar = FieldMem<ElementType, IdxRangeVpar>;
140using DFieldMemVpar = FieldMemVpar<double>;
141
142template <class ElementType>
143using FieldMemMu = FieldMem<ElementType, IdxRangeMu>;
144using DFieldMemMu = FieldMemMu<double>;
145
146template <class ElementType>
147using FieldMemVparMu = FieldMem<ElementType, IdxRangeVparMu>;
148using DFieldMemVparMu = FieldMemVparMu<double>;
149
150template <class ElementType>
151using FieldMemSpVparMu = FieldMem<ElementType, IdxRangeSpVparMu>;
152using DFieldMemSpVparMu = FieldMemSpVparMu<double>;
153
154template <class ElementType>
155using FieldMemSpVpar = FieldMem<ElementType, IdxRangeSpVpar>;
156using DFieldMemSpVpar = FieldMemSpVpar<double>;
157
158template <class ElementType>
159using FieldVpar = Field<ElementType, IdxRangeVpar>;
160using DFieldVpar = FieldVpar<double>;
161
162template <class ElementType>
163using FieldMu = Field<ElementType, IdxRangeMu>;
164using DFieldMu = FieldMu<double>;
165
166template <class ElementType>
167using FieldVparMu = Field<ElementType, IdxRangeVparMu>;
168using DFieldVparMu = FieldVparMu<double>;
169
170template <class ElementType>
171using FieldSpVparMu = Field<ElementType, IdxRangeSpVparMu>;
172using DFieldSpVparMu = FieldSpVparMu<double>;
173
174template <class ElementType>
175using FieldSpVpar = Field<ElementType, IdxRangeSpVpar>;
176using DFieldSpVpar = FieldSpVpar<double>;
177
178template <class ElementType>
179using ConstFieldVpar = ConstField<ElementType, IdxRangeVpar>;
180using DConstFieldVpar = ConstFieldVpar<double>;
181
182template <class ElementType>
183using ConstFieldMu = ConstField<ElementType, IdxRangeMu>;
184using DConstFieldMu = ConstFieldMu<double>;
185
186template <class ElementType>
187using ConstFieldVparMu = ConstField<ElementType, IdxRangeVparMu>;
188using DConstFieldVparMu = ConstFieldVparMu<double>;
189
190template <class ElementType>
191using ConstFieldSpVparMu = ConstField<ElementType, IdxRangeSpVparMu>;
192using DConstFieldSpVparMu = ConstFieldSpVparMu<double>;
193
194template <class ElementType>
195using ConstFieldSpVpar = ConstField<ElementType, IdxRangeSpVpar>;
196using DConstFieldSpVpar = ConstFieldSpVpar<double>;
197
198/* A OTER
199New notation:
200- RDimX --> X
201- IDimX --> GridX
202- IndexX --> IdxX
203- IVectX --> IdxStepX
204- IDomX --> IdxRangeX
205- DBSsplineX --> SplineCoeffX
206*/
Definition geometry.hpp:64
Definition geometry.hpp:57
Definition geometry.hpp:78
Definition geometry.hpp:75
Define non periodic magnetic momentum .
Definition geometry.hpp:32
static bool constexpr PERIODIC
The periodicity of the magnetic momentum.
Definition geometry.hpp:38
Define non periodic parallel velocity .
Definition geometry.hpp:20
static bool constexpr PERIODIC
The periodicity of the parallel velocity.
Definition geometry.hpp:26