File: petsclandau.h.html

package info (click to toggle)
petsc 3.23.1%2Bdfsg1-1exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 515,576 kB
  • sloc: ansic: 751,607; cpp: 51,542; python: 38,598; f90: 17,352; javascript: 3,493; makefile: 3,157; sh: 1,502; xml: 619; objc: 445; java: 13; csh: 1
file content (242 lines) | stat: -rw-r--r-- 27,826 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<center><a href="https://gitlab.com/petsc/petsc/-/blob/966382dc56242773704ef5f5cee7aa2db3ebc577/include/petsclandau.h">Actual source code: petsclandau.h</a></center><br>

<html>
<head>
<title></title>
<meta name="generator" content="c2html 0.9.6">
<meta name="date" content="2025-04-30T18:14:50+00:00">
</head>

<body bgcolor="#FFFFFF">
<pre width=80>
<a name="line1">  1: </a><font color="#A020F0">#pragma once</font>

<a name="line3">  3: </a>#include <A href="../include/petscdmplex.h.html">&lt;petscdmplex.h&gt;</A>
<a name="line4">  4: </a>#include <A href="../include/petscts.h.html">&lt;petscts.h&gt;</A>

<a name="line6">  6: </a><font color="#B22222">/* MANSEC = <a href="../manualpages/TS/TS.html">TS</a> */</font>
<a name="line7">  7: </a><font color="#B22222">/* SUBMANSEC = LANDAU */</font>

<a name="line9">  9: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/LANDAU/DMPlexLandauPrintNorms.html">DMPlexLandauPrintNorms</a>(<a href="../manualpages/Vec/Vec.html">Vec</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)</font></strong>;
<a name="line10"> 10: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/LANDAU/DMPlexLandauCreateVelocitySpace.html">DMPlexLandauCreateVelocitySpace</a>(<a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const char[], <a href="../manualpages/Vec/Vec.html">Vec</a> *, <a href="../manualpages/Mat/Mat.html">Mat</a> *, <a href="../manualpages/DM/DM.html">DM</a> *)</font></strong>;
<a name="line11"> 11: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/LANDAU/DMPlexLandauDestroyVelocitySpace.html">DMPlexLandauDestroyVelocitySpace</a>(<a href="../manualpages/DM/DM.html">DM</a> *)</font></strong>;
<a name="line12"> 12: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/LANDAU/DMPlexLandauAccess.html">DMPlexLandauAccess</a>(<a href="../manualpages/DM/DM.html">DM</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>, <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*)(<a href="../manualpages/DM/DM.html">DM</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, void *), void *)</font></strong>;
<a name="line13"> 13: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/LANDAU/DMPlexLandauAddMaxwellians.html">DMPlexLandauAddMaxwellians</a>(<a href="../manualpages/DM/DM.html">DM</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, void *)</font></strong>;
<a name="line14"> 14: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/LANDAU/DMPlexLandauCreateMassMatrix.html">DMPlexLandauCreateMassMatrix</a>(<a href="../manualpages/DM/DM.html">DM</a> dm, <a href="../manualpages/Mat/Mat.html">Mat</a> *Amat)</font></strong>;
<a name="line15"> 15: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/LANDAU/DMPlexLandauIFunction.html">DMPlexLandauIFunction</a>(<a href="../manualpages/TS/TS.html">TS</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>, void *)</font></strong>;
<a name="line16"> 16: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> <a href="../manualpages/LANDAU/DMPlexLandauIJacobian.html">DMPlexLandauIJacobian</a>(<a href="../manualpages/TS/TS.html">TS</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>, <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, <a href="../manualpages/Mat/Mat.html">Mat</a>, <a href="../manualpages/Mat/Mat.html">Mat</a>, void *)</font></strong>;

<a name="line18"> 18: </a><font color="#4169E1">typedef <a href="../manualpages/Sys/PetscInt.html">PetscInt</a> LandauIdx;</font>

