chombo-discharge
Loading...
Searching...
No Matches
Source
AmrMesh
CD_PetscGrid.H
Go to the documentation of this file.
1
/* chombo-discharge
2
* Copyright © 2026 SINTEF Energy Research.
3
* Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4
*/
5
12
#ifndef CD_PetscGrid_H
13
#define CD_PetscGrid_H
14
15
#ifdef CH_USE_PETSC
16
17
// Petsc includes
18
#include "petsc.h"
19
#include "petscis.h"
20
21
// Chombo includes
22
#include <DisjointBoxLayout.H>
23
#include <EBCellFAB.H>
24
#include <MFCellFAB.H>
25
#include <EBISLayout.H>
26
27
// Our includes
28
#include <
CD_DischargeIO.H
>
29
#include <
CD_EBAMRData.H
>
30
#include <
CD_MFLevelGrid.H
>
31
#include <
CD_PetscDOF.H
>
32
#include <
CD_PetscAMRCell.H
>
33
#include <CD_NamespaceHeader.H>
34
40
class
PetscGrid
41
{
42
public
:
46
PetscGrid
()
noexcept
;
47
51
virtual
~
PetscGrid
()
noexcept
;
52
69
virtual
void
70
define(
const
Vector
<
RefCountedPtr
<
MFLevelGrid
>>&
a_levelGrids
,
71
const
Vector
<
RefCountedPtr
<
MFLevelGrid
>>&
a_levelGridsCoFi
,
72
const
Vector
<
RefCountedPtr
<
MFLevelGrid
>>&
a_levelGridsFiCo
,
73
const
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
bool
>>>>&
a_validCells
,
74
const
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
bool
>>>>&
a_coarHaloCF
,
75
const
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
bool
>>>>&
a_fineHaloCF
,
76
const
Vector
<
int
>&
a_refinementRatios
,
77
const
Vector
<
Real
>&
a_dx
,
78
const
int
a_finestLevel
,
79
const
int
a_numGhost
)
noexcept
;
80
85
virtual
void
86
clear()
noexcept
;
87
93
virtual
void
94
create(
Vec
&
x
)
noexcept
;
95
101
virtual
void
102
destroy
(
Vec
&
x
)
noexcept
;
103
109
virtual
void
110
setValue(
Vec
&
a_x
,
const
PetscScalar
a_value
)
const
noexcept
;
111
117
virtual
void
118
putChomboInPetsc
(
Vec
&
a_x
,
const
MFAMRCellData
&
a_y
)
const
noexcept
;
119
125
virtual
void
126
putPetscInChombo
(
MFAMRCellData
&
a_y
,
const
Vec
&
a_x
)
const
noexcept
;
127
131
virtual
void
132
dumpPetscGrid
(
const
std
::
string
a_filename
)
const
noexcept
;
133
134
protected
:
138
bool
m_isDefined;
139
143
bool
m_verbose;
144
148
bool
m_debug;
149
153
bool
m_profile;
154
158
int
m_finestLevel;
159
163
int
m_numGhost;
164
168
int
m_numPhases;
169
173
PetscInt
m_numLocalRows
;
174
178
PetscInt
m_numGlobalRows
;
179
183
PetscInt
m_localRowBegin
;
184
188
ISLocalToGlobalMapping
m_localToGlobalIS
;
189
193
Vector
<
PetscInt
>
m_numRowsPerRank
;
194
198
Vector
<
RefCountedPtr
<
MFLevelGrid
>>
m_levelGrids
;
199
203
Vector
<
RefCountedPtr
<
MFLevelGrid
>>
m_levelGridsCoFi
;
204
208
Vector
<
RefCountedPtr
<
MFLevelGrid
>>
m_levelGridsFiCo
;
209
213
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
bool
>>>> m_validCells;
214
218
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
bool
>>>>
m_coarHaloCF
;
219
223
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
bool
>>>>
m_fineHaloCF
;
224
228
Vector
<
int
> m_refRat;
229
233
Vector
<
Real
> m_dx;
234
239
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
PetscAMRCell
>>>>
m_amrToPetsc
;
240
246
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
PetscAMRCell
>>>>
m_amrToPetscCoFi
;
247
253
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
PetscAMRCell
>>>>
m_amrToPetscFiCo
;
254
259
Vector
<
RefCountedPtr
<
LayoutData
<
Vector
<
PetscDOF
>>>>
m_petscToAMR
[2];
260
266
virtual
void
267
defineAMRCells
()
noexcept
;
268
275
virtual
void
276
definePetscRows
()
noexcept
;
277
281
virtual
void
282
defineCoFiBuffers
()
noexcept
;
283
};
284
285
#include <CD_NamespaceFooter.H>
286
287
#endif
288
289
#endif
CD_DischargeIO.H
Silly, but useful functions that override standard Chombo HDF5 IO.
CD_EBAMRData.H
Class for holding data across EBAMR hierarchies.
CD_MFLevelGrid.H
Declaration of a wrapper for wrapping multifluid EBLevelGrids.
CD_PetscAMRCell.H
Declaration of a cell type for indicating if a cell is covered, ghost, etc.
CD_PetscDOF.H
Declaration of a simple mapping between a PETSc index and an AMR cell.
EBAMRData< MFCellFAB >
MFLevelGrid
Wrapper class for holding multifluid EBLevelGrids.
Definition
CD_MFLevelGrid.H:29
TracerParticleSolver
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition
CD_TracerParticleSolver.H:37
TracerParticleSolver::TracerParticleSolver
TracerParticleSolver()
Default constructor.
Definition
CD_TracerParticleSolverImplem.H:25
PetscDOF
Definition
CD_PetscDOF.H:23
Generated by
1.9.8