#include "headers.h"
#include "Optimise.h"
//#define ARMA_USE_HDF5

using namespace std;
using namespace arma;



const double Taumax=1000; //reminiscent

const double overlap=0.25; //hardcoded for good reasons

char filename[]="Input/Interp.csv"; //table of material constants
char CPfname[]="Input/ControlPoints.mat";
char Techfname[]="Input/TechSettings.txt";
char Numfname[]="Input/NumSettings.txt";

int main(int argc, char** argv)
  {
  time_t start, end;
  time(&start);

  ControlPoints CP(CPfname);
  vec Techset;
  Techset.load(Techfname);
  vec Numset;
  Numset.load(Numfname);

  cube Result;
  HeatComp P(Numset(0), Numset(1), Numset(2)*datum::pi, Techset(0), Techset(1), Taumax, Techset(3),filename, Techset(4)/60.0, Techset(2),Numset(3),Techset(5));
  Result=P.Compute(Numset(4),'y');
  
  Optimise C(Techset(6)/60.0, P.T, overlap,filename,P.dr(0),P.dz(0),P.dphi,P.T_inf,P.dtau,CP);

  C.ComputePHA();
  //cout << C.Elem;


  time(&end);
	double dif = difftime(end, start);
	//printf("\n Real time computed: %.2f minutes \n",(double)P.p*dtau/60);
	printf("\n Elapsed time is %.2lf minutes.", dif/60);
  return 0;
  }