<a name="line20"> 20: </a><font color="#B22222">/* the Fokker-Planck-Landau context */</font>
<a name="line21"> 21: </a><font color="#A020F0">#if !defined(LANDAU_MAX_SPECIES)</font>
<a name="line22"> 22: </a><font color="#A020F0">  #if defined(PETSC_USE_DMLANDAU_2D)</font>
<a name="line23"> 23: </a><strong><font color="#228B22">    #define LANDAU_MAX_SPECIES 10</font></strong>
<a name="line24"> 24: </a><strong><font color="#228B22">    #define LANDAU_MAX_GRIDS   3</font></strong>
<a name="line25"> 25: </a><font color="#A020F0">  #else</font>
<a name="line26"> 26: </a><strong><font color="#228B22">    #define LANDAU_MAX_SPECIES 10</font></strong>
<a name="line27"> 27: </a><strong><font color="#228B22">    #define LANDAU_MAX_GRIDS   3</font></strong>
<a name="line28"> 28: </a><font color="#A020F0">  #endif</font>
<a name="line29"> 29: </a><font color="#A020F0">#else</font>
<a name="line30"> 30: </a><strong><font color="#228B22">  #define LANDAU_MAX_GRIDS 3</font></strong>
<a name="line31"> 31: </a><font color="#A020F0">#endif</font>

<a name="line33"> 33: </a><font color="#A020F0">#if !defined(LANDAU_MAX_Q)</font>
<a name="line34"> 34: </a><font color="#A020F0">  #if defined(LANDAU_MAX_NQND)</font>
<a name="line35"> 35: </a><font color="#A020F0">    #error </font><font color="#666666">"LANDAU_MAX_NQND but not LANDAU_MAX_Q. Use -DLANDAU_MAX_Q=4 for Q3 elements"</font><font color="#A020F0"></font>
<a name="line36"> 36: </a><font color="#A020F0">  #endif</font>
<a name="line37"> 37: </a><font color="#A020F0">  #if defined(PETSC_USE_DMLANDAU_2D)</font>
<a name="line38"> 38: </a><strong><font color="#228B22">    #define LANDAU_MAX_Q 6</font></strong>
<a name="line39"> 39: </a><font color="#A020F0">  #else</font>
<a name="line40"> 40: </a><strong><font color="#228B22">    #define LANDAU_MAX_Q 5</font></strong>
<a name="line41"> 41: </a><font color="#A020F0">  #endif</font>
<a name="line42"> 42: </a><font color="#A020F0">#else</font>
<a name="line43"> 43: </a><strong><font color="#228B22">  #undef LANDAU_MAX_NQND</font></strong>
<a name="line44"> 44: </a><font color="#A020F0">#endif</font>

<a name="line46"> 46: </a><font color="#A020F0">#if defined(PETSC_USE_DMLANDAU_2D)</font>
<a name="line47"> 47: </a><strong><font color="#228B22">  #define LANDAU_MAX_Q_FACE   LANDAU_MAX_Q</font></strong>
<a name="line48"> 48: </a><strong><font color="#228B22">  #define LANDAU_MAX_NQND     (LANDAU_MAX_Q * LANDAU_MAX_Q)</font></strong>
<a name="line49"> 49: </a><strong><font color="#228B22">  #define LANDAU_MAX_BATCH_SZ 1024</font></strong>
<a name="line50"> 50: </a><strong><font color="#228B22">  #define LANDAU_DIM          2</font></strong>
<a name="line51"> 51: </a><font color="#A020F0">#else</font>
<a name="line52"> 52: </a><strong><font color="#228B22">  #define LANDAU_MAX_Q_FACE   (LANDAU_MAX_Q * LANDAU_MAX_Q)</font></strong>
<a name="line53"> 53: </a><strong><font color="#228B22">  #define LANDAU_MAX_NQND     (LANDAU_MAX_Q * LANDAU_MAX_Q * LANDAU_MAX_Q)</font></strong>
<a name="line54"> 54: </a><strong><font color="#228B22">  #define LANDAU_MAX_BATCH_SZ 64</font></strong>
<a name="line55"> 55: </a><strong><font color="#228B22">  #define LANDAU_DIM          3</font></strong>
<a name="line56"> 56: </a><font color="#A020F0">#endif</font>

<a name="line58"> 58: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line59"> 59: </a>  LANDAU_KOKKOS,
<a name="line60"> 60: </a>  LANDAU_CPU
<a name="line61"> 61: </a>} LandauDeviceType;

