Changeset 3088 for branches

Show
Ignore:
Timestamp:
06/03/11 17:45:51 (12 months ago)
Author:
pkwi
Message:

Fix of bugs related to change of type of ncount...

Location:
branches/mcstas-1.x
Files:
14 modified

Legend:

Unmodified
Added
Removed
  • branches/mcstas-1.x/CHANGES

    r3086 r3088  
    3030* Modified by: PW, EF, EK April 2nd 2009: version 1.12a 
    3131* Modified by: PW, EF, EK June/July 2010: version 1.12b 
    32 * Modified by: PW May 2011: version 1.12c 
     32* Modified by: PW May-June 2011: version 1.12c (re-release) 
    3333* 
    34 * This file is part of McStas  version 1.12c, released May 24th, 2011. 
     34* This file is part of McStas  version 1.12c, released June 3rd, 2011. 
    3535* It gives a 'changes' list from the beginning of the project 
    3636* 
    3737*******************************************************************************/ 
    38 Changes in McStas v1.12c, May 24rd, 2011 
     38Changes in McStas v1.12c, June 3rd, 2011 
    3939 
    4040 McStas 1.12c is bugfix release. 
     
    4545  - Fix of a bug in the rectangular focusing routine, reported to mcstas-users by Markos Skoulatos, HZB 
    4646    (see http://mailman.mcstas.org/pipermail/mcstas-users/2010q4/000845.html) 
    47   - Introduction of --ncount as unsigned long long int in place of double. Could potentially lead simulations to "hang" 
     47  - Introduction of --ncount as unsigned long long int in place of double. Using double could potentially lead  
     48    simulations to "hang". A re-release of McStas 1.12c was done due to bugs in components related to the new 
     49    type returned from mcget_ncount. 
    4850 
    4951  Tools 
  • branches/mcstas-1.x/lib/contrib/ISIS_moderator.comp

    r2699 r3088  
    878878  } 
    879879   
    880   Nsim=mcget_ncount(); 
     880  Nsim=(double)mcget_ncount(); 
    881881  Bcnt=0; 
    882882  // CH4 face 1 (north) 
  • branches/mcstas-1.x/lib/contrib/Source_multi_surfaces.comp

    r1734 r3088  
    287287 
    288288  /*generate p_in*/ 
    289   p_in = 1/mcget_ncount(); 
     289  p_in = 1.0/mcget_ncount(); 
    290290   
    291291%} 
  • branches/mcstas-1.x/lib/contrib/Virtual_mcnp_input.comp

    r2171 r3088  
    370370               n_count_extrapolated); 
    371371        if (n_count_extrapolated > mcget_ncount()) 
    372           printf("    (will use only %.3g %% of file)\n", 100*mcget_ncount()/n_count_extrapolated); 
     372          printf("    (will use only %.3g %% of file)\n", 100.0*mcget_ncount()/n_count_extrapolated); 
    373373        else 
    374374          printf("    (limiting simulation to %g neutrons)\n", n_count_extrapolated*repeat_count); 
     
    527527    if (verbose) { 
    528528      printf("MCNP_input: %s: \n", NAME_CURRENT_COMP); 
    529       printf("                %g neutrons generated\n", mcget_ncount()); 
     529      printf("                %g neutrons generated\n", (double)mcget_ncount()); 
    530530    } 
    531531  } 
  • branches/mcstas-1.x/lib/contrib/Virtual_tripoli4_input.comp

    r2171 r3088  
    387387               n_count_extrapolated, (long)nbatch_extrapolated, nsize); 
    388388        if (n_count_extrapolated > mcget_ncount()) 
    389           printf("    (will use only %.3g %% of file)\n", 100*mcget_ncount()/n_count_extrapolated); 
     389          printf("    (will use only %.3g %% of file)\n", 100.0*mcget_ncount()/n_count_extrapolated); 
    390390        else 
    391391          printf("    (limiting simulation to %g neutrons)\n", n_count_extrapolated*repeat_count); 
     
    582582    if (verbose) { 
    583583      printf("Tripoli4_input: %s: \n", NAME_CURRENT_COMP); 
    584       printf("                %g neutrons generated\n", mcget_ncount()); 
     584      printf("                %g neutrons generated\n", (double)mcget_ncount()); 
    585585      printf("                %d read batch (B) of intial %d neutrons (N)\n",nbatch, nsize); 
    586586      if (nbatch && nsize && intensity && !intensity_extrapolated) 
  • branches/mcstas-1.x/lib/contrib/Virtual_tripoli4_output.comp

    r2230 r3088  
    117117  fprintf(hfile,"TAILLE     Unknown\n"); 
    118118  fprintf(hfile,"PARTICULE  NEUTRON\n"); 
    119   fprintf(hfile,"INTENSITE  %g\n",mcget_ncount()); 
     119  fprintf(hfile,"INTENSITE  %g\n",(double)mcget_ncount()); 
    120120  fprintf(hfile,"SIMULATION PROTECTION\n"); 
    121121  fprintf(hfile,"Following lines are: type, energy in MeV, position = (x,y,z) in cm, direction = (u,v,w), statistical weight\n"); 
  • branches/mcstas-1.x/lib/misc/Progress_bar.comp

    r2822 r3088  
    8080    if (difftime(NowTime,StartTime) > 10) { /* wait 10 sec before writing ETA */ 
    8181      EndTime = StartTime + (time_t)(difftime(NowTime,StartTime) 
    82                            *mcget_ncount()/ncount); 
     82                                     *(double)mcget_ncount()/ncount); 
    8383      IntermediateCnts = 0; 
    8484      fprintf(stdout, "\nTrace ETA "); 
     
    9797      || (percent && !minutes && ncount >= IntermediateCnts))   ) 
    9898  { 
    99     fprintf(stdout, "%d ", (int)(ncount*100/mcget_ncount())); fflush(stdout); 
     99    fprintf(stdout, "%d ", (int)(ncount*100.0/mcget_ncount())); fflush(stdout); 
    100100    CurrentTime = NowTime; 
    101101    IntermediateCnts = ncount + percent*mcget_ncount()/100; 
  • branches/mcstas-1.x/lib/share/monitor_nd-lib.c

    r3066 r3088  
    799799    if (mc_mn_Vars->Intermediate < 0) mc_mn_Vars->Intermediate = 0; 
    800800    if (mc_mn_Vars->Intermediate > 1) mc_mn_Vars->Intermediate /= 100; 
    801     mc_mn_Vars->IntermediateCnts = mc_mn_Vars->Intermediate*mcget_ncount(); 
     801    mc_mn_Vars->IntermediateCnts = mc_mn_Vars->Intermediate*(double)mcget_ncount(); 
    802802 
    803803    if (mc_mn_Vars->Flag_Verbose) 
     
    11191119    double  mc_mn_ratio; 
    11201120 
    1121     mc_mn_ratio = 100*mcget_run_num()/mcget_ncount(); 
     1121    mc_mn_ratio = 100.0*mcget_run_num()/mcget_ncount(); 
    11221122    if (mc_mn_Vars->Flag_per_cm2 && mc_mn_Vars->area && mc_mn_Vars->Flag_Verbose) 
    11231123      printf("Monitor_nD: %s: detector area is %g [cm2]\n", 
  • branches/mcstas-1.x/lib/sources/ESS_moderator_long.comp

    r2899 r3088  
    139139  w_mult = size*size*1.0e4;     /* source area correction */ 
    140140  w_mult *= l_range;            /* wavelength range correction */ 
    141   w_mult *= 1/mcget_ncount();   /* Correct for number of rays */ 
     141  w_mult *= 1.0/mcget_ncount();   /* Correct for number of rays */ 
    142142  w_mult *= 50.0/3.0;           /* Correct for baseline frequency setting */ 
    143143%} 
  • branches/mcstas-1.x/lib/sources/ESS_moderator_short.comp

    r2168 r3088  
    130130  w_mult = size*size*1.0e4;     /* source area correction */ 
    131131  w_mult *= l_range;            /* wavelength range correction */ 
    132   w_mult *= 1/mcget_ncount();  /* Flux value */ 
     132  w_mult *= 1.0/mcget_ncount();  /* Flux value */ 
    133133%} 
    134134 
  • branches/mcstas-1.x/lib/sources/Monitor_Optimizer.comp

    r1309 r3088  
    107107    && (Vars->Phase == DEFS->PHASE_GET_REF)) 
    108108      { 
    109       if (((Vars->Reference_Counts > mcget_ncount()*Vars->dstep) && (Vars->Monitor_Counts >= Vars->nbins*10)) 
    110       || (Vars->Monitor_Counts >= Vars->nbins*100) || (Vars->Reference_Counts > 2*mcget_ncount()*Vars->dstep)) 
     109        if (((Vars->Reference_Counts > (double)mcget_ncount()*Vars->dstep) && (Vars->Monitor_Counts >= Vars->nbins*10)) 
     110      || (Vars->Monitor_Counts >= Vars->nbins*100) || (Vars->Reference_Counts > 2.0*mcget_ncount()*Vars->dstep)) 
    111111      { 
    112112        Vars->Phase_Counts_R = 0;        /* enough counts on monitor */ 
  • branches/mcstas-1.x/lib/sources/Source_Maxwell_3.comp

    r2168 r3088  
    8686  w_mult = w_source*h_source*1.0e4;     /* source area correction */ 
    8787  w_mult *= l_range;            /* wavelength range correction */ 
    88   w_mult *= 1/mcget_ncount();   /* correct for # neutron rays */ 
     88  w_mult *= 1.0/mcget_ncount();   /* correct for # neutron rays */ 
    8989 
    9090  if (w_source <0 || h_source < 0 || l_low <= 0 || l_high <= 0 || dist <= 0 || T1 <= 0 || T2 <= 0|| T3 <= 0) { 
  • branches/mcstas-1.x/lib/sources/Source_Optimizer.comp

    r1562 r3088  
    540540    if (Vars.nbins*10 < Vars.Phase_Counts) Vars.Phase_Counts_L = Vars.nbins*100;        /* need at least 10 counts per bin for Limits */ 
    541541    else Vars.Phase_Counts_L = (long)(mcget_ncount() * Vars.dstep / 4); 
    542     Vars.Phase_Counts_R   = mcget_ncount(); 
    543     Vars.Phase_Counts     = mcget_ncount(); 
     542    Vars.Phase_Counts_R   = (double)mcget_ncount(); 
     543    Vars.Phase_Counts     = (double)mcget_ncount(); 
    544544    Vars.keep_target = Vars.dkeep; 
    545545    Vars.dkeep = 0.5; 
     
    14251425      printf("Source_Optimizer: Vars.Normal_Monitor_Counts = %i, Vars.Total_Monitor_Counts = %i \n",Vars.Normal_Monitor_Counts, Vars.Total_Monitor_Counts); 
    14261426      if (Vars.Normal_Monitor_Counts != 0) 
    1427          printf("Source_Optimizer: Optimizer speedup : %.3g \n", (double)(Vars.Total_Monitor_Counts/(Vars.Normal_Monitor_Counts*mcget_ncount()/Vars.Phase_Counts))); 
     1427        printf("Source_Optimizer: Optimizer speedup : %.3g \n", (double)(Vars.Total_Monitor_Counts/(Vars.Normal_Monitor_Counts*(double)mcget_ncount()/Vars.Phase_Counts))); 
    14281428      printf("Source_Optimizer: Number of redirections : %i\n",Vars.n_redirect); 
    14291429      printf("Counts : reference = %i, passing = %i, monitor = %.1f\n", Vars.Reference_Counts, Vars.Passing_Counts, Vars.Monitor_Counts); 
     
    14701470       fprintf(hfile,"# ylabel: 'Counts'\n"); 
    14711471       if (Vars.Normal_Monitor_Counts != 0) 
    1472                  fprintf(hfile,"# Optimizer speedup estimate: %.3g [Monitor Normal counts %i (extrapolated), Optimized %i ]\n", (double)(Vars.Total_Monitor_Counts/(Vars.Normal_Monitor_Counts*mcget_ncount()/Vars.Phase_Counts)),(long)ceil(Vars.Normal_Monitor_Counts*mcget_ncount()/Vars.Phase_Counts), Vars.Total_Monitor_Counts); 
     1472         fprintf(hfile,"# Optimizer speedup estimate: %.3g [Monitor Normal counts %i (extrapolated), Optimized %i ]\n", (double)(Vars.Total_Monitor_Counts/(Vars.Normal_Monitor_Counts*(double)mcget_ncount()/Vars.Phase_Counts)),(long)ceil(Vars.Normal_Monitor_Counts*(double)mcget_ncount()/Vars.Phase_Counts), Vars.Total_Monitor_Counts); 
    14731473 
    14741474       fprintf(hfile,"# Optimizer options: "); 
     
    14861486       fprintf(hfile,"\n"); 
    14871487 
    1488        fprintf(hfile,"# Redirected neutrons: %i (%.2f %%)\n",Vars.n_redirect,(double)(100*Vars.n_redirect/mcget_ncount())); 
     1488       fprintf(hfile,"# Redirected neutrons: %i (%.2f %%)\n",Vars.n_redirect,(double)(100.0*Vars.n_redirect/mcget_ncount())); 
    14891489       fprintf(hfile,"# data: Optimized Source (%.1f Counts, Flux %.4g)\n", Vars.Monitor_Counts, Vars.Monitor_Flux); 
    14901490       for (Vars.index = 0; Vars.index < Vars.nbins; Vars.index++) 
  • branches/mcstas-1.x/lib/sources/Virtual_input.comp

    r2077 r3088  
    312312  } else { 
    313313    double tmp; 
    314     tmp = mcget_ncount()/file_ncount; 
     314    tmp = (double)mcget_ncount()/file_ncount; 
    315315    if (fabs(rint(tmp)/tmp-1) > 0.02) 
    316316      printf("Warning: Virtual_input: %s: simulation finished in the middle of file '%s'\n" 
     
    318318             "               Intensities may be wrong.\n" 
    319319             "               Increase ncount value to %g or higher.\n", 
    320            NAME_CURRENT_COMP, file, mcget_ncount(), file_ncount, file_ncount*repeat_cnt); 
     320             NAME_CURRENT_COMP, file, (double)mcget_ncount(), file_ncount, file_ncount*repeat_cnt); 
    321321    if (mcget_ncount() < file_ncount*repeat_cnt) 
    322322      printf("Warning: Virtual_input: %s: not all source %s repetitions were generated.\n"