// Declaration of DesignPoint Class for SiC Blanket


#ifndef DESIGN_POINT_H
#define DESIGN_POINT_H

/* This is a class of objects that represent different ARIES designs. */

class DesignPoint
{

private:
// Number of Parts
   int num_parts;

// Plasma Parameters
   double plasma_params[10];

// X-point coordinates
   double x_point_radius;
   double x_point_height;

// TF Coil Data
   double tf_coil_inboard_radius;
   double tf_coil_outboard_radius;
   double tf_coil_max_magnetic_field;
   int number_of_tf_cable_turns;

// Generic Radial Builds
   double rad_gen_inb[100];
   double rad_gen_outb[100];
   double top_gen_bld[100];
   
// FPC volume
   double fpcvolume; // LCC added
	
// Reactor Building Volume
   double vol_reactor_bldg;

// Primary Structure and Support Volume
   double vol_str;

// Neutron wall load
   double ave_neutron_wall_load;
   double max_neutron_wall_load;

// Maximum Heat Flux on Divertor
   double max_heat_flux_div_outboard;
   double max_heat_flux_div_inboard;

// Heat Flux at the First Wall
   double ave_heat_flux_fw;
   double max_heat_flux_fw;

// Plasma edge safety factor
   double q95;

// Plasma current
   double plsm_current;

// Plasma poloidal beta
   double plsm_poloidal_beta;

// Vector of flags for the data point: 0 - accept, greater than 0 - reject.
   int data_flag[20];

// Current Drive Data
    double NB_efficiency;
    double NB_unit_cost;
    double cd_neutral_beam_total_cost;
   
    double LH_efficiency;
    double LH_unit_cost;
    double cd_lower_hybrid_total_cost;
   
    double FW_frequency;
    double FW_efficiency;
    double FW_unit_cost;
    double cd_fast_wave_total_cost;
    double cd_total_cost;

// Powers
    double power_gross_electrical;
    double power_net_electrical;
    double power_thermal;
    double power_fusion;
    double power_blanket;

   
public:
   void get_parts(int np);
   void get_plasma(double params[7]);
   void get_xpoint(double x, double y);
   void get_tf_coil_radii(double r1, double r2);
   void get_maximum_magnetic_field_at_tf_coil(double field);
   void get_number_of_tf_cable_turns(int turns);
   void get_builds(double inbg[26], double outbg[28], double vertg[22]);
   void get_reactor_building_volume(Part *Core);
   void get_support_structure_volume();
     					   
   void get_power_flow(
		Part * FirstWallInb, 		Part * FirstWallOutb,		Part (*Div)[6],
		Part * Plasma,				double (*inputdata)[100],	int npt, 		
		Part * BlanketInboard,		Part * BlanketOutboard,		Part * BlanketII,
		Part (*RepHTShield)[2],		Part (*HTShield)[2],		Part (*VacuumVessel)[4],
		Part * TFCoil,				Part (*PoloFCoil)[36],		Part * Plasma_AT_w_SOL,
		Part * Plasma_DCLL,			Part * BackWallInboard,		Part * BackWallOutboard,	
		Part * SkeletonRing,		Part (*VacuumVesselDCLL)[4],Part * HTShieldDCLL,
		Part * Manifold,			Part (*Manifolding)[2]);
     	// added for DCLL: Plasma_DCLL on	
     	
   double brayton(double nwl, double q, string blanketmode);
   double pumping_power_fraction(double nwl, double q);
   double pumping_power_divertor(double flux_divertor_Max);  // LCC added this separate fcn
   double pumping_power_blanket(double flux_heat_wall_Max);  // LCC added this separate fcn
   void get_gross_electrical_power(double power);
   void get_net_electrical_power(double power);
   void get_thermal_power(double power);
   void get_P_pump_blanket(double power);
   void get_fpc_vol(double volume_fpc); // LCC added
   void get_fusion_power(double power);
   void get_physics(double nwl, double qmhd, double aip, double betap);
   void get_neutron_wall_loads(double average, double maximum);
   void get_divertor_loads(double inboard, double outboard);
   void get_fw_heat_fluxes(double average, double maximum);
   void get_data_point_filter(int dpf, int loc);

   void show(Part * Plasma, 			Part * Separatrix, 			Part * FWInboard,
             Part * FWOutboard, 		Part * BlanketInboard,		Part * BlanketOutboard,
             Part * BlanketII, 			Part (*Divertor)[6],		Part (*RepHTShield)[2],
             Part (*HTShield)[2],		Part (*VVessel)[4],			Part * TFC,
             Part * Window, 			Part * BCyl,				Part * UpperCap,
             Part * LowerCap, 			Part (*PoloFC)[36], 		Part * Cryo, 
             Part * MPort, 				Part (*Duct)[3], 			Part * Plasma_AT_w_SOL,
             double (*Outputs)[100],	Part * Plasma,				Part * SkeletonRing,
             Part * BackWallInboard,	Part * BackWallOutboard,	Part (*VacuumVesselDCLL)[4],
             Part * HTShieldDCLL,		Part * Manifold,			Part (*Manifolding)[2]);		
             // added for DCLL: Plasma_DCLL on...
			
/*			 Part * SkeletonRing,		Part * Plasma_DCLL,		Part * BackWallInboard,
			 Part * BackWallOutboard,	Part * SkeletonRing,	Part (*VacuumVesselDCLL)[4],
             Part * HTShieldDCLL)
*/
// Extract Plasma Parameters
   double plasma_major_radius();
   double plasma_minor_radius();
   double plasma_elongation();
   double plasma_triangularity();
   double plasma_outer_squareness();
   double plasma_inner_squareness();
   double plasma_SOL(); // added to calc surface area w/ SOL
   
// Extract the X-point of the last closed magnetic surface:
    double xpoint(int coordinate);
    
// TF magnet inner radius of the inner leg and outer radius of the outer leg:
    double tf_magnet_inner_leg_radius();
    double tf_magnet_outer_leg_radius();
    double tf_magnet_max_field(); 
    int    tf_magnet_cable_turns();

// Extract the Inboard Radial Build;
   double inboard_generic_build(int pick);

// Extract the Outboard Radial Build:
   double outboard_generic_build(int pick);

// Extract the Vertical Build:
   double vertical_generic_build(int pick);
   
// Return the neutron wall load
   double neutron_wall_load(string nwl_id);
   
// Return the inboard and outboard maximum heat flux on divertor
   double maximum_heat_flux_on_divertor(string location);
   
// Return the heat flux at the first wall:
   double fw_heat_flux(string flux_id);
   
// Return the plasma edge safety factor
   double plasma_edge_safety_factor();
   
// Return the plasma current
   double plasma_current();
   
// Return the plasma poloidal beta
   double plasma_poloidal_beta();
   
// Return the data point filter
   double data_point_filter(int loc);

// Return FPC_vol
   double fpc_vol(); // LCC added 
   
// Reactor building volume
   double reactor_building_volume();
   double support_structure_volume();
  
  
// Powers
   double gross_electrical_power();
   double net_electrical_power();
   double thermal_power();
   double fusion_power();
   double P_pump_blanket();

// Current Drive
   void   get_cd_cost();
   //void   get_cd_cost(double Pow_NB, double Pow_LH, double Pow_FW, double freq_FW);  //now in input file
   double cd_cost();
   double cd_neutral_beam_cost();
   double cd_lower_hybrid_cost();
   double cd_fast_wave_cost();
   
   ~DesignPoint()
   { }
};

#endif