<a name="line63"> 63: </a><font color="#B22222">// static data - will be "device" data</font>
<a name="line64"> 64: </a><font color="#4169E1">typedef</font> <font color="#4169E1">struct</font> {
<a name="line65"> 65: </a>  void *invJ;    <font color="#B22222">// nip*dim*dim</font>
<a name="line66"> 66: </a>  void *D;       <font color="#B22222">// nq*nb*dim</font>
<a name="line67"> 67: </a>  void *B;       <font color="#B22222">// nq*nb</font>
<a name="line68"> 68: </a>  void *alpha;   <font color="#B22222">// ns</font>
<a name="line69"> 69: </a>  void *beta;    <font color="#B22222">// ns</font>
<a name="line70"> 70: </a>  void *invMass; <font color="#B22222">// ns</font>
<a name="line71"> 71: </a>  void *w;       <font color="#B22222">// nip</font>
<a name="line72"> 72: </a>  void *x;       <font color="#B22222">// nip</font>
<a name="line73"> 73: </a>  void *y;       <font color="#B22222">// nip</font>
<a name="line74"> 74: </a>  void *z;       <font color="#B22222">// nip</font>
<a name="line75"> 75: </a>  void *Eq_m;    <font color="#B22222">// ns - dynamic</font>
<a name="line76"> 76: </a>  void *f;       <font color="#B22222">//  nip*Nf - dynamic (IP)</font>
<a name="line77"> 77: </a>  void *dfdx;    <font color="#B22222">// nip*Nf - dynamic (IP)</font>
<a name="line78"> 78: </a>  void *dfdy;    <font color="#B22222">// nip*Nf - dynamic (IP)</font>
<a name="line79"> 79: </a>  void *dfdz;    <font color="#B22222">// nip*Nf - dynamic (IP)</font>
<a name="line80"> 80: </a>  int   dim_, ns_, nip_, nq_, nb_;
<a name="line81"> 81: </a>  void *NCells;         <font color="#B22222">// remove and use elem_offset - TODO</font>
<a name="line82"> 82: </a>  void *species_offset; <font color="#B22222">// for each grid, but same for all batched vertices</font>
<a name="line83"> 83: </a>  void *mat_offset;     <font color="#B22222">// for each grid, but same for all batched vertices</font>
<a name="line84"> 84: </a>  void *elem_offset;    <font color="#B22222">// for each grid, but same for all batched vertices</font>
<a name="line85"> 85: </a>  void *ip_offset;      <font color="#B22222">// for each grid, but same for all batched vertices</font>
<a name="line86"> 86: </a>  void *ipf_offset;     <font color="#B22222">// for each grid, but same for all batched vertices</font>
<a name="line87"> 87: </a>  void *ipfdf_data;     <font color="#B22222">// for each grid, but same for all batched vertices</font>
<a name="line88"> 88: </a>  void *maps;           <font color="#B22222">// for each grid, but same for all batched vertices</font>
<a name="line89"> 89: </a>  <font color="#B22222">// COO</font>
<a name="line90"> 90: </a>  void     *coo_elem_offsets;
<a name="line91"> 91: </a>  void     *coo_elem_point_offsets;
<a name="line92"> 92: </a>  void     *coo_elem_fullNb;
<a name="line93"> 93: </a>  void     *coo_vals;
<a name="line94"> 94: </a>  void     *lambdas;
<a name="line95"> 95: </a>  LandauIdx coo_n_cellsTot;
<a name="line96"> 96: </a>  LandauIdx coo_size;
<a name="line97"> 97: </a>  LandauIdx coo_max_fullnb;
<a name="line98"> 98: </a>} LandauStaticData;

<a name="line100">100: </a><font color="#4169E1">typedef</font> <font color="#4169E1">enum</font> {
<a name="line101">101: </a>  LANDAU_EX2_TSSOLVE,
<a name="line102">102: </a>  LANDAU_MATRIX_TOTAL,
<a name="line103">103: </a>  LANDAU_OPERATOR,
<a name="line104">104: </a>  LANDAU_JACOBIAN_COUNT,
<a name="line105">105: </a>  LANDAU_JACOBIAN,
<a name="line106">106: </a>  LANDAU_MASS,
<a name="line107">107: </a>  LANDAU_F_DF,
<a name="line108">108: </a>  LANDAU_KERNEL,
<a name="line109">109: </a>  KSP_FACTOR,
<a name="line110">110: </a>  KSP_SOLVE,
<a name="line111">111: </a>  LANDAU_NUM_TIMERS
<a name="line112">112: </a>} LandauOMPTimers;

