chombo-discharge
Loading...
Searching...
No Matches
CD_PetscAMRCell.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_PETSCAMRCELL_H
14#define CD_PETSCAMRCELL_H
15
16#ifdef CH_USE_PETSC
17
18// Petsc includes
19#include "petsc.h"
20
21// Chombo includes
22#include <SPMD.H>
23
24// Our includes
25#include <CD_NamespaceHeader.H>
26
37class PetscAMRCell
38{
39public:
43 PetscAMRCell() noexcept;
44
48 ~PetscAMRCell() noexcept;
49
53 PetscAMRCell(const PetscAMRCell&) = default;
54
58 PetscAMRCell(PetscAMRCell&&) = default;
59
63 PetscAMRCell&
64 operator=(const PetscAMRCell&) = default;
65
69 PetscAMRCell&
70 operator=(PetscAMRCell&&) = default;
71
82 void
83 define(const PetscInt a_petscRowPhase0,
84 const PetscInt a_petscRowPhase1,
85 const bool a_isCoveredByFinerGrid,
86 const bool a_isCoarCF,
87 const bool a_isFineCF,
88 const bool a_isGhostCF,
89 const bool a_isDomainBoundaryCell) noexcept;
90
96 void
97 setPetscRow(const int a_phase, const PetscInt a_row) noexcept;
98
103 void
104 setCoveredByFinerGrid(const bool a_coveredByFinerGrid) noexcept;
105
110 void
111 setCoarCF(const bool a_isCoarCF) noexcept;
112
117 void
118 setFineCF(const bool a_isFineCF) noexcept;
119
124 void
125 setGhostCF(const bool a_isGhostCF) noexcept;
126
131 void
132 setDomainBoundaryCell(const bool a_isDomainBoundaryCell) noexcept;
133
137 PetscInt
138 getPetscRow(const int a_iphase) const noexcept;
139
143 bool
144 isCoveredByFinerGrid() const noexcept;
145
149 bool
150 isCoarCF() const noexcept;
151
155 bool
156 isFineCF() const noexcept;
157
161 bool
162 isGhostCF() const noexcept;
163
167 bool
168 isDomainBoundaryCell() const noexcept;
169
173 PetscInt m_petscRows[2];
174
178 bool m_isCoveredByFinerGrid;
179
183 bool m_isGhostCF;
184
188 bool m_isCoarCF;
189
193 bool m_isFineCF;
194
198 bool m_isDomainBoundaryCell;
199};
200
204constexpr int
205linearSize(const PetscAMRCell& a_amrCell);
206
212void
213linearIn(PetscAMRCell& a_amrCell, const void* const a_buffer);
214
220void
221linearOut(void* const a_buffer, const PetscAMRCell& a_amrCell);
222
223#include <CD_NamespaceFooter.H>
224
225#endif
226
227#endif