#ifndef DATA_H
#define DATA_H

#include "DataLayout.h"
#include "Definitions.h"

namespace NuSiF {

/**
 * \brief Class definition of the data class.
 * The data class offers get and set methods for all data field. Furthermore
 * the values and the array-indices of each field can be checked.
 */
class Data : private NonCopyable {
	public:

		typedef DataLayout<Real, 1> Pressure;
		typedef DataLayout<Real, 2> Velocity;
		typedef DataLayout<Real, 1> RHS;

		// constructors
		inline Data();
		explicit inline Data(Uint xsize, Uint ysize);

		// setup functions
		inline void Create(Uint xsize, Uint ysize);
		inline void Destroy();

		// get functions
		inline Uint XSize() const;
		inline Uint YSize() const;

		inline Pressure& GetPresLayout();
		inline Velocity& GetVelLayout();
		inline RHS&      GetRHSLayout();
		inline const Pressure& GetPresLayout() const;
		inline const Velocity& GetVelLayout() const;
		inline const RHS&      GetRHSLayout() const;

		inline const Real& GetU(Uint x, Uint y) const;
		inline const Real& GetV(Uint x, Uint y) const;
		inline const Real& GetP(Uint x, Uint y) const;
		inline const Real& GetRHS(Uint x, Uint y) const;

		// output functions
		inline void PrintPresField() const;
		inline void PrintVelField() const;
		inline void PrintRHSField() const;

		// set functions
		inline void SetP(Uint x, Uint y, const Real& val);
		inline void SetU(Uint x, Uint y, const Real& val);
		inline void SetV(Uint x, Uint y, const Real& val);
		inline void SetRHS(Uint x, Uint y, const Real& val);

	private:

		// attributes
		Pressure pres_;
		Velocity vel_;
		RHS rhs_;
};

} // namspace NuSiF

#endif
