#include "headers.h"

const double sigma=5.67e-008;
const double cmax=845.6;
const double rhomax=7835.75;
const double kmax=40.47;
const double htcmax=1000;

struct HeatComp
{
	arma::cube T;
	arma::mat ConstM;
	arma::mat CoolM;
	arma::mat ConstM0;

	double dphi, R, L, Taumax, T_in, vz, T_inf, dtau;
	arma::vec dr,dz,middle;
	int ndr,ndphi,ndz,p;

	double CrystallizerLength;
	double htc_k;
	double T_k;
	double TertiaryLength;

	HeatComp(double dr0, double dzo, double dphi, double R, double L, double Taumax, double T_in, char *, double vz, double T_inf,double pdtau,double htc);
	HeatComp(double dr0, double dzo, double dphi, arma::cube T, char *, double vz, double, double pdtau, double htc, double pTertiaryLength,double htcl, int n_z);
	~HeatComp(void);
	void erase(void);

	void SetConstM(char *filename);

	void SetDisc(double dr0, double dzo, double phi); //dphi vlastnost
	void SetDisc(double dr0, double dz0, double phi, arma::cube &);

	void SetSqR(double dr0 ,double pR);
	double getR(int i);
	void SetDtau(double);

	double getConstT(double &T, char);
	double getConstH(double &H, char);

	arma::cube TempToEn(arma::cube &);
	arma::cube EnToTemp(arma::cube &);
	
	void SetCoolM(double htc);
	void SetCoolM(double htc0, double htcl, int n_z);
	arma::cube Compute(int pmax, char swtch);
	arma::cube ComputeOpt(int ind, int pmax, arma::cube T_L);
};
