chombo-discharge
Loading...
Searching...
No Matches
Source
AmrMesh
CD_PetscGrid.H
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3
*
4
* SPDX-License-Identifier: GPL-3.0-or-later
5
*/
6
13
#ifndef CD_PETSCGRID_H
14
#define CD_PETSCGRID_H
15
16
#ifdef CH_USE_PETSC
17
18
// Petsc includes
19
#include "petsc.h"
20
#include "petscis.h"
21
22
// Chombo includes
23
#include <DisjointBoxLayout.H>
24
#include <EBCellFAB.H>
25
#include <MFCellFAB.H>
26
#include <EBISLayout.H>
27
28
// Our includes
29
#include <
CD_DischargeIO.H
>
30
#include <
CD_EBAMRData.H
>
31
#include <
CD_MFLevelGrid.H
>
32
#include <
CD_PetscDOF.H
>
33
#include <
CD_PetscAMRCell.H
>
34
#include <CD_NamespaceHeader.H>
35
41
class
PetscGrid
42
{
43
public
:
47
PetscGrid
()
noexcept
;
48
52
virtual
~
PetscGrid
()
noexcept
;
53
70
virtual
void
71
define(
const
Vector
<
RefCountedPtr
<
MFLevelGrid
>>&
a_levelGrids
,
72
const
Vector
<
RefCountedPtr
<
MFLevelGrid
>>&
a_levelGridsCoFi
,
73
const
Vector
<
RefCountedPtr
<
MFLevelGrid
>>&
a_levelGridsFiCo
,
74
const
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
bool
>>>>&
a_validCells
,
75
const
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
bool
>>>>&
a_coarHaloCF
,
76
const
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
bool
>>>>&
a_fineHaloCF
,
77
const
Vector
<
int
>&
a_refinementRatios
,
78
const
Vector
<
Real
>&
a_dx
,
79
const
int
a_finestLevel
,
80
const
int
a_numGhost
)
noexcept
;
81
86
virtual
void
87
clear()
noexcept
;
88
94
virtual
void
95
create(
Vec
&
x
)
noexcept
;
96
102
virtual
void
103
destroy
(
Vec
&
x
)
noexcept
;
104
110
virtual
void
111
setValue(
Vec
&
a_x
,
const
PetscScalar
a_value
)
const
noexcept
;
112
118
virtual
void
119
putChomboInPetsc
(
Vec
&
a_x
,
const
MFAMRCellData
&
a_y
)
const
noexcept
;
120
126
virtual
void
127
putPetscInChombo
(
MFAMRCellData
&
a_y
,
const
Vec
&
a_x
)
const
noexcept
;
128
132
virtual
void
133
dumpPetscGrid
(
const
std
::
string
&
a_filename
)
const
noexcept
;
134
135
protected
:
139
bool
m_isDefined;
140
144
bool
m_verbose;
145
149
bool
m_debug;
150
154
bool
m_profile;
155
159
int
m_finestLevel;
160
164
int
m_numGhost;
165
169
int
m_numPhases;
170
174
PetscInt
m_numLocalRows
;
175
179
PetscInt
m_numGlobalRows
;
180
184
PetscInt
m_localRowBegin
;
185
189
ISLocalToGlobalMapping
m_localToGlobalIS
;
190
194
Vector
<
PetscInt
>
m_numRowsPerRank
;
195
199
Vector
<
RefCountedPtr
<
MFLevelGrid
>>
m_levelGrids
;
200
204
Vector
<
RefCountedPtr
<
MFLevelGrid
>>
m_levelGridsCoFi
;
205
209
Vector
<
RefCountedPtr
<
MFLevelGrid
>>
m_levelGridsFiCo
;
210
214
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
bool
>>>> m_validCells;
215
219
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
bool
>>>>
m_coarHaloCF
;
220
224
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
bool
>>>>
m_fineHaloCF
;
225
229
Vector
<
int
> m_refRat;
230
234
Vector
<
Real
> m_dx;
235
240
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
PetscAMRCell
>>>>
m_amrToPetsc
;
241
247
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
PetscAMRCell
>>>>
m_amrToPetscCoFi
;
248
254
Vector
<
RefCountedPtr
<
LevelData
<
BaseFab
<
PetscAMRCell
>>>>
m_amrToPetscFiCo
;
255
260
Vector
<
RefCountedPtr
<
LayoutData
<
Vector
<
PetscDOF
>>>>
m_petscToAMR
[2];
261
267
virtual
void
268
defineAMRCells
()
noexcept
;
269
276
virtual
void
277
definePetscRows
()
noexcept
;
278
282
virtual
void
283
defineCoFiBuffers
()
noexcept
;
284
};
285
286
#include <CD_NamespaceFooter.H>
287
288
#endif
289
290
#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.
MFLevelGrid
Wrapper class for holding multifluid EBLevelGrids.
Definition
CD_MFLevelGrid.H:30
TracerParticleSolver
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition
CD_TracerParticleSolver.H:38
TracerParticleSolver::TracerParticleSolver
TracerParticleSolver()
Default constructor.
Definition
CD_TracerParticleSolverImplem.H:26
PetscDOF
Mapping between a PETSc local row index and an AMR grid cell.
Definition
CD_PetscDOF.H:27
Generated by
1.9.8