Changeset 2901

Show
Ignore:
Timestamp:
07/14/10 15:12:20 (19 months ago)
Author:
pkwi
Message:

The use of assert causes problems in some installations - and should be used for debugging purposes only.

Location:
branches/mcstas-1.x/lib/optics
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • branches/mcstas-1.x/lib/optics/Monochromator_pol.comp

    r1641 r2901  
    8787DECLARE 
    8888%{ 
    89 #include <assert.h> 
     89/*#include <assert.h> - debugging only */ 
    9090 
    9191  double mos_rms; /* root-mean-square of mosaic, in radians */ 
     
    177177        printf("S_out: (%f, %f, %f)\n", sx, sy, sz); 
    178178       
    179       assert(sx*sx+sy*sy+sz*sz <= 1); 
     179      /* assert(sx*sx+sy*sy+sz*sz <= 1); */ 
    180180       
    181181      SCATTER; 
  • branches/mcstas-1.x/lib/optics/Pol_bender.comp

    r1669 r2901  
    109109SHARE 
    110110%{ 
    111 #include <assert.h> 
     111/* #include <assert.h> - debugging use only */ 
    112112%include "pol-lib" 
    113113%include "ref-lib" 
     
    439439     
    440440    // check that refWeight is meaningfull 
    441     assert(weight>=0 && weight<=1);  
     441    /* assert(weight>=0 && weight<=1); */ 
    442442 
    443443    if(isPolarising) 
     
    463463  const double lengthOfGuide = sin(length/radius)*radius;  
    464464  const double slitWidth = xw/nslits;  
    465   assert(lengthOfGuide>0); 
     465  /* assert(lengthOfGuide>0); */ 
    466466  double R = 0; /* radius of arc */ 
    467467  int nSlitsMax = nslits; 
  • branches/mcstas-1.x/lib/optics/Pol_guide_vmirror.comp

    r1660 r2901  
    7777SHARE 
    7878%{ 
    79 #include <assert.h> 
     79/* #include <assert.h> - debugging use only */ 
    8080%include "pol-lib" 
    8181%include "ref-lib" 
     
    341341      rUpFunc(fabs(Q), rUpParPtr, &Rup); 
    342342      rDownFunc(fabs(Q), rDownParPtr, &Rdown); 
    343       assert(Rup>=0 && Rup<=1 && Rdown>=0 && Rdown<=1);  
     343      /* assert(Rup>=0 && Rup<=1 && Rdown>=0 && Rdown<=1); */ 
    344344 
    345345      GetMonoPolFNFM(Rup, Rdown, &FN, &FM); 
    346346      GetMonoPolRefProb(FN, FM, sy, &refWeight); 
    347       assert(refWeight>=0 && refWeight<=1); // check that refWeight is meaningfull 
     347      /* assert(refWeight>=0 && refWeight<=1); // check that refWeight is meaningfull */ 
    348348       
    349349      if (rand01()<refWeight) { 
     
    358358      } 
    359359 
    360       assert(sx*sx+sy*sy+sz*sz<=1); // check that polarisation is meaningfull 
     360      /* assert(sx*sx+sy*sy+sz*sz<=1); // check that polarisation is meaningfull */ 
    361361    } 
    362362 
  • branches/mcstas-1.x/lib/optics/Pol_mirror.comp

    r1657 r2901  
    8888SHARE 
    8989%{ 
    90 #include <assert.h> 
     90/* #include <assert.h> - debugging use only */ 
    9191  %include "pol-lib" 
    9292  %include "ref-lib" 
     
    148148    // calculate scattering vector magnitude 
    149149    Q = fabs(2*vx*V2K);  
    150     assert(Q>=0); 
     150    /* assert(Q>=0); */ 
    151151     
    152152    // calculate reflection probability 
     
    163163     
    164164    // check that refWeight is meaningfull 
    165     assert(refWeight>=0 && refWeight<=1);  
     165    /* assert(refWeight>=0 && refWeight<=1); */ 
    166166     
    167167    // find out if neutrons is reflected or transmitted 
     
    191191    }  
    192192 
    193     assert(reflect==0 || reflect==1); 
     193    /* assert(reflect==0 || reflect==1); */ 
    194194 
    195195    // set outgoing velocity and polarisation 
     
    207207    }  
    208208     
    209     if(isPolarising) 
     209    /*if(isPolarising) 
    210210      assert(sx*sx+sy*sy+sz*sz<=1); // check that polarisation is meaningfull 
    211      
     211    */ 
     212 
    212213    SCATTER; 
    213214  } /* End intersect the mirror */