forked from AMReX-Codes/amrex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAMReX_AuxBoundaryData.H
97 lines (73 loc) · 2.63 KB
/
AMReX_AuxBoundaryData.H
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
#ifndef AMREX_AuxBoundaryData_H_
#define AMREX_AuxBoundaryData_H_
#include <AMReX_Config.H>
#include <AMReX_Geometry.H>
#include <AMReX_MultiFab.H>
namespace amrex {
// \cond CODEGEN
class AuxBoundaryData
{
public:
AuxBoundaryData () noexcept = default;
AuxBoundaryData (const BoxArray& ba,
int n_grow,
int n_comp,
const Geometry& geom);
~AuxBoundaryData () = default;
AuxBoundaryData (AuxBoundaryData&& rhs) = default;
AuxBoundaryData& operator= (AuxBoundaryData&& rhs) = default;
AuxBoundaryData (const AuxBoundaryData& rhs);
AuxBoundaryData& operator= (const AuxBoundaryData& rhs) = delete;
void copyTo (MultiFab& destmf,
int src_comp,
int dst_comp,
int num_comp) const;
void copyFrom (const MultiFab& srcmf,
int src_comp,
int dst_comp,
int num_comp,
int src_ng = 0);
size_t size () const noexcept
{
BL_ASSERT(!m_empty); BL_ASSERT(m_initialized); return m_fabs.size();
}
void copy (const AuxBoundaryData& src,
int src_comp,
int dst_comp,
int num_comp);
void initialize (const BoxArray& ba,
int n_grow,
int n_comp,
const Geometry& geom);
const BoxArray& equivBoxArray () const noexcept
{
BL_ASSERT(!m_empty); BL_ASSERT(m_initialized); return m_fabs.boxArray();
}
void setVal (Real r) { BL_ASSERT(m_initialized); if (!m_empty) { m_fabs.setVal(r); } }
const DistributionMapping& DistributionMap () const noexcept
{
BL_ASSERT(!m_empty); BL_ASSERT(m_initialized); return m_fabs.DistributionMap();
}
FArrayBox& operator[] (const MFIter& mfi) noexcept
{
BL_ASSERT(!m_empty); BL_ASSERT(m_initialized); return m_fabs[mfi];
}
const FArrayBox& operator[] (const MFIter& mfi) const noexcept
{
BL_ASSERT(!m_empty); BL_ASSERT(m_initialized); return m_fabs[mfi];
}
int nGrow () const noexcept { BL_ASSERT(m_initialized); return m_ngrow; }
int nComp () const noexcept
{
BL_ASSERT(!m_empty); BL_ASSERT(m_initialized); return m_fabs.nComp();
}
bool isEmpty () const noexcept { return m_empty; }
private:
MultiFab m_fabs;
int m_ngrow{0};
bool m_empty{false};
bool m_initialized{false};
};
// \endcond
}
#endif