12 #ifndef CD_EBAMRDataImplem_H
13 #define CD_EBAMRDataImplem_H
20 #include <CD_NamespaceHeader.H>
25 CH_TIME(
"EBAMRData<T>::EBAMRData()");
32 CH_TIME(
"EBAMRData<T>::EBAMRData(int)");
34 m_data.resize(a_size);
40 CH_TIME(
"EBAMRData<T>::~EBAMRData()");
44 RefCountedPtr<LevelData<T>>&
47 return m_data[a_level];
51 const RefCountedPtr<LevelData<T>>&
54 return m_data[a_level];
61 m_data.resize(a_size);
75 for (
int lvl = 0; lvl < m_data.size(); lvl++) {
76 m_data[lvl] = RefCountedPtr<LevelData<T>>(0);
103 template <
typename T>
107 for (
int lvl = 0; lvl < m_data.size(); lvl++) {
108 m_data[lvl]->exchange();
112 template <
typename T>
113 Vector<RefCountedPtr<LevelData<T>>>&
119 template <
typename T>
120 const Vector<RefCountedPtr<LevelData<T>>>&
126 template <
typename T>
130 m_data.push_back(a_levelData);
133 template <
typename T>
140 template <
typename T>
171 #include <CD_NamespaceFooter.H>
Class for holding data across EBAMR hierarchies.
Default class for holding LevelData<T> data across an EBAMR realm.
Definition: CD_EBAMRData.H:40
EBAMRData() noexcept
Default constructor. Does nothing.
Definition: CD_EBAMRDataImplem.H:23
void reserve() noexcept
Reserve data.
Definition: CD_EBAMRDataImplem.H:84
void setRealm(const std::string a_realm) noexcept
Sets the realm for this object.
Definition: CD_EBAMRDataImplem.H:142
void push_back(RefCountedPtr< LevelData< T >> &a_levelData) noexcept
Push a LevelData<T> object to the back of the data vector.
Definition: CD_EBAMRDataImplem.H:128
Vector< RefCountedPtr< LevelData< T > > > & getData() noexcept
Get underlying data. Returns m_data.
Definition: CD_EBAMRDataImplem.H:114
void exchange() noexcept
Exchange on all AMR levels.
Definition: CD_EBAMRDataImplem.H:105
void resize(const int a_size) noexcept
Resize m_data to having size a_size.
Definition: CD_EBAMRDataImplem.H:59
virtual ~EBAMRData() noexcept
Destructor. Does nothing.
Definition: CD_EBAMRDataImplem.H:38
int size() const noexcept
Get size of m_data.
Definition: CD_EBAMRDataImplem.H:66
bool isReserved() const noexcept
Check if data is reserved.
Definition: CD_EBAMRDataImplem.H:98
void clear() noexcept
Delete all data.
Definition: CD_EBAMRDataImplem.H:73
void release() noexcept
Release data.
Definition: CD_EBAMRDataImplem.H:91
const std::string getRealm() const noexcept
Returns the string identifier for whatever realm this data is supposed to be allocated over.
Definition: CD_EBAMRDataImplem.H:135
RefCountedPtr< LevelData< T > > & operator[](int a_level) noexcept
Indexing operators. Returns m_data[a_level].
Definition: CD_EBAMRDataImplem.H:45