







new cooling :
----------

--- tester le cooling avec M=4, on devrait avoir Tcool << Tdyn		 faire


- ajouter implicit cooling integration 		ok
  
  + tester					ok, semble bien


- verifier ComovingIntegrationOn		 tester

- tester sur cluster				 faire

- tester sur boite cosmo			 faire



on peut enlever :

DtEgySpecRadSph
DtEntropyRadSph



new sfr :
----------


- cre des toiles de plus petite masse, et donc, garder la part. de gaz.	ok

- utiliser tous les critres, jeans aussi...					 faire

- tester un model statique --> loi exp dcroissante 				ok

- transformer toute la particule lorsque elle est trops petite			ok

- ecrire les output de StP							ok

- prendre en compte l'nergie des toiles...					ok

- conservation de l'nergie 							ok
  
  1 proc, StarFormationNStarsFromGas = 1	snap00
  4 proc, StarFormationNStarsFromGas = 1        snap01  mini diff.
  		
  1 proc, StarFormationNStarsFromGas = 4	snap02	sfr correcte, mais
                                                        !!! il y a des oscillations...

  1 proc, StarFormationNStarsFromGas = 4	snap03	ok, on corrige avec TreeDomainUpdateFrequency = 0
  4 proc, StarFormationNStarsFromGas = 4	  
  

- permettre : TreeDomainUpdateFrequency > 0					 faire