<a name="line114">114: </a><font color="#4169E1">typedef</font> <font color="#4169E1">struct</font> {
<a name="line115">115: </a>  <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> interpolate; <font color="#B22222">/* Generate intermediate mesh elements */</font>
<a name="line116">116: </a>  <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> gpu_assembly;
<a name="line117">117: </a>  <a href="../manualpages/Sys/MPI_Comm.html">MPI_Comm</a>  comm; <font color="#B22222">/* global communicator to use for errors and diagnostics */</font>
<a name="line118">118: </a>  double    times[LANDAU_NUM_TIMERS];
<a name="line119">119: </a>  <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> use_matrix_mass;
<a name="line120">120: </a>  <font color="#B22222">/* FE */</font>
<a name="line121">121: </a>  <a href="../manualpages/FE/PetscFE.html">PetscFE</a> fe[LANDAU_MAX_SPECIES];
<a name="line122">122: </a>  <font color="#B22222">/* geometry  */</font>
<a name="line123">123: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> radius[LANDAU_MAX_GRIDS];
<a name="line124">124: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> radius_par[LANDAU_MAX_GRIDS];
<a name="line125">125: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> radius_perp[LANDAU_MAX_GRIDS];
<a name="line126">126: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> re_radius;      <font color="#B22222">/* RE: radius of refinement along v_perp=0, z&gt;0 */</font>
<a name="line127">127: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> vperp0_radius1; <font color="#B22222">/* RE: radius of refinement along v_perp=0 */</font>
<a name="line128">128: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> vperp0_radius2; <font color="#B22222">/* RE: radius of refinement along v_perp=0 after origin AMR refinement */</font>
<a name="line129">129: </a>  <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> sphere;
<a name="line130">130: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> sphere_inner_radius_90degree[LANDAU_MAX_GRIDS];
<a name="line131">131: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> sphere_inner_radius_45degree[LANDAU_MAX_GRIDS];
<a name="line132">132: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>  cells0[3];
<a name="line133">133: </a>  <font color="#B22222">/* AMR */</font>
<a name="line134">134: </a>  <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> use_p4est;
<a name="line135">135: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>  numRERefine;                     <font color="#B22222">/* RE: refinement along v_perp=0, z &gt; 0 */</font>
<a name="line136">136: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>  nZRefine1;                       <font color="#B22222">/* RE: origin refinement after v_perp=0 refinement */</font>
<a name="line137">137: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>  nZRefine2;                       <font color="#B22222">/* RE: origin refinement after origin AMR refinement */</font>
<a name="line138">138: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>  numAMRRefine[LANDAU_MAX_GRIDS];  <font color="#B22222">/* normal AMR - refine from origin */</font>
<a name="line139">139: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>  postAMRRefine[LANDAU_MAX_GRIDS]; <font color="#B22222">/* uniform refinement of AMR */</font>
<a name="line140">140: </a>  <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> simplex;
<a name="line141">141: </a>  char      filename[PETSC_MAX_PATH_LEN];
<a name="line142">142: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> thermal_speed[LANDAU_MAX_GRIDS];
<a name="line143">143: </a>  <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> sphere_uniform_normal;
<a name="line144">144: </a>  <font color="#B22222">/* relativistic */</font>
<a name="line145">145: </a>  <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> use_energy_tensor_trick;
<a name="line146">146: </a>  <a href="../manualpages/Sys/PetscBool.html">PetscBool</a> use_relativistic_corrections;
<a name="line147">147: </a>  <font color="#B22222">/* physics */</font>
<a name="line148">148: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> thermal_temps[LANDAU_MAX_SPECIES];
<a name="line149">149: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> masses[LANDAU_MAX_SPECIES];  <font color="#B22222">/* mass of each species  */</font>
<a name="line150">150: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> charges[LANDAU_MAX_SPECIES]; <font color="#B22222">/* charge of each species  */</font>
<a name="line151">151: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> n[LANDAU_MAX_SPECIES];       <font color="#B22222">/* number density of each species  */</font>
<a name="line152">152: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> m_0;                         <font color="#B22222">/* reference mass */</font>
<a name="line153">153: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> v_0;                         <font color="#B22222">/* reference velocity */</font>
<a name="line154">154: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> n_0;                         <font color="#B22222">/* reference number density */</font>
<a name="line155">155: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> t_0;                         <font color="#B22222">/* reference time */</font>
<a name="line156">156: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> Ez;
<a name="line157">157: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> epsilon0;
<a name="line158">158: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> k;
<a name="line159">159: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> lambdas[LANDAU_MAX_GRIDS][LANDAU_MAX_GRIDS];
<a name="line160">160: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> electronShift;
<a name="line161">161: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>  num_species;
<a name="line162">162: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>  num_grids;
<a name="line163">163: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>  species_offset[LANDAU_MAX_GRIDS + 1]; <font color="#B22222">// for each grid, but same for all batched vertices</font>
<a name="line164">164: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>  mat_offset[LANDAU_MAX_GRIDS + 1];     <font color="#B22222">// for each grid, but same for all batched vertices</font>
<a name="line165">165: </a>  <font color="#B22222">// batching</font>
<a name="line166">166: </a>  <a href="../manualpages/Sys/PetscBool.html">PetscBool</a>  jacobian_field_major_order; <font color="#B22222">// this could be a type but lets not get pedantic</font>
<a name="line167">167: </a>  <a href="../manualpages/PetscSF/VecScatter.html">VecScatter</a> plex_batch;
<a name="line168">168: </a>  <a href="../manualpages/Vec/Vec.html">Vec</a>        work_vec;
<a name="line169">169: </a>  <a href="../manualpages/IS/IS.html">IS</a>         batch_is;
<a name="line170">170: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*seqaij_mult)(<a href="../manualpages/Mat/Mat.html">Mat</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>);
<a name="line171">171: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*seqaij_multtranspose)(<a href="../manualpages/Mat/Mat.html">Mat</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>);
<a name="line172">172: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*seqaij_solve)(<a href="../manualpages/Mat/Mat.html">Mat</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>);
<a name="line173">173: </a>  <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> (*seqaij_getdiagonal)(<a href="../manualpages/Mat/Mat.html">Mat</a>, <a href="../manualpages/Vec/Vec.html">Vec</a>);
<a name="line174">174: </a>  <font color="#B22222">/* COO */</font>
<a name="line175">175: </a>  <a href="../manualpages/Mat/Mat.html">Mat</a> J;
<a name="line176">176: </a>  <a href="../manualpages/Mat/Mat.html">Mat</a> M;
<a name="line177">177: </a>  <a href="../manualpages/Vec/Vec.html">Vec</a> X;
<a name="line178">178: </a>  <font color="#B22222">/* derived type */</font>
<a name="line179">179: </a>  void *data;
<a name="line180">180: </a>  <font color="#B22222">/* computing */</font>
<a name="line181">181: </a>  LandauDeviceType deviceType;
<a name="line182">182: </a>  <a href="../manualpages/DM/DM.html">DM</a>               pack;
<a name="line183">183: </a>  <a href="../manualpages/DM/DM.html">DM</a>               plex[LANDAU_MAX_GRIDS];
<a name="line184">184: </a>  LandauStaticData SData_d; <font color="#B22222">/* static geometric data on device */</font>
<a name="line185">185: </a>  <font color="#B22222">/* diagnostics */</font>
<a name="line186">186: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>         verbose;
<a name="line187">187: </a>  <a href="../manualpages/Log/PetscLogEvent.html">PetscLogEvent</a>    events[20];
<a name="line188">188: </a>  <a href="../manualpages/Log/PetscLogStage.html">PetscLogStage</a>    stage;
<a name="line189">189: </a>  <a href="../manualpages/Sys/PetscObjectState.html">PetscObjectState</a> norm_state;
<a name="line190">190: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>         batch_sz;
<a name="line191">191: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>         batch_view_idx;
<a name="line192">192: </a>} LandauCtx;

