-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathstateContainer.hpp
More file actions
40 lines (32 loc) · 1.45 KB
/
stateContainer.hpp
File metadata and controls
40 lines (32 loc) · 1.45 KB
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
// ***********************************************************************************
// Idefix MHD astrophysical code
// Copyright(C) Geoffroy R. J. Lesur <[email protected]>
// and other code contributors
// Licensed under CeCILL 2.1 License, see COPYING for more information
// ***********************************************************************************
#ifndef DATABLOCK_STATECONTAINER_HPP_
#define DATABLOCK_STATECONTAINER_HPP_
#include <vector>
#include <string>
#include "idefix.hpp"
class State{
public:
enum TypeLocation{undefined, center, face, edge};
enum TypeState{none, idefixArray4D};
TypeState type{none}; ///< type of data contained by this state
IdefixArray4D<real> array; ///< only defined if type==IdefixArray4D
TypeLocation location{undefined}; ///< location of array when type==IdefixArray4D
///< (otherwise undefined)
std::string name; ///< Name of the full state (always applicable)
};
class StateContainer {
public:
StateContainer();
void CopyFrom(StateContainer &); // Return a deepcopy of the current state container
void AllocateAs(StateContainer &); // Return a deepcopy of the current state container
void PushArray(IdefixArray4D<real> &, State::TypeLocation, std::string);
void AddAndStore(const real, const real, StateContainer&);
private:
std::vector<State> stateVector;
};
#endif // DATABLOCK_STATECONTAINER_HPP_