From 98c008213fef79506e6d9e87a444a139b0f79cc5 Mon Sep 17 00:00:00 2001 From: Blake Walters Date: Wed, 25 Nov 2015 09:38:30 -0500 Subject: [PATCH 1/4] Insert hook for including work done by E field Subtract "de" from "peie" at end of charged particle transport instead of just "edep." Hook must be uncommented to work. --- HEN_HOUSE/src/egsnrc.mortran | 3 +++ 1 file changed, 3 insertions(+) diff --git a/HEN_HOUSE/src/egsnrc.mortran b/HEN_HOUSE/src/egsnrc.mortran index 7744e40b6..374aad473 100644 --- a/HEN_HOUSE/src/egsnrc.mortran +++ b/HEN_HOUSE/src/egsnrc.mortran @@ -1552,7 +1552,10 @@ $start_new_particle; "Now done with multiple scattering, "update energy and see if below cut + "below subtracts only energy deposited" peie = peie - edep; + "below subtracts energy deposited + work due to E field" + "peie = peie - de;" eie = peie; e(np) = peie; From 596821a17df3757cd5884d40906dee0934fa4105 Mon Sep 17 00:00:00 2001 From: Blake Walters Date: Wed, 25 Nov 2015 09:49:04 -0500 Subject: [PATCH 2/4] Fix bugs in E field implementation Three changes: 1. Fix bug in normalization of input E field: Previously normalized by -IQ(NP)/RM*10**6 Normalize by -IQ(NP)/(RM*10**6) 2. Fix bug in TUSTEP restriction by fractional energy loss ($EMELMT): Previously $EMELMT multiplied by (1+1./GAMMA0) Should be 1/(1+1./GAMMA0) (Error found by Hugo Bouchard) 3. Add a $GET-POTENTIAL macro for constant E field so work can be done on particle --- HEN_HOUSE/src/emf_macros.mortran | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/HEN_HOUSE/src/emf_macros.mortran b/HEN_HOUSE/src/emf_macros.mortran index 611da4f56..e976b2354 100644 --- a/HEN_HOUSE/src/emf_macros.mortran +++ b/HEN_HOUSE/src/emf_macros.mortran @@ -174,7 +174,8 @@ IF(EPERP2.NE.0.0)[EPERP=SQRT(EPERP2);TUSTEP=MIN(TUSTEP,$EMULMT/EPERP);] ; " " REPLACE {$SET-TUSTEP-ENERGY-CHANGE-EM-FIELD;} WITH {; -IF(EDOTU.NE.0.0) TUSTEP=MIN(TUSTEP,ABS($EMELMT*(1.+1./GAMMA0)/EDOTU)); +IF(EDOTU.NE.0.0) TUSTEP=MIN(TUSTEP,ABS($EMELMT/((1.+1./GAMMA0)*EDOTU))); +"fixed, $EMELMT used to be multiplied by (1+1./GAMMA0)--BW" } ; " " @@ -373,6 +374,11 @@ REPLACE {$GET-EM-FIELD(#,#,#,#,#);} WITH {; REPLACE {$GET-POTENTIAL(#,#,#,#);} WITH {;{P1}=0.0;}; ; +"potential in a constant E field--BW" +REPLACE {$GET-POTENTIAL(#,#,#,#);} WITH {; +{P1}=-GAMMA0*BETA20*RM*(EX0*{P2}+EY0*{P3}+EZ0*{P4}); +} + "3.0*3.0/0.511 explanation " "nT = 3.0 (this example) = Magnetic field strength in Tesla V.s/m**2 " "3.0 = Speed of light, in m/s *10**8 " @@ -393,7 +399,8 @@ REPLACE {$GET-POTENTIAL(#,#,#,#);} WITH {;{P1}=0.0;}; " which can be defined by input, EMH, July 2015 " "***********************************************" REPLACE {$GET-EM-FIELD(#,#,#,#,#);} WITH {; -fbtemp=-IQ(NP)/RM*10**6; +"fixed e-field normalization below--factor of 10^6 must be in denominator!--BW" +fbtemp=-IQ(NP)/(RM*10**6); {P1}X0=ExIN*fbtemp;{P1}Y0=EyIN*fbtemp;{P1}Z0=EzIN*fbtemp; fbtemp=3.0/0.511; {P2}X0=BxIN*fbtemp;{P2}Y0=ByIN*fbtemp;{P2}Z0=BzIN*fbtemp; From 0c5d0d4b8973fabfb487020a27c292f80135f395 Mon Sep 17 00:00:00 2001 From: Frederic Tessier Date: Thu, 26 Nov 2015 15:32:08 -0500 Subject: [PATCH 3/4] Update README --- README.md | 59 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index c5daacf7d..710ae620e 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,12 @@ sections, and the egs++ class library to model elaborate geometries and particle sources. +## Documentation + +The EGSnrc user manuals are available on the EGSnrc web page: +http://nrc-cnrc.github.io/EGSnrc/. + + ## Licence EGSnrc is distributed as free software under the terms of the GNU Affero @@ -20,13 +26,14 @@ before downloading the software. In practice, this licence imposes no restriction on using EGSnrc. However, if you want to further convey verbatim or modified versions of the code, or any work based on any EGSnrc component (including any such work operated remotely over a -network), you must do so under the same licence terms. Contact us if you -wish to licence EGSnrc under different terms. +network), you must do so under the same licence terms. [Contact NRC] +(http://www.nrc-cnrc.gc.ca/eng/solutions/advisory/egsnrc_index.html) +if you wish to licence EGSnrc under different terms. ## Prerequisites -EGSnrc can be installed on computers running Linux, OSX or Windows +EGSnrc can be installed on computers running Linux, OS X or Windows operating systems. As a general-purpose Monte Carlo toolkit, EGSnrc provides source code and utilities to build and run your own radiation transport simulation applications. To use EGSnrc @@ -43,31 +50,25 @@ Please read the [installation instructions] (https://github.com/nrc-cnrc/EGSnrc/wiki/Installation-overview) in the wiki for more details about these software components. + ## Installation Installation involves downloading the EGSnrc source code, and then -configuring EGSnrc for your computer. The recommended way to obtain the -source code is to clone the EGSnrc repository on your computer using the -git revision control software, via the SSH clone URL: +configuring EGSnrc for your computer. We recommend using the `git` +revision control software to obtain the source code. The following shell +command will clone the EGSnrc repository to your current working +directory: ```bash -git clone git@github.com:nrc-cnrc/EGSnrc.git +git clone https://github.com/nrc-cnrc/EGSnrc.git ``` - -Once you have downloaded the source code, you must run a configuration -GUI or script to set up and compile EGSnrc software components for your -computer. Please read the full [installation instructions] -(https://github.com/nrc-cnrc/EGSnrc/wiki/Installation-overview) in the -wiki for more details on how to download and configure EGSnrc. - - -## Documentation - -The EGSnrc user manuals in PDF format can be downloaded from the -[releases](https://github.com/nrc-cnrc/EGSnrc/releases) page. Download -the `EGSnrc-manuals.zip` archive, and unzip it. If you installed EGSnrc, -you may want to move the extracted PDF files to the -`EGSnrc/HEN_HOUSE/doc` -directory for convenience. +Alternatively, you can download a [zip archive] +(https://github.com/nrc-cnrc/EGSnrc/archive/master.zip) of the EGSnrc +directory. Once you have downloaded the source code, you need to run a +configuration GUI or script to set up and compile EGSnrc software +components for your computer. Please read the full [installation +instructions] +(https://github.com/nrc-cnrc/EGSnrc/wiki/Installation-overview) for more +details on how to download and configure EGSnrc. ## Issues @@ -82,12 +83,12 @@ pertains to an error condition which is precise and reproducible. ## Contributing -Please contribute to the EGSnrc project by implementing new features, -creating new data sets, correcting errors, and improving documentation. -You can submit small corrections and contributions as issues in the +You can contribute to the EGSnrc project by implementing new features, +creating new data sets, correcting errors, or improving documentation. +Feel free to submit small corrections and contributions as issues in the [issue tracker](https://github.com/nrc-cnrc/EGSnrc/issues). For more -extensive contributions, familiarize yourself with git and github, work -on your own EGSnrc project fork and submit your changes via a pull -request. Note that significant additions will require a transfer of +extensive contributions, familiarize yourself with git and github, +work on your own EGSnrc project fork and submit your changes via a pull +request. Note that significant contributions will require a transfer of copyright to the National Research Council of Canada before they can be merged into the EGSnrc distribution. From 426170b1000037cdb24c30ded01b89c772d5d4b3 Mon Sep 17 00:00:00 2001 From: Frederic Tessier Date: Thu, 26 Nov 2015 18:38:31 -0500 Subject: [PATCH 4/4] Update README to match the github web page --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 710ae620e..b9a5eabb7 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ before downloading the software. In practice, this licence imposes no restriction on using EGSnrc. However, if you want to further convey verbatim or modified versions of the code, or any work based on any EGSnrc component (including any such work operated remotely over a -network), you must do so under the same licence terms. [Contact NRC] +network), you must do so under the same licence terms. Please [Contact NRC] (http://www.nrc-cnrc.gc.ca/eng/solutions/advisory/egsnrc_index.html) if you wish to licence EGSnrc under different terms.