<a name="line194">194: </a><strong><font color="#228B22">#define LANDAU_SPECIES_MAJOR</font></strong>
<a name="line195">195: </a><font color="#A020F0">#if !defined(LANDAU_SPECIES_MAJOR)</font>
<a name="line196">196: </a><strong><font color="#228B22">  #define LAND_PACK_IDX(_b, _g)                         (_b * ctx-&gt;num_grids + _g)</font></strong>
<a name="line197">197: </a><strong><font color="#228B22">  #define LAND_MOFFSET(_b, _g, _nbch, _ngrid, _mat_off) (_b * _mat_off[_ngrid] + _mat_off[_g])</font></strong>
<a name="line198">198: </a><font color="#A020F0">#else</font>
<a name="line199">199: </a><strong><font color="#228B22">  #define LAND_PACK_IDX(_b, _g)                         (_g * ctx-&gt;batch_sz + _b)</font></strong>
<a name="line200">200: </a><strong><font color="#228B22">  #define LAND_MOFFSET(_b, _g, _nbch, _ngrid, _mat_off) (_nbch * _mat_off[_g] + _b * (_mat_off[_g + 1] - _mat_off[_g]))</font></strong>
<a name="line201">201: </a><font color="#A020F0">#endif</font>

<a name="line203">203: </a><font color="#4169E1">typedef</font> <font color="#4169E1">struct</font> {
<a name="line204">204: </a>  <a href="../manualpages/Sys/PetscReal.html">PetscReal</a> scale;
<a name="line205">205: </a>  LandauIdx gid; <font color="#B22222">// Landau matrix index (<10,000)</font>
<a name="line206">206: </a>} pointInterpolationP4est;
<a name="line207">207: </a><font color="#4169E1"><a name="_lP4estVertexMaps"></a>typedef struct _lP4estVertexMaps </font>{
<a name="line208">208: </a>  LandauIdx (*gIdx)[LANDAU_MAX_SPECIES][LANDAU_MAX_NQND]; <font color="#B22222">// #elems *  LANDAU_MAX_NQND</font>
<a name="line209">209: </a>  LandauIdx        num_elements;
<a name="line210">210: </a>  LandauIdx        num_reduced;
<a name="line211">211: </a>  LandauIdx        num_face; <font color="#B22222">// (Q or Q^2 for 3D)</font>
<a name="line212">212: </a>  LandauDeviceType deviceType;
<a name="line213">213: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>         Nf;
<a name="line214">214: </a>  pointInterpolationP4est (*c_maps)[LANDAU_MAX_Q_FACE];
<a name="line215">215: </a>  <font color="#4169E1">struct _lP4estVertexMaps</font> *d_self;
<a name="line216">216: </a>  void                     *vp1, *vp2, *vp3;
<a name="line217">217: </a>  <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>                  numgrids;
<a name="line218">218: </a>} P4estVertexMaps;