domain :
----------
	
  - forcer les particules stellaire a etre arranges dans le block 1		ok	



    domain.c									 faire	(difficile)
      maxloadsph  -> maxloadstars
    
    pour PEANOHILBERT : trier les particules star				 faire
    peano.c									 faire
  
    domain_sumCost -> add local_DomainCountSt					 faire	(difficile ?)




  - modifier StP								ok
  

    All.TotN_stars								ok

    All.MaxPartStars = All.StarFormationNStarsFromGas*All.MaxPartSph 		ok
                     + All.PartAllocFactor * (All.TotN_stars / NTask)


    allocate.c									ok
    			All.MaxPartStars
    restart.c									ok
    

    init.c									ok

    domain.c									ok	
    starformation.c								ok

    rearrange_particle_sequence							ok

    io.c
    read_ic.c									ok
    										ok
    


    - vrifier les output							ok
       
       int flag_sfr
       int flag_feedback
       int flag_cooling
       int flag_stellarage
       int flag_metals
       
       typelist[6]								ok
         --> 0 si aucune particule de ce type est prsente dans le block
       
       get_particles_in_block							ok		
       
       
       
    - vrifier les input							ok
    
      - partir avec un fichier qui contiend dj des toiles
	--> conditions initiales (lit qu'une partie...)				ok
	--> redmarrage 	
	
      - partir avec un fichier qui contiend dj la mtalicit du gaz
        
	--> conditions initiales
	--> redmarrage
        
       
       - tester All.TotN_stars							ok
       - N_stars								ok


    








chimie :
----------
  

- pour une part. d'toile, trouver les plus proches particules de gaz		ok


   - il faut calculer hsml/density (gaz) pour les toiles...			ok
   
   - dans do_chimie, commencer la boucle par la premire toile 		ok
     et non particule
   
   - verifier le bon nombre de voisins pour les toiles				ok   
    
    
   
      
    stars_density.c								ok
    chimie.c									ok
    
     
    tests	: 
    		
	- vrifier la densit	(crire)					ok
	- vrifier hsml 	(crire)					ok
	
	  -> on crit dans le fichier de sortie Density,Hsml			ok
	


	- vrifier les plus proches voisins 					ok
	  --> dans chimie,
	      -> vrifier : Sum m/rho wij = 1, par example...			ok



- initialisation
  
  utiliser get_nelts pour avoir NELEMENTS, ou alors, check....			 faire


     
     
     
- pour une particule stellaire, calculer 					 faire
   
   - la masse totale ejecte							ok
   - les mtaux jects								ok
   - l'nergie jecte								ok
   
   
- injecter la masse au plus proches voisins					ok			
- enlever mass et elt eject par une toile					ok
   
   !!! conservation de l'nergie kin,pot, int
   !!! conservation de l'impulsion...
   !!! conservation de la masse							ok
       ok, a 1%pres... a vrifier par la suite...
       dans des conditions moins difficiles...

												<-------- Wed Jul 22 15:09:25 CEST 2009

- mieux conserver l'nergie lors de feedback thermqie (rendre part. active ?)	 faire !!! (ou feedback cintique...)

- faire un fichier statistique qui comptes ce qui est cre...			 faire

- injecter l'nergie thermique 			  				ok

- injecter l'nergie cinetique							 faire

- utiliser la metallicit pour le cooling					ok
   





   


- utiliser TreeDomainUpdateFrequency  !=   0.0					 faire


- vrifier dans chimie.c -> utilisation de vel ou velpred...


- unifier 									 faire


SolarAbun_Fe  = 0.001771 			pNbody
SolarAbun_Mg  = 0.00091245			pNbody

#define  FEH_SOLAR         0.001771		Gadget 	/*  0.00181 */
#define  MGH_SOLAR         0.00091245		Gadget

FeHSolar = 0.00181				Gadget cooling !!!





- vrifier restart	-> particulirement les parametres 			 faire
  ??? All.ChimieSupernovaEnergy = all.ChimieSupernovaEnergy



- revoir sticky (faire attention au leap frog, par ex.)				 faire
- cooling : on peut completement sortie docooling de timestep, non ?



!! initialisation correcte de : StarEnergyInt,StarEnergyRadSph,			 faire
                                StarEnergyRadSticky...
                                --> aussi lors d'un restart !!!
				
				--> should be in All.












--------------------------------------------------------------------------------
CPU
--------------------------------------------------------------------------------

timediff(t0, t1) = t1-t0

All.CPU_Total, 
			run.c : on somme les diff de la boucle principale

All.CPU_Gravity, 
			accel.c : 
				gravity_tree()

All.CPU_Hydro, 
			accel.c : 
				density()
				hydro_force();
			  

All.CPU_Domain, 
			domain.c : 
				domain_Decomposition() sans peano_hilbert_order


All.CPU_Potential,	potential.c : 
				compute_potential()
		
All.CPU_Predict, 	accel.c :
				force_update_hmax();			???
			predic.c :
				move_particles()
			run.c :
				find_next_sync_point_and_drift()

All.CPU_TimeLine, 	timestep.c :
				advance_and_find_timesteps()

All.CPU_Snapshot, 	io.c
				savepositions()


All.CPU_TreeConstruction	potential.c
				force_treebuild()		
			gravtree.c
				force_treebuild()
			
All.CPU_TreeWalk, 	gravtree.c						!!!
All.CPU_CommSum, 	gravtree.c
All.CPU_Imbalance, 	gravtree.c
      			All.CPU_TreeWalk += sumt / NTask;
      			All.CPU_Imbalance += sumimbalance / NTask;
      			All.CPU_CommSum += sumcomm / NTask;


All.CPU_HydCompWalk,	chimie.c density.c hydra.c stars_density.c		!!!
All.CPU_HydCommSumm,	chimie.c density.c hydra.c stars_density.c
All.CPU_HydImbalance, 	chimie.c density.c hydra.c stars_density.c
				All.CPU_HydImbalance += sumimbalance / NTask;
				All.CPU_HydCommSumm += sumcomm / NTask;
				All.CPU_HydCompWalk += sumt / NTask;

All.CPU_EnsureNgb, 	density.c						!!!
				All.CPU_EnsureNgb += sumtimengb / NTask;
			
			stars_density.c
				All.CPU_EnsureNgb += sumtimengb / NTask;


All.CPU_PM, 		accel.c
				long_range_force()

All.CPU_Peano
			domain.c : peano_hilbert_order()			


on pourait rajouter :
-------------------

All.CPU_Accel

if faut rajouter :

All.CPU_Chimie
All.CPU_StarFormation










--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


- sticky bournaud
  
   - faire des tests
   - choix du sticky --> pour cluster, mieux dans rayon sph...    
   
- viter que la densit soit calcule ??? vraiment utiles ?


- conservation de l'nergie pour sticky




----------------------------------------

- improve multiphase computation : only with MULTIPHASE switched on


  - test sticky only 
    
     * for each particle, find one particle to collide with 
     * try to do that in the same function than the main hydra (???)
      
      
      
      
      
      
      
      
      
      
  - test sph    only

  - test dark gas
  
  - test combination of all
  
  
  
  check


  * indep. of number of proc
  
  
  
 



  











##########################################3
MULTIPHASE
##########################################

  - part of particles behave differently (sticky)


GAS_SPH			-> normal sph
GAS_STICKY		-> sticky
GAS_DARK		-> no (weak) interaction





functions

multi_hydro_evaluate
sticky_evaluate
ngb_treefind_phase_pairs


io.c		ok
init.c		ok
read_ic.c	ok

run.c		ok


density.c	ok	(rien de particulier)
ngb.c
	ngb_treefind_pairs			hydra.c
						every body sees every body
	
	
	ngb_treefind_variable			density.c
	   					find density and hsml		!!!! hsml is then needed to find colliding particules
										!!!! but may be problematic if only sph part. are present in hsml !!!
	

        ngb_treefind_phase_pairs		bondi_accretion.c

	
hydra.c				!!!!!!!!!!!!
	multi_hydro_evaluate(i, 0);
	hydro_evaluate(i, 0);      
        sticky_evaluate(i, 0);






timestep.c
global.c

cooling.c
starformation.c
bubbles.c







##########################################
PHASE_MIXING
##########################################

proto.h
  phase_mixing

run.c
phase.c







##########################################
COLDGAS_CYCLE		(need MULTIPHASE)
##########################################

   - compute cycling or not


   ---------------------------------------
   
   COLDGAS_CYCLE :parameters
   -------------------------
   
   ColdGasCycleTransitionTime;
   ColdGasCycleTransitionParameter;
   
   allvars.h	ok
   begrun.c	ok
   phase.c	ok
   
  
##########################################  
EXTERNAL_FLUX	: really only external flux
##########################################
  
   begrun.c
   cooling.c
   phase.c
   allvars.h
  
  
   HeatingPeSolarEnergyDensity
   HeatingExternalFLuxEnergyDensity
   
##########################################
STELLAR_FLUX	: only stellar flux
##########################################

   allvars.h
   init.c
   gravtree.c
   forcetree.c
   begrun.c
  
   HeatingPeSolarEnergyDensity;
   HeatingPeLMRatioGas; 
   HeatingPeLMRatioHalo; 
   HeatingPeLMRatioDisk; 
   HeatingPeLMRatioBulge;
   HeatingPeLMRatioStars;
   HeatingPeLMRatioBndry;
   HeatingPeLMRatio[6];

  
  
  

####################################################
# sticky_evaluate(i, 0)
####################################################
 


1) check who can inteact with who ?


     - loop over active particles
     - ngb_treefind_pairs				! find all particles in h_i	 ... check !!!
                                          		here we could use different fct, depending on the type
					  
     - if(P[j].Ti_endstep == All.Ti_Current) 		only active particles		! ensure symetry, 
                                          		really necessary ??? 
     
     - if(SphP[j].Phase == GAS_STICKY)			ok, but may be done with   "ngb_treefind_pairs"
     
     
     - if(SphP[j].StickyFlag)				SphP[i].StickyFlag = 1;		in init.c
                                                        SphP[i].StickyFlag 		is determined in phase.c





2) what is modified by sticky_evaluate


     P[target].Vel[k]					     <------ here, we change the velocity !!!!!!!
     P[j].Vel[k]     

     	     

     SphP[target].EgySpecRadSticky			     <------ here, we count the energy !!!!!!!
     SphP[j].EgySpecRadSticky

       
     SphP[target].StickyCollisionNumber++; 
     SphP[j].StickyCollisionNumber++;
       
     SphP[target].HydroAccel[k] = 0;
       
     SphP[target].StickyFlag = 0;
     SphP[target].DtEntropy = 0;		 /* force dt entropy to zero */
       
       
     SphP[j].DtEgySpecFeedback = 0;		 /* should not be there */ 
     
     
     
     !!!! we change the velocity and count energy further
     
     
     
     
     
     



tests:

  - only sticky : be sure that particles interact symetrically...


  
  
  
  


####################################################
# problemes
####################################################
  

(!!) si Entropy < 0, le gaz est considr  GAS_DARK (output)
     -> bien vrifier...

  
(!!) si une particule oscille frequemment entre dark et visible, elle risque 
     de colisonner trops souvent... StickyFlag=1 automatique lors du retour au sticky

     
     
     
     
     
     
     
     
     
     
     

  
  
  
  









