From bah at ansto.gov.au Mon Apr 2 02:23:02 2001 From: bah at ansto.gov.au (HUNTER, Brett) Date: Mon, 02 Apr 2001 10:23:02 +1000 Subject: Guide components Message-ID: <40BF49FB0D7DD311922000A0C966E30E75631B@pdnt53.anp.ansto.gov.au> Hi All, Has anyone had problems with the Guide.comp, when W=1/300, as per the manual? I found I had to set it to the real number 0.0033 to stop an error from occuring. I am using the Borland Compiler on a PC, so maybe the Unix compilers handle this correctly. Ciao Brett +----------------------------------------------------------------------------------+ Dr Brett Hunter Building 58, ANSTO,PMB 1, Menai, NSW 2234, Australia Work: -61-2-9717-3338 Fax: -61-2-9717-3606 email bah at ansto.gov.au Web sites: http://www.ansto.gov.au/ansto/neut/s_hun.html http://www.ansto.gov.au/ansto/neut/index.html http://www.rietica.org PGP Public key available. +-----------------------------------------------------------------------------------+ >-----Original Message----- >From: Ulrich C. Wildgruber MPI fuer Metallforschung Stuttgart >[mailto:wildgrub at dxray.mpi-stuttgart.mpg.de] >Sent: Wednesday, 21 March 2001 20:14 >To: neutron-mc at risoe.dk >Subject: Bender.comp ... > > >Hi everybody, > >a couple of days ago the word was sent out that an older version of the >Bender component produces wrong angular distributions. >I ran the older and newer version of Bender.comp in the same instrument >file under identical conditions (yes - I used the same seed! :-) >and got identical output from a divergence monitor located >downstream the >Bender component. The executable had a different size and I am >wondering >if certain parameters for the Bender have to be specified to >see a difference. >Could anybody shed more light on this issue... >I would also appreciate to receive example instrument files which I can >run to see the difference. > >Thanks a lot! > >Uli > >-- >Ulrich WILDGRUBER >wildgrub at dxray.mpi-stuttgart.mpg.de >wwwmf.mpi-stuttgart.mpg.de/abteilungen/dosch/dosch.html >--------------------------------------------------------------- >-------------- >Max-Planck-Institut f?r Metallforschung | Technische >Universit?t M?nchen >Heisenbergstr. 1 | ZBE Neue >Forschungs-Neutronenquelle > | Instrumentierung >D-70569 Stuttgart | D-85747 Garching/M?nchen >Tel.: (+49)-711-689-1900 | Tel.: (+49)-89-289-14681 >Fax.: (+49)-711-689-1902 | Fax.: (+49)-89-289-14666 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From per-olof.aastrand at risoe.dk Mon Apr 2 10:53:22 2001 From: per-olof.aastrand at risoe.dk (Per-Olof =?iso-8859-1?Q?=C5strand?=) Date: Mon, 02 Apr 2001 10:53:22 +0200 Subject: Guide components References: <40BF49FB0D7DD311922000A0C966E30E75631B@pdnt53.anp.ansto.gov.au> Message-ID: <3AC83E02.D91A42D8@risoe.dk> Hi, The problem may be that 1/300 is 0 if 1 and 300 are regarded as integers. 1.0/300.0 should give the correct answer. Best regards, Per-Olof "HUNTER, Brett" wrote: > > > Hi All, > Has anyone had problems with the Guide.comp, when W=1/300, as per > the manual? I found I had to set it to the real number 0.0033 to stop > an error from occuring. I am using the Borland Compiler on a PC, so > maybe the Unix compilers handle this correctly. > > Ciao > Brett > > > ----------------------------------------------------------------------------------+ > > Dr Brett Hunter > Building 58, ANSTO,PMB 1, Menai, > NSW 2234, Australia > Work: -61-2-9717-3338 > Fax: -61-2-9717-3606 > email bah at ansto.gov.au > Web sites: http://www.ansto.gov.au/ansto/neut/s_hun.html > http://www.ansto.gov.au/ansto/neut/index.html > http://www.rietica.org > PGP Public key available. > > -----------------------------------------------------------------------------------+ > > > -- Per-Olof ?strand Dept. of Chemistry, University of Copenhagen and Materials Research Department, Ris? National Laboratory per-olof.aastrand at theory.ki.ku.dk or per-olof.aastrand at risoe.dk http://www.ki.ku.dk and http://www.risoe.dk From farhi at ill.fr Mon Apr 2 10:58:45 2001 From: farhi at ill.fr (Emmanuel Farhi) Date: Mon, 02 Apr 2001 10:58:45 +0200 Subject: Guide components References: <40BF49FB0D7DD311922000A0C966E30E75631B@pdnt53.anp.ansto.gov.au> Message-ID: <3AC83F45.515CABB2@ill.fr> Hy Brett, this error occurs because the C compiler uses integers for 1 and 300 in '1/300'. To remove the error, use '1.0/300' or '(float)(1/300)'. Cheers. EF. "HUNTER, Brett" wrote: > > > Hi All, > Has anyone had problems with the Guide.comp, when W=1/300, as per > the manual? I found I had to set it to the real number 0.0033 to stop > an error from occuring. I am using the Borland Compiler on a PC, so > maybe the Unix compilers handle this correctly. > > Ciao > Brett > > > ----------------------------------------------------------------------------------+ > > Dr Brett Hunter > Building 58, ANSTO,PMB 1, Menai, > NSW 2234, Australia > Work: -61-2-9717-3338 > Fax: -61-2-9717-3606 > email bah at ansto.gov.au > Web sites: http://www.ansto.gov.au/ansto/neut/s_hun.html > http://www.ansto.gov.au/ansto/neut/index.html > http://www.rietica.org > PGP Public key available. > > -----------------------------------------------------------------------------------+ > > >-----Original Message----- > >From: Ulrich C. Wildgruber MPI fuer Metallforschung Stuttgart > >[mailto:wildgrub at dxray.mpi-stuttgart.mpg.de] > >Sent: Wednesday, 21 March 2001 20:14 > >To: neutron-mc at risoe.dk > >Subject: Bender.comp ... > > > > > >Hi everybody, > > > >a couple of days ago the word was sent out that an older version of > the > >Bender component produces wrong angular distributions. > >I ran the older and newer version of Bender.comp in the same > instrument > >file under identical conditions (yes - I used the same seed! :-) > >and got identical output from a divergence monitor located > >downstream the > >Bender component. The executable had a different size and I am > >wondering > >if certain parameters for the Bender have to be specified to > >see a difference. > >Could anybody shed more light on this issue... > >I would also appreciate to receive example instrument files which I > can > >run to see the difference. > > > >Thanks a lot! > > > >Uli > > > >-- > >Ulrich WILDGRUBER > >wildgrub at dxray.mpi-stuttgart.mpg.de > >wwwmf.mpi-stuttgart.mpg.de/abteilungen/dosch/dosch.html > >--------------------------------------------------------------- > >-------------- > >Max-Planck-Institut f?r Metallforschung | Technische > >Universit?t M?nchen > >Heisenbergstr. 1 | ZBE Neue > >Forschungs-Neutronenquelle > > | Instrumentierung > >D-70569 Stuttgart | D-85747 Garching/M?nchen > >Tel.: (+49)-711-689-1900 | Tel.: (+49)-89-289-14681 > >Fax.: (+49)-711-689-1902 | Fax.: (+49)-89-289-14666 > > -- What's up Doc ? -------------------------------------------- Emmanuel FARHI, http://www.ill.fr/tas/people/Farhi.html \|/ ____ \|/ CS-Group ILL4/156, Institut Laue-Langevin (ILL) Grenoble ~@-/ oO \-@~ 6 rue J. Horowitz, BP 156, 38042 Grenoble Cedex 9,France /_( \__/ )_\ Work :Tel (33/0) 4 76 20 71 35. Fax (33/0) 4 76 48 39 06 \__U_/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From per-olof.aastrand at risoe.dk Mon Apr 2 21:03:05 2001 From: per-olof.aastrand at risoe.dk (Per-Olof =?iso-8859-1?Q?=C5strand?=) Date: Mon, 02 Apr 2001 21:03:05 +0200 Subject: NeXus workshop/SCANS meeting Message-ID: <3AC8CCE9.D6B4FF1@risoe.dk> Dear McStas user, Some future developments of McStas were discussed at the NeXus workshop and SCANS meeting at PSI, March 20-23. They have been summarized at http://neutron.risoe.dk/mcstas/developments/developments.html and comments are welcome. Briefly, they include i) how to increase the reproducibility of simulations ii) stopping conditions in simulations iii) support for NeXus data format in McStas Best regards, Per-Olof ?strand -- Per-Olof ?strand Dept. of Chemistry, University of Copenhagen and Materials Research Department, Ris? National Laboratory per-olof.aastrand at theory.ki.ku.dk or per-olof.aastrand at risoe.dk http://www.ki.ku.dk and http://www.risoe.dk From per-olof.aastrand at risoe.dk Mon Apr 2 21:54:56 2001 From: per-olof.aastrand at risoe.dk (Per-Olof =?iso-8859-1?Q?=C5strand?=) Date: Mon, 02 Apr 2001 21:54:56 +0200 Subject: McStas: support for polarization Message-ID: <3AC8D910.5167F8C4@risoe.dk> Dear McStas user, We plan to release a version 1.4.2 of McStas on Friday this week (April 6) with support for a three-component description of spin polarization. After discussions with Kristian Nielsen, it actually turned out that he already implemented all necessary extensions in the kernel, which means that it is only the components that have to be modified. It should be emphasized that in 1.4.2 only the support for coding components and running simulations with a three-component description of polarization will be included. Components actually using spin polarization will be included one by one. Other minor suggestions to be included in 1.4.2. are welcome. Best regards, Per-Olof ?strand -- Per-Olof ?strand Dept. of Chemistry, University of Copenhagen and Materials Research Department, Ris? National Laboratory per-olof.aastrand at theory.ki.ku.dk or per-olof.aastrand at risoe.dk http://www.ki.ku.dk and http://www.risoe.dk From per-olof.aastrand at risoe.dk Wed Apr 4 11:53:15 2001 From: per-olof.aastrand at risoe.dk (Per-Olof =?iso-8859-1?Q?=C5strand?=) Date: Wed, 04 Apr 2001 11:53:15 +0200 Subject: McStas: component library Message-ID: <3ACAEF0B.FD0466A7@risoe.dk> Dear McStas user, A substantial part of the components in McStas are and will be developed by the users. To facilitate for users to make their components available for the McStas community with an appropriate credit for actually writing the component, the following is suggested: McStas is separated into two packages and two manuals: "McStas" and "McStas-comp". The "McStas-comp" manual is only edited by the McStas authors, and consists of contributions from users writing components. The manual will be published as a Ris? report and will therefore have for example an ISBN number. There are of course many details to sort out, but let's first find out if we can agree on the basic idea. It should be emphasized that the McStas authors still will take the responsibility for that there exists a large set of working components for McStas. These components include the current components in the McStas release and possibly other components that will be regarded as essential by the users. This will of course only work if the users think it is a good idea, so let's see if there are any comments. Best regards, Per-Olof ?strand -- Per-Olof ?strand Dept. of Chemistry, University of Copenhagen and Materials Research Department, Ris? National Laboratory per-olof.aastrand at theory.ki.ku.dk or per-olof.aastrand at risoe.dk http://www.ki.ku.dk and http://www.risoe.dk From per-olof.aastrand at risoe.dk Wed Apr 4 12:51:28 2001 From: per-olof.aastrand at risoe.dk (Per-Olof =?iso-8859-1?Q?=C5strand?=) Date: Wed, 04 Apr 2001 12:51:28 +0200 Subject: McStas: release 1.5 and authors Message-ID: <3ACAFCB0.4F912975@risoe.dk> Dear McStas user, It is planned to release McStas 1.5 in early September 2001 in connection to the ICNS conference. In practice, it will mean that the at that time existing 1.4.x version will be converted into 1.5 and a new manual will be released. Emmanuel Farhi at ILL has also accepted to be one of the coauthors of McStas. It will not change the way we work; I will still take care of the "maintenance" and documentation, but we hope we can benefit even more from Emmanuel's large experience and detailed knowledge of McStas. Best regards, Per-Olof ?strand -- Per-Olof ?strand Dept. of Chemistry, University of Copenhagen and Materials Research Department, Ris? National Laboratory per-olof.aastrand at theory.ki.ku.dk or per-olof.aastrand at risoe.dk http://www.ki.ku.dk and http://www.risoe.dk From per-olof.aastrand at risoe.dk Fri Apr 6 12:39:31 2001 From: per-olof.aastrand at risoe.dk (Per-Olof =?iso-8859-1?Q?=C5strand?=) Date: Fri, 06 Apr 2001 12:39:31 +0200 Subject: McStas 1.4.2 is released Message-ID: <3ACD9CE3.69CC935E@risoe.dk> Dear McStas user, A version 1.4.2 of McStas has been released. It includes mainly support for a three-component representation of spin for simulations of polarisation instruments. It is emphasized, however, that the present components do not alter the polarisation vector, but hopefully quite a few polarisation components will be included in the 1.5 release in early September. Best regards, Per-Olof -- Per-Olof ?strand Dept. of Chemistry, University of Copenhagen and Materials Research Department, Ris? National Laboratory per-olof.aastrand at theory.ki.ku.dk or per-olof.aastrand at risoe.dk http://www.ki.ku.dk and http://www.risoe.dk From farhi at ill.fr Wed Apr 18 12:11:33 2001 From: farhi at ill.fr (Emmanuel Farhi) Date: Wed, 18 Apr 2001 12:11:33 +0200 Subject: Argh ! Monitor_nD again Message-ID: <3ADD6855.BCBF9881@ill.fr> Hy all of you, The usage of McStas macros is a bit tricky, but it works usually fine. In the case of the Moniotr_nD component v0.14, I called the DETECTOR_OUT... macros, that use the 'compcurname' DEFINE (name of current component). These macros just call the mcdetector_out... functions. As with v0.14, the component functions are only compiled once, the functions where initialised with the first instance of compcurname (first monitor) and all following monitors had the same name. This does not prevent the monitors to output data in the right files, but the monitor titles where all identical in mcplot. I here provide v0.14.1 that corrects this bug (and I hope McStas will always have the detector_out_xx functions !) Cheers. EF. -- What's up Doc ? -------------------------------------------- Emmanuel FARHI, http://www.ill.fr/tas/people/Farhi.html \|/ ____ \|/ CS-Group ILL4/156, Institut Laue-Langevin (ILL) Grenoble ~@-/ oO \-@~ 6 rue J. Horowitz, BP 156, 38042 Grenoble Cedex 9,France /_( \__/ )_\ Work :Tel (33/0) 4 76 20 71 35. Fax (33/0) 4 76 48 39 06 \__U_/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- /******************************************************************************* * * Component: Monitor_nD * * %Identification * Written by: Emmanuel Farhi * Date: 14th Feb 2000. * Origin: ILL (France) * Version: 0.14.1 * Modified by: EF, 29th Feb 2000 : added more options, monitor shape, theta, phi * Modified by: EF, 10th Mar 2000 : use struct. * Modified by: EF, 25th May 2000 : correct Vars.Mon2D_Buffer alloc bug. * Modified by: EF, 17th Oct 2000 : spin detector ok. (0.13.4) * Modified by: EF, 19th Jan 2001 : 'auto limits' bug corrected (0.13.5) * Modified by: EF, 01st Feb 2001 : PreMonitor for correlation studies (0.13.6) * Modified by: EF, 02nd Feb 2001 : user variable (0.13.7) * Modified by: EF, 2th Feb 2001 : 3He gas absorption handling (0.13.8) * Modified by: EF, 5th Mar 2001 : intermediate savings (0.13.9) * Modified by: EF, 5th Apr 2001 : use global functions (0.14) compile faster * Modified by: EF, 18th Apr 2001 : passes DETECTOR_OUT to mcdetector_out * * This component is a general Monitor that can output 0/1/2D signals * (Intensity vs. [something] and vs. [something] ...) * * %Description * This component is a general Monitor that can output 0/1/2D signals * It can produce many 1D signals (one for any variable specified in * option list), or a single 2D output (two variables related). * Also, an additional 'list' of neutrons can be produced. * By default, monitor is square (in x/y plane). disk is also possible * The 'cylinder' option will change that for banana shaped detector * The 'sphere' option simulates spherical detector. * In normal configuration, the Monitor_nD measures the current parameters * of the neutron that is beeing detected. But a PreMonitor_nD component can * be used in order to study correlations between a neutron being detected in * a Monitor_nD place, and given parameters that are monitored elsewhere * (at PreMonitor_nD). * It is also possible, using the 'intermediate' keyword, to save monitor results * every X percent of the simulation. The monitor can also act as a 3He gas * detector, taking into account the detection efficiency. * * Possible options are * Variables to record: * kx ky kz k wavevector (Angs-1) [ usually axis are * vx vy vz v (m/s) x=horz., y=vert., z=on axis] * x y z radius (m) Distance, Position * t time (s) Time of Flight * energy omega (meV) * lambda wavelength (Angs) * p intensity flux (n/s) or (n/cm^2/s) * ncounts (1) * sx sy sz (1) Spin * vdiv ydiv dy (deg) vertical divergence (y) * hdiv divergence xdiv (deg) horizontal divergence (x) * angle (deg) divergence from direction * theta longitude (deg) longitude (x/z) [for sphere and cylinder] * phi lattitude (deg) lattitude (y/z) [for sphere and cylinder] * * user user1 will monitor the [Mon_Name]_Vars.UserVariable{1|2} * user2 to be assigned in an other component (see below) * * Other options are: * auto {limits} Automatically set detector limits * all {limits or bins} To set all limits or bins values * bins=[bins=20] Number of bins in the detector along dimension * borders To also count off-limits neutrons * (X < min or X > max) * cylinder To get a cylindrical monitor (e.g. banana) * (radius along x, height along y). * disk Disk flat xy monitor * radius is max abs value of xmin xmax ymin ymax * file=string Detector image file name. default is component * name, plus date and variable extension. * square Square flat xy monitor * limits=[min max] Lower/Upper limits for axes * (see below for the variable unit) * list=[counts=1000] or all For a long file of neutron characteristics * with [counts] or all events * multiple For 1D monitors into multiple independant files * no or not Revert next option * outgoing Monitor outgoing beam in non flat (sph/cyl) det * (default is incoming beam) * per cm2 Intensity will be per cm^2 * slit or absorb Absorb neutrons that are out detector * sphrere To get a spherical monitor (e.g. a 4PI) * radius is max abs value of xmin xmax ymin ymax * unactivate To unactivate detector (0D detector) * premonitor Will monitor neutron parameters stored * previously with PreMonitor_nD. * verbose To display additional informations * 3He_pressure=[3 in bars] The 3He gas pressure in detector. * 3He_pressure=0 means perfect detector (default) * intermediate=[5 in %] Save results every n% steps in simulation * * EXAMPLES: * MyMon = Monitor_nD( * xmin = -0.1, xmax = 0.1, * ymin = -0.1, ymax = 0.1, * options = "intensity per cm2 angle,limits=[-5 5] bins=10,with * borders, file = mon1"); * will monitor neutron angle from [z] axis, between -5 * and 5 degrees, in 10 bins, into "mon1.A" output 1D file * options = "sphere theta phi outgoing" for a sphere PSD detector (out beam) * and saves into file "MyMon_[Date_ID].th_ph" * options = "angle radius auto limits" is a 2D monitor with automatic limits * options = "list kx ky kz energy" records each neutron contribution in 1 file * options = "multiple kx ky kz energy and list all neutrons" * makes 4 output 1D files and produces a complete list for all neutrons * * * How to monitor anything in my simulation: with the 'user' option * In a component, you will put for instance in INITIALIZE and/or * TRACE sections (same is valid with user2) * * struct MonitornD_Variables *Vars = &(MC_GETPAR(Guide_Mon, Vars)); * with name of monitor that you will use in instr * strcpy(Vars->UserName1,"My variable label"); * Vars->UserVariable1++; * * and in the instrument description: * * COMPONENT Guide_Mon = Monitor_nD( * xmin = -0.05, xmax = 0.05, * ymin = -0.1, ymax = 0.1, * options="user1, limits=[0 15], bins=15") * AT (0,0,0) RELATIVE GuideEnd * * See also the example in PreMonitor_nD. * * %Parameters * INPUT PARAMETERS: * * xmin: (m) Lower x bound of opening * xmax: (m) Upper x bound of opening * ymin: (m) Lower y bound of opening * ymax: (m) Upper y bound of opening * options:(str) String that specifies the configuration of the monitor
* The general syntax is "[x] options..." (see Descr.) * * OUTPUT PARAMETERS: * * DEFS: structure containing Monitor_nD Defines (struct) * Vars: structure containing Monitor_nD variables (struct) * * %Link * McStas at ILL * PreMonitor_nD * * %End *******************************************************************************/ DEFINE COMPONENT Monitor_nD DEFINITION PARAMETERS (options) SETTING PARAMETERS (xmin, xmax, ymin, ymax) /* these are protected C variables */ OUTPUT PARAMETERS (DEFS, Vars) STATE PARAMETERS (x,y,z,vx,vy,vz,t,s1,s2,p) POLARISATION PARAMETERS (sx,sy,sz) DECLARE %{ #ifndef FLT_MAX #define FLT_MAX 1E37 #endif #ifndef Monitor_nD_Version #define Monitor_nD_Version "0.14" #define MONnD_COORD_NMAX 30 /* max number of variables to record */ /* here we define some DEFINE constants */ typedef struct MonitornD_Defines { char COORD_NONE ; char COORD_X ; char COORD_Y ; char COORD_Z ; char COORD_VX ; char COORD_VY ; char COORD_VZ ; char COORD_T ; char COORD_P ; char COORD_SX ; char COORD_SY ; char COORD_SZ ; char COORD_KX ; char COORD_KY ; char COORD_KZ ; char COORD_K ; char COORD_V ; char COORD_ENERGY; char COORD_LAMBDA; char COORD_RADIUS; char COORD_HDIV ; char COORD_VDIV ; char COORD_ANGLE ; char COORD_NCOUNT; char COORD_THETA ; char COORD_PHI ; char COORD_USER1 ; char COORD_USER2 ; /* token modifiers */ char COORD_VAR ; /* next token should be a variable or normal option */ char COORD_MIN ; /* next token is a min value */ char COORD_MAX ; /* next token is a max value */ char COORD_DIM ; /* next token is a bin value */ char COORD_FIL ; /* next token is a filename */ char COORD_EVNT ; /* next token is a buffer size value */ char COORD_3HE ; /* next token is a 3He pressure value */ char COORD_INTERM; /* next token is an intermediate save value (percent) */ char TOKEN_DEL[32]; /* token separators */ char SHAPE_SQUARE; /* shape of the monitor */ char SHAPE_DISK ; char SHAPE_SPHERE; char SHAPE_CYLIND; } MonitornD_Defines_type; typedef struct MonitornD_Variables { double area; double Sphere_Radius ; double Cylinder_Height ; char Flag_With_Borders ; /* 2 means xy borders too */ char Flag_List ; /* 1 store 1 buffer, 2 is list all */ char Flag_Multiple ; /* 1 when n1D, 0 for 2D */ char Flag_Verbose ; int Flag_Shape ; char Flag_Auto_Limits ; /* get limits from first Buffer */ char Flag_Absorb ; /* monitor is also a slit */ char Flag_per_cm2 ; /* flux is per cm2 */ int Coord_Number ; /* total number of variables to monitor, plus intensity (0) */ long Buffer_Block ; /* Buffer size for list or auto limits */ long Neutron_Counter ; /* event counter, simulation total counts is mcget_ncount() */ long Buffer_Counter ; /* index in Buffer size (for realloc) */ long Buffer_Size ; char Coord_Type[MONnD_COORD_NMAX]; /* type of variable */ char Coord_Label[MONnD_COORD_NMAX][30]; /* label of variable */ char Coord_Var[MONnD_COORD_NMAX][30]; /* short id of variable */ int Coord_Bin[MONnD_COORD_NMAX]; /* bins of variable array */ double Coord_Min[MONnD_COORD_NMAX]; double Coord_Max[MONnD_COORD_NMAX]; char Monitor_Label[MONnD_COORD_NMAX*30]; /* Label for monitor */ char Mon_File[128]; /* output file name */ double cx,cy,cz; double cvx, cvy, cvz; double csx, csy, csz; double cs1, cs2, ct, cp; double He3_pressure; char Flag_UsePreMonitor ; /* use a previously stored neutron parameter set */ char UserName1[128]; char UserName2[128]; double UserVariable1; double UserVariable2; double Intermediate; double IntermediateCnts; char option[1024]; int Nsum; double psum, p2sum; int **Mon2D_N; double **Mon2D_p; double **Mon2D_p2; double *Mon2D_Buffer; char compcurname[128]; } MonitornD_Variables_type; /* global functions to be defined once for faster compile */ /* code can anyway get big. may be included in an external .c file to be included once */ /* this routine is used to save results at end of simulation, but also * during simulation (SIGUSR... intermediate steps) */ void Monitor_nD_OutPut(aDEFS, aVars, dofree) MonitornD_Defines_type *aDEFS; MonitornD_Variables_type *aVars; char dofree; /* dofree = 0 : no free, =1 : free variables (last call) */ { char *fname; long i,j; int *p0m = NULL; double *p1m = NULL; double *p2m = NULL; char Coord_X_Label[1024]; double min1d, max1d; double min2d, max2d; int bin1d, bin2d; char While_End = 0; long While_Buffer = 0; double XY, pp; double Coord[MONnD_COORD_NMAX]; long Coord_Index[MONnD_COORD_NMAX]; char label[1024]; if (dofree == 0) { if (aVars->Flag_Verbose) printf("Monitor_nD: %s save intermediate results (%.2f %%).\n", aVars->compcurname, 100*mcget_run_num()/mcget_ncount()); } /* check Buffer flush when end of simulation reached */ if ((aVars->Buffer_Counter < aVars->Buffer_Block) && aVars->Flag_Auto_Limits) { /* Get Auto Limits */ if (aVars->Flag_Verbose) printf("Monitor_nD: %s getting %i Auto Limits from List (%li).\n", aVars->compcurname, aVars->Coord_Number, aVars->Buffer_Counter); for (i = 1; i <= aVars->Coord_Number; i++) { aVars->Coord_Min[i] = FLT_MAX; aVars->Coord_Max[i] = -FLT_MAX; for (j = 0; j < aVars->Buffer_Counter; j++) { XY = aVars->Mon2D_Buffer[j*(aVars->Coord_Number+2) + (i-1)]; /* scanning variables in Buffer */ if (XY < aVars->Coord_Min[i]) aVars->Coord_Min[i] = XY; if (XY > aVars->Coord_Max[i]) aVars->Coord_Max[i] = XY; } } aVars->Flag_Auto_Limits = 2; /* pass to 2nd auto limits step */ aVars->Buffer_Block = aVars->Buffer_Counter; while (!While_End) { /* we generate Coord[] and Coord_index[] from Buffer (auto limits) or passing neutron */ if (While_Buffer < aVars->Buffer_Block) { /* first while loops (While_Buffer) */ /* auto limits case : scan Buffer within limits and store in Mon2D */ for (i = 1; i <= aVars->Coord_Number; i++) { /* scanning variables in Buffer */ XY = (aVars->Coord_Max[i]-aVars->Coord_Min[i]); Coord[i] = aVars->Mon2D_Buffer[While_Buffer*(aVars->Coord_Number+2) + (i-1)]; Coord[0] = aVars->Mon2D_Buffer[While_Buffer*(aVars->Coord_Number+2) + (aVars->Coord_Number)]; pp = Coord[0]; if (XY > 0) Coord_Index[i] = floor((aVars->Mon2D_Buffer[(i-1) + While_Buffer*(aVars->Coord_Number+2)]-aVars->Coord_Min[i])*aVars->Coord_Bin[i]/XY); else Coord_Index[i] = 0; if (aVars->Flag_With_Borders) { if (Coord_Index[i] < 0) Coord_Index[i] = 0; if (Coord_Index[i] >= aVars->Coord_Bin[i]) Coord_Index[i] = aVars->Coord_Bin[i] - 1; } } /* end for */ While_Buffer++; } /* end if in Buffer */ else /* (While_Buffer >= aVars->Buffer_Block) && (aVars->Flag_Auto_Limits == 2) */ { aVars->Flag_Auto_Limits = 0; While_End = 1; if (!aVars->Flag_List && dofree) /* free Buffer not needed (no list to output) */ { /* Dim : (aVars->Coord_Number+2)*aVars->Buffer_Block matrix (for p, dp) */ free(aVars->Mon2D_Buffer); } } /* store n1d/2d section from Buffer */ /* 1D and n1D case : aVars->Flag_Multiple */ if (aVars->Flag_Multiple) { /* Dim : aVars->Coord_Number*aVars->Coord_Bin[i] vectors (intensity is not included) */ for (i= 0; i < aVars->Coord_Number; i++) { j = Coord_Index[i+1]; if (j >= 0 && j < aVars->Coord_Bin[i+1]) { aVars->Mon2D_N[i][j]++; aVars->Mon2D_p[i][j] += pp; aVars->Mon2D_p2[i][j] += pp*pp; } } } else /* 2D case : aVars->Coord_Number==2 and !aVars->Flag_Multiple and !aVars->Flag_List */ if ((aVars->Coord_Number == 2) && !aVars->Flag_Multiple) { /* Dim : aVars->Coord_Bin[1]*aVars->Coord_Bin[2] matrix */ i = Coord_Index[1]; j = Coord_Index[2]; if (i >= 0 && i < aVars->Coord_Bin[1] && j >= 0 && j < aVars->Coord_Bin[2]) { aVars->Mon2D_N[i][j]++; aVars->Mon2D_p[i][j] += pp; aVars->Mon2D_p2[i][j] += pp*pp; } } /* end store 2D/1D */ } /* end while */ } /* end Force Get Limits */ if (aVars->Flag_Verbose) { printf("Monitor_nD: %s is a %s.\n", aVars->compcurname, aVars->Monitor_Label); printf("Monitor_nD: version %s with options=%s\n", Monitor_nD_Version, aVars->option); } /* write oputput files (sent to file as p[i*n + j] vectors) */ if (aVars->Coord_Number == 0) { /* DETECTOR_OUT_0D(aVars->Monitor_Label, aVars->Nsum, aVars->psum, aVars->p2sum); */ mcdetector_out_0D(aVars->Monitor_Label, aVars->Nsum, aVars->psum, aVars->p2sum, aVars->compcurname); } else if (strlen(aVars->Mon_File) > 0) { fname = (char*)malloc(strlen(aVars->Mon_File)+10*aVars->Coord_Number); if (aVars->Flag_List) /* List */ { if (aVars->Flag_List == 2) aVars->Buffer_Size = aVars->Neutron_Counter; strcpy(fname,aVars->Mon_File); if (strchr(aVars->Mon_File,'.') == NULL) strcat(fname, "_list"); min1d = 1; max1d = aVars->Coord_Number+2; min2d = 0; max2d = aVars->Buffer_Size; bin1d = aVars->Coord_Number+2; bin2d = aVars->Buffer_Size; strcpy(Coord_X_Label,""); for (i= 1; i <= aVars->Coord_Number; i++) { if (min2d < aVars->Coord_Min[i]) min2d = aVars->Coord_Min[i]; if (max2d < aVars->Coord_Max[i]) max2d = aVars->Coord_Max[i]; strcat(Coord_X_Label, aVars->Coord_Var[i]); strcat(Coord_X_Label, " "); if (strchr(aVars->Mon_File,'.') == NULL) { strcat(fname, "."); strcat(fname, aVars->Coord_Var[i]); } } strcat(Coord_X_Label, "I I_err"); if (aVars->Flag_Verbose) printf("Monitor_nD: %s write monitor file %s List (%ix%li).\n", aVars->compcurname, fname,(aVars->Coord_Number+2),aVars->Buffer_Size); p0m = (int *)malloc((aVars->Coord_Number+2)*aVars->Buffer_Size*sizeof(int)); p1m = (double *)malloc((aVars->Coord_Number+2)*aVars->Buffer_Size*sizeof(double)); if (min2d == max2d) max2d = min2d+1e-6; if (min1d == max1d) max1d = min1d+1e-6; if (dofree == 0) { sprintf(label, "%s (%.2f %%)", aVars->Monitor_Label, 100*mcget_run_num()/mcget_ncount()); } else strcpy(label, aVars->Monitor_Label); if (p1m == NULL) /* use Raw Buffer line output */ { if (aVars->Flag_Verbose) printf("Monitor_nD: %s cannot allocate memory for transpose. Skipping.\n", aVars->compcurname); if (p0m != NULL) free(p0m); /* DETECTOR_OUT_2D( label, aVars->Coord_Label[0], Coord_X_Label, min2d, max2d, min1d, max1d, bin2d, bin1d, (int *)aVars->Mon2D_Buffer,aVars->Mon2D_Buffer,aVars->Mon2D_Buffer, fname); */ mcdetector_out_2D( label, aVars->Coord_Label[0], Coord_X_Label, min2d, max2d, min1d, max1d, bin2d, bin1d, (int *)aVars->Mon2D_Buffer,aVars->Mon2D_Buffer,aVars->Mon2D_Buffer, fname, aVars->compcurname); } else /* transpose for column output */ { for (i=0; i < aVars->Coord_Number+2; i++) for (j=0; j < aVars->Buffer_Size; j++) { p1m[i*aVars->Buffer_Size+j] = aVars->Mon2D_Buffer[j*(aVars->Coord_Number+2) + i]; p0m[i*aVars->Buffer_Size+j] = 1; } /* DETECTOR_OUT_2D( label, Coord_X_Label, aVars->Coord_Label[0], min1d, max1d, min2d, max2d, bin1d, bin2d, p0m,p1m,aVars->Mon2D_Buffer, fname); */ mcdetector_out_2D( label, Coord_X_Label, aVars->Coord_Label[0], min1d, max1d, min2d, max2d, bin1d, bin2d, p0m,p1m,aVars->Mon2D_Buffer, fname, aVars->compcurname); free(p0m); free(p1m); } } if (aVars->Flag_Multiple) /* n1D */ { for (i= 0; i < aVars->Coord_Number; i++) { strcpy(fname,aVars->Mon_File); if (strchr(aVars->Mon_File,'.') == NULL) { strcat(fname, "."); strcat(fname, aVars->Coord_Var[i+1]); } sprintf(Coord_X_Label, "%s monitor", aVars->Coord_Label[i+1]); if (dofree == 0) { sprintf(label, "%s (%.2f %%)", Coord_X_Label, 100*mcget_run_num()/mcget_ncount()); } else strcpy(label, Coord_X_Label); if (aVars->Flag_Verbose) printf("Monitor_nD: %s write monitor file %s 1D (%i).\n", aVars->compcurname, fname, aVars->Coord_Bin[i+1]); min1d = aVars->Coord_Min[i+1]; max1d = aVars->Coord_Max[i+1]; if (min1d == max1d) max1d = min1d+1e-6; /* DETECTOR_OUT_1D( label, aVars->Coord_Label[i+1], aVars->Coord_Label[0], aVars->Coord_Var[i+1], min1d, max1d, aVars->Coord_Bin[i+1], aVars->Mon2D_N[i],aVars->Mon2D_p[i],aVars->Mon2D_p2[i], fname); */ mcdetector_out_1D( label, aVars->Coord_Label[i+1], aVars->Coord_Label[0], aVars->Coord_Var[i+1], min1d, max1d, aVars->Coord_Bin[i+1], aVars->Mon2D_N[i],aVars->Mon2D_p[i],aVars->Mon2D_p2[i], fname, aVars->compcurname); } } else if (aVars->Coord_Number == 2) /* 2D */ { strcpy(fname,aVars->Mon_File); p0m = (int *)malloc(aVars->Coord_Bin[1]*aVars->Coord_Bin[2]*sizeof(int)); p1m = (double *)malloc(aVars->Coord_Bin[1]*aVars->Coord_Bin[2]*sizeof(double)); p2m = (double *)malloc(aVars->Coord_Bin[1]*aVars->Coord_Bin[2]*sizeof(double)); if (p2m == NULL) { if (aVars->Flag_Verbose) printf("Monitor_nD: %s cannot allocate memory for 2D array (%i). Skipping.\n", aVars->compcurname, 3*aVars->Coord_Bin[1]*aVars->Coord_Bin[2]*sizeof(double)); if (p0m != NULL) free(p0m); if (p1m != NULL) free(p1m); } else { for (i= 0; i < aVars->Coord_Bin[1]; i++) { for (j= 0; j < aVars->Coord_Bin[2]; j++) { p0m[j + i*aVars->Coord_Bin[2]] = aVars->Mon2D_N[i][j]; p1m[j + i*aVars->Coord_Bin[2]] = aVars->Mon2D_p[i][j]; p2m[j + i*aVars->Coord_Bin[2]] = aVars->Mon2D_p2[i][j]; } } if (strchr(aVars->Mon_File,'.') == NULL) { strcat(fname, "."); strcat(fname, aVars->Coord_Var[1]); strcat(fname, "_"); strcat(fname, aVars->Coord_Var[2]); } if (aVars->Flag_Verbose) printf("Monitor_nD: %s write monitor file %s 2D (%ix%i).\n", aVars->compcurname, fname, aVars->Coord_Bin[1], aVars->Coord_Bin[2]); min1d = aVars->Coord_Min[1]; max1d = aVars->Coord_Max[1]; if (min1d == max1d) max1d = min1d+1e-6; min2d = aVars->Coord_Min[2]; max2d = aVars->Coord_Max[2]; if (min2d == max2d) max2d = min2d+1e-6; if (dofree == 0) { sprintf(label, "%s (%.2f %%)", aVars->Monitor_Label, 100*mcget_run_num()/mcget_ncount()); } else strcpy(label, aVars->Monitor_Label); /* DETECTOR_OUT_2D( label, aVars->Coord_Label[1], aVars->Coord_Label[2], min1d, max1d, min2d, max2d, aVars->Coord_Bin[1], aVars->Coord_Bin[2], p0m,p1m,p2m, fname); */ mcdetector_out_2D( label, aVars->Coord_Label[1], aVars->Coord_Label[2], min1d, max1d, min2d, max2d, aVars->Coord_Bin[1], aVars->Coord_Bin[2], p0m,p1m,p2m, fname, aVars->compcurname); if (p0m != NULL) free(p0m); if (p1m != NULL) free(p1m); if (p2m != NULL) free(p2m); } } free(fname); } /* Now Free memory Mon2D.. */ if ((aVars->Flag_Auto_Limits || aVars->Flag_List) && aVars->Coord_Number) { /* Dim : (aVars->Coord_Number+2)*aVars->Buffer_Block matrix (for p, dp) */ if (aVars->Mon2D_Buffer != NULL && dofree) free(aVars->Mon2D_Buffer); } /* 1D and n1D case : aVars->Flag_Multiple */ if (aVars->Flag_Multiple && aVars->Coord_Number && dofree) { /* Dim : aVars->Coord_Number*aVars->Coord_Bin[i] vectors */ for (i= 0; i < aVars->Coord_Number; i++) { free(aVars->Mon2D_N[i]); free(aVars->Mon2D_p[i]); free(aVars->Mon2D_p2[i]); } free(aVars->Mon2D_N); free(aVars->Mon2D_p); free(aVars->Mon2D_p2); } /* 2D case : aVars->Coord_Number==2 and !aVars->Flag_Multiple and !aVars->Flag_List */ if ((aVars->Coord_Number == 2) && !aVars->Flag_Multiple && dofree) { /* Dim : aVars->Coord_Bin[1]*aVars->Coord_Bin[2] matrix */ for (i= 0; i < aVars->Coord_Bin[1]; i++) { free(aVars->Mon2D_N[i]); free(aVars->Mon2D_p[i]); free(aVars->Mon2D_p2[i]); } free(aVars->Mon2D_N); free(aVars->Mon2D_p); free(aVars->Mon2D_p2); } } void Monitor_nD_Init(aDEFS, aVars, m_xmin, m_xmax, m_ymin, m_ymax) MonitornD_Defines_type *aDEFS; MonitornD_Variables_type *aVars; double m_xmin, m_xmax, m_ymin, m_ymax; { long carg = 1; char *option_copy, *token; char Flag_New_Token = 1; char Flag_End = 1; char Flag_All = 0; char Flag_No = 0; char Set_aVars_Coord_Type; char Set_Coord_Flag = 0; char Set_aVars_Coord_Label[30]; char Set_aVars_Coord_Var[30]; char Short_Label[MONnD_COORD_NMAX][30]; char Set_Coord_Mode; long i=0; double lmin, lmax; long t; t = (long)time(NULL); aDEFS->COORD_NONE =0; aDEFS->COORD_X =1; aDEFS->COORD_Y =2; aDEFS->COORD_Z =3; aDEFS->COORD_VX =4; aDEFS->COORD_VY =5; aDEFS->COORD_VZ =6; aDEFS->COORD_T =7; aDEFS->COORD_P =8; aDEFS->COORD_SX =9; aDEFS->COORD_SY =10; aDEFS->COORD_SZ =11; aDEFS->COORD_KX =12; aDEFS->COORD_KY =13; aDEFS->COORD_KZ =14; aDEFS->COORD_K =15; aDEFS->COORD_V =16; aDEFS->COORD_ENERGY =17; aDEFS->COORD_LAMBDA =18; aDEFS->COORD_RADIUS =19; aDEFS->COORD_HDIV =20; aDEFS->COORD_VDIV =21; aDEFS->COORD_ANGLE =22; aDEFS->COORD_NCOUNT =23; aDEFS->COORD_THETA =24; aDEFS->COORD_PHI =25; aDEFS->COORD_USER1 =26; aDEFS->COORD_USER2 =26; /* token modifiers */ aDEFS->COORD_VAR =0; /* next token should be a variable or normal option */ aDEFS->COORD_MIN =1; /* next token is a min value */ aDEFS->COORD_MAX =2; /* next token is a max value */ aDEFS->COORD_DIM =3; /* next token is a bin value */ aDEFS->COORD_FIL =4; /* next token is a filename */ aDEFS->COORD_EVNT =5; /* next token is a buffer size value */ aDEFS->COORD_3HE =6; /* next token is a 3He pressure value */ aDEFS->COORD_INTERM =7; /* next token is an intermediate save value (%) */ strcpy(aDEFS->TOKEN_DEL, " =,;[](){}:"); /* token separators */ aDEFS->SHAPE_SQUARE =0; /* shape of the monitor */ aDEFS->SHAPE_DISK =1; aDEFS->SHAPE_SPHERE =2; aDEFS->SHAPE_CYLIND =3; aVars->Sphere_Radius = 0; aVars->Cylinder_Height = 0; aVars->Flag_With_Borders = 0; /* 2 means xy borders too */ aVars->Flag_List = 0; /* 1 store 1 buffer, 2 is list all */ aVars->Flag_Multiple = 0; /* 1 when n1D, 0 for 2D */ aVars->Flag_Verbose = 0; aVars->Flag_Shape = aDEFS->SHAPE_SQUARE; aVars->Flag_Auto_Limits = 0; /* get limits from first Buffer */ aVars->Flag_Absorb = 0; /* monitor is also a slit */ aVars->Flag_per_cm2 = 0; /* flux is per cm2 */ aVars->Coord_Number = 0; /* total number of variables to monitor, plus intensity (0) */ aVars->Buffer_Block = 1000; /* Buffer size for list or auto limits */ aVars->Neutron_Counter = 0; /* event counter, simulation total counts is mcget_ncount() */ aVars->Buffer_Counter = 0; /* index in Buffer size (for realloc) */ aVars->Buffer_Size = 0; aVars->UserVariable1 = 0; aVars->UserVariable2 = 0; aVars->He3_pressure = 0; aVars->IntermediateCnts = 0; Set_aVars_Coord_Type = aDEFS->COORD_NONE; Set_Coord_Mode = aDEFS->COORD_VAR; /* parse option string */ option_copy = (char*)malloc(strlen(aVars->option)); if (option_copy == NULL) { printf("Monitor_nD: %s cannot allocate option_copy (%i). Fatal.\n", aVars->compcurname, strlen(aVars->option)); exit(-1); } if (strlen(aVars->option)) { Flag_End = 0; strcpy(option_copy, aVars->option); } if (strstr(aVars->option, "cm2") || strstr(aVars->option, "cm^2")) aVars->Flag_per_cm2 = 1; if (aVars->Flag_per_cm2) strcpy(aVars->Coord_Label[0],"Intensity [n/cm^2/s]"); else strcpy(aVars->Coord_Label[0],"Intensity [n/s]"); strcpy(aVars->Coord_Var[0],"p"); aVars->Coord_Type[0] = aDEFS->COORD_P; aVars->Coord_Bin[0] = 1; aVars->Coord_Min[0] = 0; aVars->Coord_Max[0] = FLT_MAX; /* default file name is comp name+dateID */ sprintf(aVars->Mon_File, "%s_%i", aVars->compcurname, t); carg = 1; while((Flag_End == 0) && (carg < 128)) { if (Flag_New_Token) /* to get the previous token sometimes */ { if (carg == 1) token=(char *)strtok(option_copy,aDEFS->TOKEN_DEL); else token=(char *)strtok(NULL,aDEFS->TOKEN_DEL); if (token == NULL) Flag_End=1; } Flag_New_Token = 1; if ((token != NULL) && (strlen(token) != 0)) { /* first handle option values from preceeding keyword token detected */ if (Set_Coord_Mode == aDEFS->COORD_MAX) { if (!Flag_All) aVars->Coord_Max[aVars->Coord_Number] = atof(token); else for (i = 0; i <= aVars->Coord_Number; aVars->Coord_Max[i++] = atof(token)); Set_Coord_Mode = aDEFS->COORD_VAR; Flag_All = 0; } if (Set_Coord_Mode == aDEFS->COORD_MIN) { if (!Flag_All) aVars->Coord_Min[aVars->Coord_Number] = atof(token); else for (i = 0; i <= aVars->Coord_Number; aVars->Coord_Min[i++] = atof(token)); Set_Coord_Mode = aDEFS->COORD_MAX; } if (Set_Coord_Mode == aDEFS->COORD_DIM) { if (!Flag_All) aVars->Coord_Bin[aVars->Coord_Number] = atoi(token); else for (i = 0; i <= aVars->Coord_Number; aVars->Coord_Bin[i++] = atoi(token)); Set_Coord_Mode = aDEFS->COORD_VAR; Flag_All = 0; } if (Set_Coord_Mode == aDEFS->COORD_FIL) { if (!Flag_No) strcpy(aVars->Mon_File,token); else { strcpy(aVars->Mon_File,""); aVars->Coord_Number = 0; Flag_End = 1;} Set_Coord_Mode = aDEFS->COORD_VAR; } if (Set_Coord_Mode == aDEFS->COORD_EVNT) { if (!strcmp(token, "all") || Flag_All) aVars->Flag_List = 2; else { i = atoi(token); if (i) aVars->Buffer_Counter = i; } Set_Coord_Mode = aDEFS->COORD_VAR; Flag_All = 0; } if (Set_Coord_Mode == aDEFS->COORD_3HE) { aVars->He3_pressure = atof(token); Set_Coord_Mode = aDEFS->COORD_VAR; Flag_All = 0; } if (Set_Coord_Mode == aDEFS->COORD_INTERM) { aVars->Intermediate = atof(token); Set_Coord_Mode = aDEFS->COORD_VAR; Flag_All = 0; } /* now look for general option keywords */ if (!strcmp(token, "borders")) { if (Flag_No) { aVars->Flag_With_Borders = 0; Flag_No = 0; } else aVars->Flag_With_Borders = 1; } if (!strcmp(token, "verbose")) { if (Flag_No) { aVars->Flag_Verbose = 0; Flag_No = 0; } else aVars->Flag_Verbose = 1; } if (!strcmp(token, "multiple")) { if (Flag_No) { aVars->Flag_Multiple = 0; Flag_No = 0; } else aVars->Flag_Multiple = 1; } if (!strcmp(token, "list")) { if (Flag_No) { aVars->Flag_List = 0; Flag_No = 0; } else aVars->Flag_List = 1; Set_Coord_Mode = aDEFS->COORD_EVNT; } if (!strcmp(token, "limits") || !strcmp(token, "min")) Set_Coord_Mode = aDEFS->COORD_MIN; if (!strcmp(token, "slit") || !strcmp(token, "absorb")) { if (Flag_No) { aVars->Flag_Absorb = 0; Flag_No = 0; } else aVars->Flag_Absorb = 1; } if (!strcmp(token, "max")) Set_Coord_Mode = aDEFS->COORD_MAX; if (!strcmp(token, "bins")) Set_Coord_Mode = aDEFS->COORD_DIM; if (!strcmp(token, "file")) { Set_Coord_Mode = aDEFS->COORD_FIL; if (Flag_No) { strcpy(aVars->Mon_File,""); aVars->Coord_Number = 0; Flag_End = 1;}} if (!strcmp(token, "unactivate")) { Flag_End = 1; aVars->Coord_Number = 0; } if (!strcmp(token, "all")) { if (Flag_No) { Flag_All = 0; Flag_No = 0; } else Flag_All = 1; } if (!strcmp(token, "sphere")) { if (Flag_No) { aVars->Flag_Shape = aDEFS->SHAPE_SQUARE; Flag_No = 0; } else aVars->Flag_Shape = aDEFS->SHAPE_SPHERE; } if (!strcmp(token, "cylinder")) { if (Flag_No) { aVars->Flag_Shape = aDEFS->SHAPE_SQUARE; Flag_No = 0; } else aVars->Flag_Shape = aDEFS->SHAPE_CYLIND; } if (!strcmp(token, "square")) aVars->Flag_Shape = aDEFS->SHAPE_SQUARE; if (!strcmp(token, "disk")) aVars->Flag_Shape = aDEFS->SHAPE_DISK; if (!strcmp(token, "auto")) { if (Flag_No) { aVars->Flag_Auto_Limits = 0; Flag_No = 0; } else aVars->Flag_Auto_Limits = 1; } if (!strcmp(token, "premonitor")) { if (Flag_No) { aVars->Flag_UsePreMonitor = 0; Flag_No = 0; } else aVars->Flag_UsePreMonitor == 1; } if (!strcmp(token, "3He_pressure")) { if (!Flag_No) Set_Coord_Mode = aDEFS->COORD_3HE; aVars->He3_pressure = 3; } if (!strcmp(token, "intermediate")) { if (!Flag_No) Set_Coord_Mode = aDEFS->COORD_INTERM; aVars->Intermediate = 5; } if (!strcmp(token, "no") || !strcmp(token, "not")) Flag_No = 1; /* now look for variable names to monitor */ Set_aVars_Coord_Type = aDEFS->COORD_NONE; lmin = 0; lmax = 0; if (!strcmp(token, "x")) { Set_aVars_Coord_Type = aDEFS->COORD_X; strcpy(Set_aVars_Coord_Label,"x [m]"); strcpy(Set_aVars_Coord_Var,"x"); lmin = m_xmin; lmax = m_xmax; } if (!strcmp(token, "y")) { Set_aVars_Coord_Type = aDEFS->COORD_Y; strcpy(Set_aVars_Coord_Label,"y [m]"); strcpy(Set_aVars_Coord_Var,"y"); lmin = m_ymin; lmax = m_ymax; } if (!strcmp(token, "z")) { Set_aVars_Coord_Type = aDEFS->COORD_Z; strcpy(Set_aVars_Coord_Label,"z [m]"); strcpy(Set_aVars_Coord_Var,"z"); lmin = 0; lmax = 100; } if (!strcmp(token, "k") || !strcmp(token, "wavevector")) { Set_aVars_Coord_Type = aDEFS->COORD_K; strcpy(Set_aVars_Coord_Label,"|k| [Angs-1]"); strcpy(Set_aVars_Coord_Var,"k"); lmin = 0; lmax = 10; } if (!strcmp(token, "v")) { Set_aVars_Coord_Type = aDEFS->COORD_V; strcpy(Set_aVars_Coord_Label,"Velocity [m/s]"); strcpy(Set_aVars_Coord_Var,"v"); lmin = 0; lmax = 10000; } if (!strcmp(token, "t") || !strcmp(token, "time")) { Set_aVars_Coord_Type = aDEFS->COORD_T; strcpy(Set_aVars_Coord_Label,"TOF [s]"); strcpy(Set_aVars_Coord_Var,"t"); lmin = 0; lmax = .1; } if ((aVars->Coord_Number > 0) && (!strcmp(token, "p") || !strcmp(token, "intensity") || !strcmp(token, "flux"))) { Set_aVars_Coord_Type = aDEFS->COORD_P; if (aVars->Flag_per_cm2) strcpy(Set_aVars_Coord_Label,"Intensity [n/cm^2/s]"); else strcpy(Set_aVars_Coord_Label,"Intensity [n/s]"); strcpy(Set_aVars_Coord_Var,"I"); lmin = 0; lmax = FLT_MAX; } if (!strcmp(token, "vx")) { Set_aVars_Coord_Type = aDEFS->COORD_VX; strcpy(Set_aVars_Coord_Label,"vx [m/s]"); strcpy(Set_aVars_Coord_Var,"vx"); lmin = -1000; lmax = 1000; } if (!strcmp(token, "vy")) { Set_aVars_Coord_Type = aDEFS->COORD_VY; strcpy(Set_aVars_Coord_Label,"vy [m/s]"); strcpy(Set_aVars_Coord_Var,"vy"); lmin = -1000; lmax = 1000; } if (!strcmp(token, "vz")) { Set_aVars_Coord_Type = aDEFS->COORD_VZ; strcpy(Set_aVars_Coord_Label,"vz [m/s]"); strcpy(Set_aVars_Coord_Var,"vz"); lmin = -10000; lmax = 10000; } if (!strcmp(token, "kx")) { Set_aVars_Coord_Type = aDEFS->COORD_KX; strcpy(Set_aVars_Coord_Label,"kx [Angs-1]"); strcpy(Set_aVars_Coord_Var,"kx"); lmin = -1; lmax = 1; } if (!strcmp(token, "ky")) { Set_aVars_Coord_Type = aDEFS->COORD_KY; strcpy(Set_aVars_Coord_Label,"ky [Angs-1]"); strcpy(Set_aVars_Coord_Var,"ky"); lmin = -1; lmax = 1; } if (!strcmp(token, "kz")) { Set_aVars_Coord_Type = aDEFS->COORD_KZ; strcpy(Set_aVars_Coord_Label,"kz [Angs-1]"); strcpy(Set_aVars_Coord_Var,"kz"); lmin = -10; lmax = 10; } if (!strcmp(token, "sx")) { Set_aVars_Coord_Type = aDEFS->COORD_SX; strcpy(Set_aVars_Coord_Label,"sx [1]"); strcpy(Set_aVars_Coord_Var,"sx"); lmin = -1; lmax = 1; } if (!strcmp(token, "sy")) { Set_aVars_Coord_Type = aDEFS->COORD_SY; strcpy(Set_aVars_Coord_Label,"sy [1]"); strcpy(Set_aVars_Coord_Var,"sy"); lmin = -1; lmax = 1; } if (!strcmp(token, "sz")) { Set_aVars_Coord_Type = aDEFS->COORD_SZ; strcpy(Set_aVars_Coord_Label,"sz [1]"); strcpy(Set_aVars_Coord_Var,"sz"); lmin = -1; lmax = 1; } if (!strcmp(token, "energy") || !strcmp(token, "omega")) { Set_aVars_Coord_Type = aDEFS->COORD_ENERGY; strcpy(Set_aVars_Coord_Label,"Energy [meV]"); strcpy(Set_aVars_Coord_Var,"E"); lmin = 0; lmax = 100; } if (!strcmp(token, "lambda") || !strcmp(token, "wavelength")) { Set_aVars_Coord_Type = aDEFS->COORD_LAMBDA; strcpy(Set_aVars_Coord_Label,"Wavelength [Angs]"); strcpy(Set_aVars_Coord_Var,"L"); lmin = 0; lmax = 100; } if (!strcmp(token, "radius")) { Set_aVars_Coord_Type = aDEFS->COORD_RADIUS; strcpy(Set_aVars_Coord_Label,"Radius [m]"); strcpy(Set_aVars_Coord_Var,"R"); lmin = 0; lmax = m_xmax; } if (!strcmp(token, "angle")) { Set_aVars_Coord_Type = aDEFS->COORD_ANGLE; strcpy(Set_aVars_Coord_Label,"Angle [deg]"); strcpy(Set_aVars_Coord_Var,"A"); lmin = -5; lmax = 5; } if (!strcmp(token, "hdiv")|| !strcmp(token, "divergence") || !strcmp(token, "xdiv") || !strcmp(token, "dx")) { Set_aVars_Coord_Type = aDEFS->COORD_HDIV; strcpy(Set_aVars_Coord_Label,"Hor. Divergence [deg]"); strcpy(Set_aVars_Coord_Var,"HD"); lmin = -5; lmax = 5; } if (!strcmp(token, "vdiv") || !strcmp(token, "ydiv") || !strcmp(token, "dy")) { Set_aVars_Coord_Type = aDEFS->COORD_VDIV; strcpy(Set_aVars_Coord_Label,"Vert. Divergence [deg]"); strcpy(Set_aVars_Coord_Var,"VD"); lmin = -5; lmax = 5; } if (!strcmp(token, "theta") || !strcmp(token, "longitude")) { Set_aVars_Coord_Type = aDEFS->COORD_THETA; strcpy(Set_aVars_Coord_Label,"Longitude [deg]"); strcpy(Set_aVars_Coord_Var,"th"); lmin = -180; lmax = 180; } if (!strcmp(token, "phi") || !strcmp(token, "lattitude")) { Set_aVars_Coord_Type = aDEFS->COORD_PHI; strcpy(Set_aVars_Coord_Label,"Lattitude [deg]"); strcpy(Set_aVars_Coord_Var,"ph"); lmin = -180; lmax = 180; } if (!strcmp(token, "ncounts")) { Set_aVars_Coord_Type = aDEFS->COORD_NCOUNT; strcpy(Set_aVars_Coord_Label,"Neutrons [1]"); strcpy(Set_aVars_Coord_Var,"N"); lmin = 0; lmax = 1e10; } if (!strcmp(token, "user") || !strcmp(token, "user1")) { Set_aVars_Coord_Type = aDEFS->COORD_USER1; strncpy(Set_aVars_Coord_Label,aVars->UserName1,32); strcpy(Set_aVars_Coord_Var,"U1"); lmin = -1e10; lmax = 1e10; } if (!strcmp(token, "user2")) { Set_aVars_Coord_Type = aDEFS->COORD_USER2; strncpy(Set_aVars_Coord_Label,aVars->UserName2,32); strcpy(Set_aVars_Coord_Var,"U2"); lmin = -1e10; lmax = 1e10; } /* now stores variable keywords detected, if any */ if (Set_aVars_Coord_Type != aDEFS->COORD_NONE) { if (aVars->Coord_Number < MONnD_COORD_NMAX) aVars->Coord_Number++; else if (aVars->Flag_Verbose) printf("Monitor_nD: %s reached max number of variables (%i).\n", aVars->compcurname, MONnD_COORD_NMAX); aVars->Coord_Type[aVars->Coord_Number] = Set_aVars_Coord_Type; strcpy(aVars->Coord_Label[aVars->Coord_Number], Set_aVars_Coord_Label); strcpy(aVars->Coord_Var[aVars->Coord_Number], Set_aVars_Coord_Var); aVars->Coord_Min[aVars->Coord_Number] = lmin; aVars->Coord_Max[aVars->Coord_Number] = lmax; aVars->Coord_Bin[aVars->Coord_Number] = 20; Set_Coord_Mode = aDEFS->COORD_VAR; Flag_All = 0; Flag_No = 0; } carg++; } /* end if token */ } /* end while carg */ free(option_copy); if (carg == 128) printf("Monitor_nD: %s reached max number of tokens (%i). Skipping.\n", aVars->compcurname, 128); if (strstr(aVars->option,"unactivate") && aVars->Flag_Verbose) printf("Monitor_nD: %s is unactivated (0D)\n", aVars->compcurname); /* now setting Monitor Name from variable labels */ strcpy(aVars->Monitor_Label,""); for (i = 0; i <= aVars->Coord_Number; i++) { Set_aVars_Coord_Type = aVars->Coord_Type[i]; if ((Set_aVars_Coord_Type == aDEFS->COORD_THETA) || (Set_aVars_Coord_Type == aDEFS->COORD_PHI) || (Set_aVars_Coord_Type == aDEFS->COORD_X) || (Set_aVars_Coord_Type == aDEFS->COORD_Y) || (Set_aVars_Coord_Type == aDEFS->COORD_Z) || (Set_aVars_Coord_Type == aDEFS->COORD_RADIUS)) strcpy(Short_Label[i],"Position"); else if ((Set_aVars_Coord_Type == aDEFS->COORD_VX) || (Set_aVars_Coord_Type == aDEFS->COORD_VY) || (Set_aVars_Coord_Type == aDEFS->COORD_VZ) || (Set_aVars_Coord_Type == aDEFS->COORD_V)) strcpy(Short_Label[i],"Velocity"); else if ((Set_aVars_Coord_Type == aDEFS->COORD_KX) || (Set_aVars_Coord_Type == aDEFS->COORD_KY) || (Set_aVars_Coord_Type == aDEFS->COORD_KZ) || (Set_aVars_Coord_Type == aDEFS->COORD_K)) strcpy(Short_Label[i],"Wavevector"); else if ((Set_aVars_Coord_Type == aDEFS->COORD_SX) || (Set_aVars_Coord_Type == aDEFS->COORD_SY) || (Set_aVars_Coord_Type == aDEFS->COORD_SZ)) strcpy(Short_Label[i],"Spin"); else if ((Set_aVars_Coord_Type == aDEFS->COORD_HDIV) || (Set_aVars_Coord_Type == aDEFS->COORD_VDIV) || (Set_aVars_Coord_Type == aDEFS->COORD_ANGLE)) strcpy(Short_Label[i],"Divergence"); else if (Set_aVars_Coord_Type == aDEFS->COORD_ENERGY) strcpy(Short_Label[i],"Energy"); else if (Set_aVars_Coord_Type == aDEFS->COORD_LAMBDA) strcpy(Short_Label[i],"Wavelength"); else if (Set_aVars_Coord_Type == aDEFS->COORD_NCOUNT) strcpy(Short_Label[i],"Neutron counts"); else if (Set_aVars_Coord_Type == aDEFS->COORD_T) strcpy(Short_Label[i],"Time Of Flight"); else if (Set_aVars_Coord_Type == aDEFS->COORD_P) strcpy(Short_Label[i],"Intensity"); else if (Set_aVars_Coord_Type == aDEFS->COORD_USER1) strncpy(Short_Label[i],aVars->UserName1,32); else if (Set_aVars_Coord_Type == aDEFS->COORD_USER2) strncpy(Short_Label[i],aVars->UserName2,32); else strcpy(Short_Label[i],"Unknown"); strcat(aVars->Monitor_Label, " "); strcat(aVars->Monitor_Label, Short_Label[i]); } /* end for Short_Label */ strcat(aVars->Monitor_Label, " Monitor"); if (aVars->Flag_Shape == aDEFS->SHAPE_SQUARE) strcat(aVars->Monitor_Label, " (Square)"); if (aVars->Flag_Shape == aDEFS->SHAPE_DISK) strcat(aVars->Monitor_Label, " (Disk)"); if (aVars->Flag_Shape == aDEFS->SHAPE_SPHERE) strcat(aVars->Monitor_Label, " (Sphere)"); if (aVars->Flag_Shape == aDEFS->SHAPE_CYLIND) strcat(aVars->Monitor_Label, " (Cylinder)"); if (((aVars->Flag_Shape == aDEFS->SHAPE_CYLIND) || (aVars->Flag_Shape == aDEFS->SHAPE_SPHERE)) && strstr(aVars->option, "outgoing")) { aVars->Flag_Shape *= -1; strcat(aVars->Monitor_Label, " [out]"); } if (aVars->Flag_UsePreMonitor == 1) { strcat(aVars->Monitor_Label, " at "); strncat(aVars->Monitor_Label, aVars->UserName1,32); } /* aVars->Coord_Number 0 : intensity * aVars->Coord_Number 1:n : detector variables */ /* now allocate memory to store variables in TRACE */ if ((aVars->Coord_Number != 2) && !aVars->Flag_Multiple && !aVars->Flag_List) { aVars->Flag_Multiple = 1; aVars->Flag_List = 0; } /* default is n1D */ /* list and auto limits case : aVars->Flag_List or aVars->Flag_Auto_Limits * -> Buffer to flush and suppress after aVars->Flag_Auto_Limits */ if ((aVars->Flag_Auto_Limits || aVars->Flag_List) && aVars->Coord_Number) { /* Dim : (aVars->Coord_Number+2)*aVars->Buffer_Block matrix (for p, dp) */ aVars->Mon2D_Buffer = (double *)malloc((aVars->Coord_Number+2)*aVars->Buffer_Block*sizeof(double)); if (aVars->Mon2D_Buffer == NULL) { printf("Monitor_nD: %s cannot allocate aVars->Mon2D_Buffer (%li). No list and auto limits.\n", aVars->compcurname, aVars->Buffer_Block*(aVars->Coord_Number+2)*sizeof(double)); aVars->Flag_List = 0; aVars->Flag_Auto_Limits = 0; } aVars->Buffer_Size = aVars->Buffer_Block; } /* 1D and n1D case : aVars->Flag_Multiple */ if (aVars->Flag_Multiple && aVars->Coord_Number) { /* Dim : aVars->Coord_Number*aVars->Coord_Bin[i] vectors */ aVars->Mon2D_N = (int **)malloc((aVars->Coord_Number)*sizeof(int *)); aVars->Mon2D_p = (double **)malloc((aVars->Coord_Number)*sizeof(double *)); aVars->Mon2D_p2 = (double **)malloc((aVars->Coord_Number)*sizeof(double *)); if ((aVars->Mon2D_N == NULL) || (aVars->Mon2D_p == NULL) || (aVars->Mon2D_p2 == NULL)) { printf("Monitor_nD: %s n1D cannot allocate aVars->Mon2D_N/p/2p (%i). Fatal.\n", aVars->compcurname, (aVars->Coord_Number)*sizeof(double *)); exit(-1); } for (i= 1; i <= aVars->Coord_Number; i++) { aVars->Mon2D_N[i-1] = (int *)malloc(aVars->Coord_Bin[i]*sizeof(int)); aVars->Mon2D_p[i-1] = (double *)malloc(aVars->Coord_Bin[i]*sizeof(double)); aVars->Mon2D_p2[i-1] = (double *)malloc(aVars->Coord_Bin[i]*sizeof(double)); if ((aVars->Mon2D_N == NULL) || (aVars->Mon2D_p == NULL) || (aVars->Mon2D_p2 == NULL)) { printf("Monitor_nD: %s n1D cannot allocate %s aVars->Mon2D_N/p/2p[%li] (%i). Fatal.\n", aVars->compcurname, aVars->Coord_Var[i], i, (aVars->Coord_Bin[i])*sizeof(double *)); exit(-1); } } } else /* 2D case : aVars->Coord_Number==2 and !aVars->Flag_Multiple and !aVars->Flag_List */ if ((aVars->Coord_Number == 2) && !aVars->Flag_Multiple) { /* Dim : aVars->Coord_Bin[1]*aVars->Coord_Bin[2] matrix */ aVars->Mon2D_N = (int **)malloc((aVars->Coord_Bin[1])*sizeof(int *)); aVars->Mon2D_p = (double **)malloc((aVars->Coord_Bin[1])*sizeof(double *)); aVars->Mon2D_p2 = (double **)malloc((aVars->Coord_Bin[1])*sizeof(double *)); if ((aVars->Mon2D_N == NULL) || (aVars->Mon2D_p == NULL) || (aVars->Mon2D_p2 == NULL)) { printf("Monitor_nD: %s 2D cannot allocate %s aVars->Mon2D_N/p/2p (%i). Fatal.\n", aVars->compcurname, aVars->Coord_Var[1], (aVars->Coord_Bin[1])*sizeof(double *)); exit(-1); } for (i= 0; i < aVars->Coord_Bin[1]; i++) { aVars->Mon2D_N[i] = (int *)malloc(aVars->Coord_Bin[2]*sizeof(int)); aVars->Mon2D_p[i] = (double *)malloc(aVars->Coord_Bin[2]*sizeof(double)); aVars->Mon2D_p2[i] = (double *)malloc(aVars->Coord_Bin[2]*sizeof(double)); if ((aVars->Mon2D_N == NULL) || (aVars->Mon2D_p == NULL) || (aVars->Mon2D_p2 == NULL)) { printf("Monitor_nD: %s 2D cannot allocate %s aVars->Mon2D_N/p/2p[%li] (%i). Fatal.\n", aVars->compcurname, aVars->Coord_Var[1], i, (aVars->Coord_Bin[2])*sizeof(double *)); exit(-1); } } } /* no Mon2D allocated for * (aVars->Coord_Number != 2) && !aVars->Flag_Multiple && aVars->Flag_List */ aVars->psum = 0; aVars->p2sum = 0; aVars->Nsum = 0; aVars->area = (m_xmax - m_xmin)*(m_ymax - m_ymin)*1E4; /* in cm**2 for square shapes */ aVars->Sphere_Radius = 0; if (fabs(m_xmin) > aVars->Sphere_Radius) aVars->Sphere_Radius = fabs(m_xmin); if (fabs(m_xmax) > aVars->Sphere_Radius) aVars->Sphere_Radius = fabs(m_xmax); if ((abs(aVars->Flag_Shape) == aDEFS->SHAPE_DISK) || (abs(aVars->Flag_Shape) == aDEFS->SHAPE_SPHERE)) { if (fabs(m_ymin) > aVars->Sphere_Radius) aVars->Sphere_Radius = fabs(m_ymin); if (fabs(m_ymax) > aVars->Sphere_Radius) aVars->Sphere_Radius = fabs(m_ymax); aVars->area = PI*aVars->Sphere_Radius*aVars->Sphere_Radius; /* disk shapes */ } aVars->Cylinder_Height = fabs(m_ymax-m_ymin); if (aVars->Intermediate < 0) aVars->Intermediate = 0; if (aVars->Intermediate > 1) aVars->Intermediate /= 100; aVars->IntermediateCnts = aVars->Intermediate*mcget_ncount(); } void Monitor_nD_Trace(aDEFS, aVars) MonitornD_Defines_type *aDEFS; MonitornD_Variables_type *aVars; { double XY=0; double t0 = 0; double t1 = 0; long i,j; double pp; double Coord[MONnD_COORD_NMAX]; long Coord_Index[MONnD_COORD_NMAX]; char While_End =0; long While_Buffer=0; int intersect = 0; char Set_aVars_Coord_Type = aDEFS->COORD_NONE; pp = aVars->cp; if (aVars->Coord_Number > 0) { /* aVars->Flag_Auto_Limits */ if ((aVars->Buffer_Counter >= aVars->Buffer_Block) && (aVars->Flag_Auto_Limits == 1)) { /* auto limits case : get limits in Buffer for each variable */ /* Dim : (aVars->Coord_Number+2)*aVars->Buffer_Block matrix (for p, dp) */ if (aVars->Flag_Verbose) printf("Monitor_nD: %s getting %i Auto Limits from List (%li).\n", aVars->compcurname, aVars->Coord_Number, aVars->Buffer_Counter); for (i = 1; i <= aVars->Coord_Number; i++) { aVars->Coord_Min[i] = FLT_MAX; aVars->Coord_Max[i] = -FLT_MAX; for (j = 0; j < aVars->Buffer_Block; j++) { XY = aVars->Mon2D_Buffer[j*(aVars->Coord_Number+2) + (i-1)]; /* scanning variables in Buffer */ if (XY < aVars->Coord_Min[i]) aVars->Coord_Min[i] = XY; if (XY > aVars->Coord_Max[i]) aVars->Coord_Max[i] = XY; } } aVars->Flag_Auto_Limits = 2; /* pass to 2nd auto limits step */ } /* manage realloc for list all if Buffer size exceeded */ if ((aVars->Buffer_Counter >= aVars->Buffer_Block) && (aVars->Flag_List == 2)) { aVars->Mon2D_Buffer = (double *)realloc(aVars->Mon2D_Buffer, (aVars->Coord_Number+2)*(aVars->Neutron_Counter+aVars->Buffer_Block)*sizeof(double)); if (aVars->Mon2D_Buffer == NULL) { printf("Monitor_nD: %s cannot reallocate aVars->Mon2D_Buffer[%li] (%li). Skipping.\n", aVars->compcurname, i, (aVars->Neutron_Counter+aVars->Buffer_Block)*sizeof(double)); aVars->Flag_List = 1; } else { aVars->Buffer_Counter = 0; aVars->Buffer_Size = aVars->Neutron_Counter+aVars->Buffer_Block; } } while (!While_End) { /* we generate Coord[] and Coord_index[] from Buffer (auto limits) or passing neutron */ if (aVars->Flag_Auto_Limits == 2) { if (While_Buffer < aVars->Buffer_Block) { /* first while loops (While_Buffer) */ /* auto limits case : scan Buffer within limits and store in Mon2D */ for (i = 1; i <= aVars->Coord_Number; i++) { /* scanning variables in Buffer */ XY = (aVars->Coord_Max[i]-aVars->Coord_Min[i]); Coord[i] = aVars->Mon2D_Buffer[While_Buffer*(aVars->Coord_Number+2) + (i-1)]; Coord[0] = aVars->Mon2D_Buffer[While_Buffer*(aVars->Coord_Number+2) + (aVars->Coord_Number)]; pp = Coord[0]; if (XY > 0) Coord_Index[i] = floor((aVars->Mon2D_Buffer[(i-1) + While_Buffer*(aVars->Coord_Number+2)]-aVars->Coord_Min[i])*aVars->Coord_Bin[i]/XY); else Coord_Index[i] = 0; if (aVars->Flag_With_Borders) { if (Coord_Index[i] < 0) Coord_Index[i] = 0; if (Coord_Index[i] >= aVars->Coord_Bin[i]) Coord_Index[i] = aVars->Coord_Bin[i] - 1; } } /* end for */ While_Buffer++; } /* end if in Buffer */ else /* (While_Buffer >= aVars->Buffer_Block) && (aVars->Flag_Auto_Limits == 2) */ { aVars->Flag_Auto_Limits = 0; if (!aVars->Flag_List) /* free Buffer not needed (no list to output) */ { /* Dim : (aVars->Coord_Number+2)*aVars->Buffer_Block matrix (for p, dp) */ free(aVars->Mon2D_Buffer); } } } else /* aVars->Flag_Auto_Limits == 0 or 1 */ { for (i = 0; i <= aVars->Coord_Number; i++) { /* handle current neutron : last while */ pp = aVars->cp; XY = 0; Set_aVars_Coord_Type = aVars->Coord_Type[i]; if (Set_aVars_Coord_Type == aDEFS->COORD_X) XY = aVars->cx; else if (Set_aVars_Coord_Type == aDEFS->COORD_Y) XY = aVars->cy; else if (Set_aVars_Coord_Type == aDEFS->COORD_Z) XY = aVars->cz; else if (Set_aVars_Coord_Type == aDEFS->COORD_VX) XY = aVars->cvx; else if (Set_aVars_Coord_Type == aDEFS->COORD_VY) XY = aVars->cvy; else if (Set_aVars_Coord_Type == aDEFS->COORD_VZ) XY = aVars->cvz; else if (Set_aVars_Coord_Type == aDEFS->COORD_KX) XY = V2K*aVars->cvx; else if (Set_aVars_Coord_Type == aDEFS->COORD_KY) XY = V2K*aVars->cvy; else if (Set_aVars_Coord_Type == aDEFS->COORD_KZ) XY = V2K*aVars->cvz; else if (Set_aVars_Coord_Type == aDEFS->COORD_SX) XY = aVars->csx; else if (Set_aVars_Coord_Type == aDEFS->COORD_SY) XY = aVars->csy; else if (Set_aVars_Coord_Type == aDEFS->COORD_SZ) XY = aVars->csz; else if (Set_aVars_Coord_Type == aDEFS->COORD_T) XY = aVars->ct; else if (Set_aVars_Coord_Type == aDEFS->COORD_P) XY = pp; else if (Set_aVars_Coord_Type == aDEFS->COORD_HDIV) XY = RAD2DEG*atan2(aVars->cvx,aVars->cvz); else if (Set_aVars_Coord_Type == aDEFS->COORD_VDIV) XY = RAD2DEG*atan2(aVars->cvy,aVars->cvz); else if (Set_aVars_Coord_Type == aDEFS->COORD_V) XY = sqrt(aVars->cvx*aVars->cvx+aVars->cvy*aVars->cvy+aVars->cvz*aVars->cvz); else if (Set_aVars_Coord_Type == aDEFS->COORD_RADIUS) XY = sqrt(aVars->cx*aVars->cx+aVars->cy*aVars->cy); else if (Set_aVars_Coord_Type == aDEFS->COORD_K) { XY = sqrt(aVars->cvx*aVars->cvx+aVars->cvy*aVars->cvy+aVars->cvz*aVars->cvz); XY *= V2K; } else if (Set_aVars_Coord_Type == aDEFS->COORD_ENERGY) { XY = aVars->cvx*aVars->cvx+aVars->cvy*aVars->cvy+aVars->cvz*aVars->cvz; XY *= VS2E; } else if (Set_aVars_Coord_Type == aDEFS->COORD_LAMBDA) { XY = sqrt(aVars->cvx*aVars->cvx+aVars->cvy*aVars->cvy+aVars->cvz*aVars->cvz); XY *= V2K; if (XY != 0) XY = 2*PI/XY; } else if (Set_aVars_Coord_Type == aDEFS->COORD_NCOUNT) XY = Coord[i]+1; else if (Set_aVars_Coord_Type == aDEFS->COORD_ANGLE) { XY = sqrt(aVars->cvx*aVars->cvx+aVars->cvy*aVars->cvy+aVars->cvz*aVars->cvz); if (aVars->cvz != 0) { XY= RAD2DEG*atan2(XY,aVars->cvz); } else XY = 0; } else if (Set_aVars_Coord_Type == aDEFS->COORD_THETA) { if (aVars->cz != 0) XY = RAD2DEG*atan2(aVars->cx,aVars->cz); } else if (Set_aVars_Coord_Type == aDEFS->COORD_PHI) { if (aVars->cz != 0) XY = RAD2DEG*atan2(aVars->cy,aVars->cz); } else if (Set_aVars_Coord_Type == aDEFS->COORD_USER1) XY = aVars->UserVariable1; else if (Set_aVars_Coord_Type == aDEFS->COORD_USER2) XY = aVars->UserVariable2; else XY = 0; Coord[i] = XY; if (!aVars->Flag_Auto_Limits) { XY = (aVars->Coord_Max[i]-aVars->Coord_Min[i]); if (XY > 0) Coord_Index[i] = floor((Coord[i]-aVars->Coord_Min[i])*aVars->Coord_Bin[i]/XY); else Coord_Index[i] = 0; if (aVars->Flag_With_Borders) { if (Coord_Index[i] < 0) Coord_Index[i] = 0; if (Coord_Index[i] >= aVars->Coord_Bin[i]) Coord_Index[i] = aVars->Coord_Bin[i] - 1; } } /* else Auto_Limits will get Index later from Buffer */ } /* end for i */ While_End = 1; } /* end else if aVars->Flag_Auto_Limits == 2 */ if (aVars->Flag_Auto_Limits != 2) /* not when reading auto limits Buffer */ { /* now store Coord into Buffer (no index needed) if necessary */ if ((aVars->Buffer_Counter < aVars->Buffer_Block) && ((aVars->Flag_List) || (aVars->Flag_Auto_Limits == 1))) { for (i = 0; i < aVars->Coord_Number; i++) { aVars->Mon2D_Buffer[i + aVars->Neutron_Counter*(aVars->Coord_Number+2)] = Coord[i+1]; } aVars->Mon2D_Buffer[aVars->Coord_Number + aVars->Neutron_Counter*(aVars->Coord_Number+2)] = pp; aVars->Mon2D_Buffer[(aVars->Coord_Number+1) + aVars->Neutron_Counter*(aVars->Coord_Number+2)] = pp*pp; aVars->Buffer_Counter++; if (aVars->Flag_Verbose && (aVars->Buffer_Counter >= aVars->Buffer_Block) && (aVars->Flag_List == 1)) printf("Monitor_nD: %s %li neutrons stored in List.\n", aVars->compcurname, aVars->Buffer_Counter); } aVars->Neutron_Counter++; } /* end (aVars->Flag_Auto_Limits != 2) */ /* store n1d/2d section for Buffer or current neutron in while */ if (aVars->Flag_Auto_Limits != 1) /* not when storing auto limits Buffer */ { /* 1D and n1D case : aVars->Flag_Multiple */ if (aVars->Flag_Multiple) { /* Dim : aVars->Coord_Number*aVars->Coord_Bin[i] vectors (intensity is not included) */ for (i= 0; i < aVars->Coord_Number; i++) { j = Coord_Index[i+1]; if (j >= 0 && j < aVars->Coord_Bin[i+1]) { aVars->Mon2D_N[i][j]++; aVars->Mon2D_p[i][j] += pp; aVars->Mon2D_p2[i][j] += pp*pp; } } } else /* 2D case : aVars->Coord_Number==2 and !aVars->Flag_Multiple and !aVars->Flag_List */ if ((aVars->Coord_Number == 2) && !aVars->Flag_Multiple) { /* Dim : aVars->Coord_Bin[1]*aVars->Coord_Bin[2] matrix */ i = Coord_Index[1]; j = Coord_Index[2]; if (i >= 0 && i < aVars->Coord_Bin[1] && j >= 0 && j < aVars->Coord_Bin[2]) { aVars->Mon2D_N[i][j]++; aVars->Mon2D_p[i][j] += pp; aVars->Mon2D_p2[i][j] += pp*pp; } } } /* end (aVars->Flag_Auto_Limits != 1) */ } /* end while */ } /* end if aVars->Coord_Number */ } #endif MonitornD_Defines_type DEFS; MonitornD_Variables_type Vars; %} INITIALIZE %{ strcpy(Vars.compcurname, mccompcurname); strcpy(Vars.option, options); Monitor_nD_Init(&DEFS, &Vars, xmin, xmax, ymin, ymax); %} TRACE %{ double XY=0; double t0 = 0; double t1 = 0; long i,j; double pp; double Coord[MONnD_COORD_NMAX]; long Coord_Index[MONnD_COORD_NMAX]; char While_End =0; long While_Buffer=0; int intersect = 0; char Set_Vars_Coord_Type = DEFS.COORD_NONE; if (abs(Vars.Flag_Shape) == DEFS.SHAPE_SQUARE) /* square xy */ intersect = (x>=xmin && x<=xmax && y>=ymin && y<=ymax); if (abs(Vars.Flag_Shape) == DEFS.SHAPE_DISK) /* disk xy */ intersect = ((x*x + y*y) <= Vars.Sphere_Radius*Vars.Sphere_Radius); if (abs(Vars.Flag_Shape) == DEFS.SHAPE_SPHERE) /* sphere */ { intersect = sphere_intersect(&t0, &t1, x, y, z, vx, vy, vz, Vars.Sphere_Radius); /* intersect = (intersect && t0 > 0); */ } if (abs(Vars.Flag_Shape) == DEFS.SHAPE_CYLIND) /* cylinder */ { intersect = cylinder_intersect(&t0, &t1, x, y, z, vx, vy, vz, Vars.Sphere_Radius, Vars.Cylinder_Height); } if (intersect) { if ((abs(Vars.Flag_Shape) == DEFS.SHAPE_SPHERE) || (abs(Vars.Flag_Shape) == DEFS.SHAPE_CYLIND)) { if (t0 < 0 && t1 > 0) t0 = 0; /* neutron was already inside ! */ if (t1 < 0 && t0 > 0) t1 = 0; /* t0 is now time of incoming intersection with the sphere. */ if ((Vars.Flag_Shape < 0) && (t1 > 0)) PROP_DT(t1); /* t1 outgoing beam */ else PROP_DT(t0); /* t0 incoming beam */ } else PROP_Z0; /* Now get the data to monitor: curent or keep from PreMonitor */ if (Vars.Flag_UsePreMonitor != 1) { Vars.cp = p; Vars.cx = x; Vars.cvx = vx; Vars.csx = sx; Vars.cy = y; Vars.cvy = vy; Vars.csy = sy; Vars.cz = z; Vars.cvz = vz; Vars.csz = sz; Vars.ct = t; } if ((Vars.He3_pressure > 0) && (abs(Vars.Flag_Shape) == DEFS.SHAPE_SPHERE) || (abs(Vars.Flag_Shape) == DEFS.SHAPE_CYLIND)) { XY = exp(-7.417*Vars.He3_pressure*fabs(t1-t0)*2*PI/V2K); /* will monitor the absorbed part */ Vars.cp *= 1-XY; /* and modify the neutron weight after monitor, only remains 1-p_detect */ p *= XY; } if (Vars.Flag_per_cm2 && Vars.area != 0) Vars.cp /= Vars.area; Vars.Nsum++; Vars.psum += Vars.cp; Vars.p2sum += Vars.cp*Vars.cp; Monitor_nD_Trace(&DEFS, &Vars); /* now handles intermediate results saving */ if ((Vars.Intermediate > 0) && (mcget_run_num() > Vars.IntermediateCnts)) { Vars.IntermediateCnts += Vars.Intermediate*mcget_ncount(); /* save results, but do not free pointers */ Monitor_nD_OutPut(&DEFS, &Vars, 0); } } /* end if intersection */ else if (Vars.Flag_Absorb) ABSORB; %} FINALLY %{ /* save results, and free pointers */ Monitor_nD_OutPut(&DEFS, &Vars, 1); %} MCDISPLAY %{ double radius, h; radius = Vars.Sphere_Radius; h = Vars.Cylinder_Height; if (abs(Vars.Flag_Shape) == DEFS.SHAPE_SPHERE) { magnify(""); circle("xy",0,0,0,radius); circle("xz",0,0,0,radius); circle("yz",0,0,0,radius); } else if (abs(Vars.Flag_Shape) == DEFS.SHAPE_DISK) { magnify(""); circle("xy",0,0,0,radius); } else if (abs(Vars.Flag_Shape) == DEFS.SHAPE_SQUARE) { magnify("xy"); multiline(5, (double)xmin, (double)ymin, 0.0, (double)xmax, (double)ymin, 0.0, (double)xmax, (double)ymax, 0.0, (double)xmin, (double)ymax, 0.0, (double)xmin, (double)ymin, 0.0); } else if (abs(Vars.Flag_Shape) == DEFS.SHAPE_CYLIND) { magnify("xyz"); circle("xz", 0, h/2.0, 0, radius); circle("xz", 0, -h/2.0, 0, radius); line(-radius, -h/2.0, 0, -radius, +h/2.0, 0); line(+radius, -h/2.0, 0, +radius, +h/2.0, 0); line(0, -h/2.0, -radius, 0, +h/2.0, -radius); line(0, -h/2.0, +radius, 0, +h/2.0, +radius); } %} END From wildgrub at dxray.mpi-stuttgart.mpg.de Mon Apr 23 16:51:40 2001 From: wildgrub at dxray.mpi-stuttgart.mpg.de (Ulrich C. Wildgruber MPI fuer Metallforschung Stuttgart) Date: Mon, 23 Apr 2001 16:51:40 +0200 Subject: calling mcstas 1.4.2 ... Message-ID: <3AE4417C.D319A824@dxray.mpi-stuttgart.mpg.de> Hi everybody, I just started to use 1.4.2 and experience a little problem. The command mcstas xyz.instr leads to: mcstas GMonochromator_2.0.instr parse error, expecting `TOK_ID' at line 31. Fatal error: Errors encountered during autoload of component Arm. Program aborted. Looks like my installation is wrong although I did it exactely the same way as before (and not only once but several times...) and tried instr-file which compiled without any problem before. I couldn't find any further information on the mcstas webpage or in the manual to shed light on this behaviour of mcstas. Any comment/advice/help is appreciated. Thanks! Uli -- Ulrich WILDGRUBER wildgrub at dxray.mpi-stuttgart.mpg.de wwwmf.mpi-stuttgart.mpg.de/abteilungen/dosch/dosch.html ----------------------------------------------------------------------------- Max-Planck-Institut f?r Metallforschung | Technische Universit?t M?nchen Heisenbergstr. 1 | ZBE Neue Forschungs-Neutronenquelle | Instrumentierung D-70569 Stuttgart | D-85747 Garching/M?nchen Tel.: (+49)-711-689-1900 | Tel.: (+49)-89-289-14681 Fax.: (+49)-711-689-1902 | Fax.: (+49)-89-289-14666 From S.RYCROFT at IRI.TUDELFT.NL Mon Apr 23 17:59:13 2001 From: S.RYCROFT at IRI.TUDELFT.NL (Stuart Rycroft) Date: Mon, 23 Apr 2001 17:59:13 +0200 (CEST) Subject: calling mcstas 1.4.2 ... In-Reply-To: <3AE4417C.D319A824@dxray.mpi-stuttgart.mpg.de> Message-ID: Hi I encountered the same problem. After a little time I noticed that there was a problem in the ARM component which should have the line POLARISATION PARAMETERS (sx,sy,sz) not POLARISATION PARAMETERS () It worked when I changed it. Stuart Rycroft On Mon, 23 Apr 2001, Ulrich C. Wildgruber MPI fuer Metallforschung Stuttgart wrote: >>Hi everybody, >> >>I just started to use 1.4.2 and experience a little problem. >>The command >> mcstas xyz.instr >> >>leads to: >> >>mcstas GMonochromator_2.0.instr >>parse error, expecting `TOK_ID' at line 31. >> >> >>Fatal error: Errors encountered during autoload of component Arm. >> >> >>Program aborted. >> >>Looks like my installation is wrong although I did it exactely the same >>way as before (and not only once but several times...) and tried instr-file >>which compiled without any problem before. I couldn't find any further >>information on the mcstas webpage or in the manual to shed light on this >>behaviour of mcstas. Any comment/advice/help is appreciated. >> >>Thanks! >> >>Uli >> >>-- >>Ulrich WILDGRUBER >>wildgrub at dxray.mpi-stuttgart.mpg.de >>wwwmf.mpi-stuttgart.mpg.de/abteilungen/dosch/dosch.html >>----------------------------------------------------------------------------- >>Max-Planck-Institut f?r Metallforschung | Technische Universit?t M?nchen >>Heisenbergstr. 1 | ZBE Neue Forschungs-Neutronenquelle >> | Instrumentierung >>D-70569 Stuttgart | D-85747 Garching/M?nchen >>Tel.: (+49)-711-689-1900 | Tel.: (+49)-89-289-14681 >>Fax.: (+49)-711-689-1902 | Fax.: (+49)-89-289-14666 >> Stuart Rycroft Interfaculty Reactor Institute (IRI) Delft University of Technology Mekelweg 15 2629 JB Delft Netherlands Tel: (+31) 015 278 3900 From per-olof.aastrand at risoe.dk Wed May 9 15:20:15 2001 From: per-olof.aastrand at risoe.dk (Per-Olof =?iso-8859-1?Q?=C5strand?=) Date: Wed, 09 May 2001 15:20:15 +0200 Subject: McStas: webpage with publications Message-ID: <3AF9440F.43DCD14C@risoe.dk> Dear McStas user, There is a list of publications related to Monte Carlo simulations on our web page: http://neutron.risoe.dk/mcstas/reflist.html . It is quite old, however, and needs to be updated. If you have some additional publications that should be included, please let me know and I will extend the list. Actually, I think it would be of interest to extend the list to include not only work using McStas. Information about other work of interest for the McStas community is welcome. I think I will manage to find papers published in regular journals, but I need more help with proceedings, reports, etc. that perhaps are not generally available. I would be happy to include ps- or pdf-files of such documents or relevant links to web pages. Best regards, Per-Olof ?strand mcstas at risoe.dk -- Per-Olof ?strand Dept. of Chemistry, University of Copenhagen and Materials Research Department, Ris? National Laboratory per-olof.aastrand at theory.ki.ku.dk or per-olof.aastrand at risoe.dk http://www.ki.ku.dk and http://www.risoe.dk From S.RYCROFT at IRI.TUDELFT.NL Mon May 14 14:27:00 2001 From: S.RYCROFT at IRI.TUDELFT.NL (Stuart Rycroft) Date: Mon, 14 May 2001 14:27:00 +0200 (CEST) Subject: fermi chopper component Message-ID: Hello I am trying to simulate a Fermi chopper with a straight channel. The component in mcstas (written by Andrew Garrett) simulates a curved Fermi chopper. I am having difficulty following the code in order to change to a straight channeled chopper. Can anyone help? Stuart Rycroft Interfaculty Reactor Institute (IRI) Delft University of Technology Mekelweg 15 2629 JB Delft Netherlands Tel: (+31) 015 278 3900 From kim.lefmann at risoe.dk Tue May 15 10:01:36 2001 From: kim.lefmann at risoe.dk (Kim Lefmann) Date: Tue, 15 May 2001 10:01:36 +0200 (CEST) Subject: Non-member submission from ["M.E. Hagen" ] Message-ID: >From m.e.hagen at phys.keele.ac.uk Tue May 15 02:31:53 2001 Return-Path: Received: from mail.risoe.dk (really [130.226.48.21]) by neutron.risoe.dk via in.smtpd with esmtp id (Debian Smail3.2.0.102) for ; Tue, 15 May 2001 02:31:52 +0200 (CEST) Received: from CONVERSION-DAEMON.risoe.dk by risoe.dk (PMDF V6.0-24 #38262) id for neutron-mc at neutron.risoe.dk (ORCPT neutron-mc at risoe.dk); Tue, 15 May 2001 00:42:49 +0200 (W. Europe Daylight Time) Received: from owat.kis.keele.ac.uk (owat.kis.keele.ac.uk [160.5.46.3]) by risoe.dk (PMDF V6.0-24 #38262) with ESMTP id for neutron-mc at neutron.risoe.dk (ORCPT neutron-mc at risoe.dk); Tue, 15 May 2001 00:42:48 +0200 (W. Europe Daylight Time) Received: from pha70 by owat.kis.keele.ac.uk with local (Exim 2.12 #2) id 14zR39-00058n-00 for neutron-mc at risoe.dk; Mon, 14 May 2001 23:42:47 +0100 Date: Mon, 14 May 2001 23:42:47 +0100 (BST) From: "M.E. Hagen" Subject: Some infor on Fermi chopper routine To: neutron-mc at risoe.dk Message-id: MIME-version: 1.0 X-Mailer: ELM [version 2.5 PL3] Content-type: text/plain; charset=us-ascii Content-transfer-encoding: QUOTED-PRINTABLE PMDF-SMTP-Warning: Lines longer than SMTP allows found and truncated. Stuart, The curved Fermi chopper routine that Andrew wrote for McStas is, I t= hink, a version of the Fermi chopper routine that I wrote for PRMON i= n FORTRAN-90. Andrew and I shared an office at KEK for a while and wo= rked on simulating a curved Fermi chopper for MARI. I'll send you dir= ectly a copy of the FORTRAN-90 code which also includes a routine for= a "straight" Fermi chopper which may (or may not) help. Also I can o= utline the "theory" behind the curved Fermi chopper routine which may= help with understanding the McStas code. The routine works by transforming to the frame of reference of the cu= rved chopper not the lab frame. In the chopper frame the curved blade= s remain fixed in position of course but the neutron now follows a /c= urved/ path. Assuming that the Fermi chopper is a cylinder shape then= in the lab frame one can calculate the entrance and exit positions a= nd times at which the neutron intersects the chopper body. One then t= ransforms those positions into the chopper frame, the transform invol= ves the frequency and phase of the chopper. The slats (channels) of the chopper are assumed to be on constant rad= ii from an origin. One computes the radial distances of the entrance = position and exit position of the neutron and checks if they correspo= nd to the same slat. If they don't the neutron is rejected. If they d= o one must then check that the neutron always stays within the slat a= s it passes through the chopper. The algebra we worked out showed tha= t if one plots the radial distance of the neutron along its flight pa= th (in the chopper frame) from entrance to exit as a function of time= (or polar angle) it can only have a maximum of one turning point. Th= us first one checks the derivatives of the radius at the entrance and= exit points, if they are the same the neutron stayed within the slat= and is accepted. If they are different then one must bisect down to = the position where the derivative is zero. If at any time the radial = distance of the neutron wanders outside the inner and outer radii of = the slat the neutron is rejected. If it doesn't the neut If the neutron makes it through one just uses the exit position and t= ime in the lab frame.=20 Andrew was only interested in MARI and so only produced a curved chop= per routine I believe, the straight chopper can be simplified slightl= y (see FORTRAN-90 code). Hope that is some help, e-mail me if you want to know more, cheers, Mark From mcgreevy at studsvik.uu.se Wed Jun 6 09:47:14 2001 From: mcgreevy at studsvik.uu.se (Robert McGreevy) Date: Wed, 06 Jun 2001 09:47:14 +0200 Subject: Postdoc position at NFL Message-ID: <3.0.6.32.20010606094714.008f3d60@nflett.studsvik.uu.se> POSTDOCTORAL RESEARCHER Uppsala University - Studsvik Neutron Research Laboratory The Studsvik Neutron Research Laboratory (NFL) is the Swedish centre for reactor based research using neutrons in physics, chemistry, materials science and engineering. NFL is a department of Uppsala University but is responsible for providing neutron research facilities both nationally and internationally. NFL has a vacancy for a postdoctoral researcher, to work primarily in the area of residual stress measurement and analysis. Applicants should hold a Ph.D. in an appropriate field. The person appointed will be expected to carry out an active programme of research using the neutron scattering instrumentation at NFL, and at other facilities as relevant. A proportion of beamtime at NFL is guaranteed to in-house staff. In collaboration with the laboratory director, Dr Robert McGreevy, and the REST instrument scientist, Dr Ru Lin Peng, they should ? assist with instrument operation and the external user programmes, ? participate in Swedish activities related to the European Spallation Source project and ? participate in educational activities, for example practical experimental courses at NFL. A significant part of the work will be associated with advanced software development in the area of residual stress analysis; this is funded by the SCANS (Software for Computer Aided Neutron Scattering) network under the Improving Human Potential programme of the European Commission; see http://www.studsvik.uu.se/scans.htm for more details. The salary will be in the region of 15000 SEK per month (after tax), depending on age and experience. Funding for this position is available for a two year period. For information on facilities and research at NFL see our web site at http://www.studsvik.uu.se. Informal enquiries should be addressed to mcgreevy at studsvik.uu.se or rulin at ikp.liu.se. Applications including a description of research experience, a full CV and names and addresses of two referees should be sent to Dr Robert McGreevy at Studsvik Neutron Research Laboratory Uppsala University S-611 82 Nyk?ping Sweden or by E-mail to mcgreevy at studsvik.uu.se, to arrive before 13th August 2001. -------------- next part -------------- A non-text attachment was scrubbed... Name: Postdoc Advert 2001.PDF Type: application/pdf Size: 18703 bytes Desc: not available URL: -------------- next part -------------- *************************************************************************** Dr. Robert McGreevy Studsvik Neutron Research Laboratory Uppsala University S-611 82 Nykoping Sweden Tel: +46 155 221831 Mobile: +46 70 6792159 FAX: +46 155 263001 E-mail: mcgreevy at studsvik.uu.se http://www.studsvik.uu.se