<a name="line220">220: </a><font color="#A020F0">#if defined(PETSC_HAVE_KOKKOS)</font>
<a name="line221">221: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> LandauKokkosJacobian(<a href="../manualpages/DM/DM.html">DM</a>[], const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>[], const <a href="../manualpages/Sys/PetscScalar.html">PetscScalar</a>[], const LandauStaticData *, const <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>, const <a href="../manualpages/Log/PetscLogEvent.html">PetscLogEvent</a>[], const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Mat/Mat.html">Mat</a>[], <a href="../manualpages/Mat/Mat.html">Mat</a>)</font></strong>;
<a name="line222">222: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> LandauKokkosCreateMatMaps(P4estVertexMaps *, pointInterpolationP4est (*)[LANDAU_MAX_Q_FACE], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)</font></strong>;
<a name="line223">223: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> LandauKokkosDestroyMatMaps(P4estVertexMaps *, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>)</font></strong>;
<a name="line224">224: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> LandauKokkosStaticDataSet(<a href="../manualpages/DM/DM.html">DM</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, const <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>, <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscInt.html">PetscInt</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], <a href="../manualpages/Sys/PetscReal.html">PetscReal</a>[], LandauStaticData *)</font></strong>;
<a name="line225">225: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> LandauKokkosStaticDataClear(LandauStaticData *)</font></strong>;
<a name="line226">226: </a><font color="#A020F0">#endif</font>
</pre>
</body>

</html>