From a42e27bbf5a31d121789a161f27096e46bca649e Mon Sep 17 00:00:00 2001 From: valeriaRaffuzzi <108435337+valeriaRaffuzzi@users.noreply.github.com> Date: Thu, 5 Jun 2025 11:49:25 +0100 Subject: [PATCH 1/7] Fix bug in building thermalScatterElastic_class.f90 --- .../thermalScattReactionCE/thermalScatterElastic_class.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuclearData/Reactions/thermalScattReactionCE/thermalScatterElastic_class.f90 b/NuclearData/Reactions/thermalScattReactionCE/thermalScatterElastic_class.f90 index cf6cee91b..5dc831a2b 100644 --- a/NuclearData/Reactions/thermalScattReactionCE/thermalScatterElastic_class.f90 +++ b/NuclearData/Reactions/thermalScattReactionCE/thermalScatterElastic_class.f90 @@ -311,7 +311,7 @@ subroutine buildFromACE(self, ACE) call ACE % setToElasticOut() do i = 1, Nin - self % muMatrix(i,:) = ACE % readIntArray(Nin) + self % muMatrix(i,:) = ACE % readRealArray(self % N_muOut) end do end if From b001de6b60b6a9aad36ed5843d046dcd3e62e58e Mon Sep 17 00:00:00 2001 From: "V. Raffuzzi" Date: Thu, 9 Oct 2025 11:38:20 +0100 Subject: [PATCH 2/7] improve wedge input --- .../Surfaces/CompositeSurfaces/wedge_class.f90 | 14 +++++++------- docs/User Manual.rst | 10 ++++++---- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Geometry/Surfaces/CompositeSurfaces/wedge_class.f90 b/Geometry/Surfaces/CompositeSurfaces/wedge_class.f90 index 3c64276fa..b02773e9f 100644 --- a/Geometry/Surfaces/CompositeSurfaces/wedge_class.f90 +++ b/Geometry/Surfaces/CompositeSurfaces/wedge_class.f90 @@ -40,7 +40,7 @@ module wedge_class !! !! Sample Dictionary Input: !! aab { type zWedge; id 92; origin (0.0 0.0 9.0); halfwidth 5.0; altitude 2.0; - !! opening 30.0; rotation 0.0; } + !! opening 30.0; # rotation 0.0; # } !! !! Boundary Conditions: !! BC order: face1, face2, face3, -base, base @@ -54,7 +54,7 @@ module wedge_class !! 0.0 and 90.0 degrees excluded) !! phi -> Rotation angle around the edge of the wedge. The rotation angle is with respect !! to the axis: +y for a xWedge; +x for a yWedge and zWedge. It must be between - !! 0.0 and 360.0 degrees excluded + !! 0.0 and 360.0 degrees !! BC -> Boundary conditions flags for each face (face1, face2, face3, -base, base) !! !! Interface: @@ -162,10 +162,10 @@ subroutine init(self, dict) call dict % get(type, 'type') ! Load triangle opening angle - call dict % get(theta,'opening') + call dict % get(theta, 'opening') ! Load rotation angle with respect to reference axis - call dict % getOrDefault(phi,'rotation',ZERO) + call dict % getOrDefault(phi, 'rotation', ZERO) ! Build wedge call self % build(type, theta, phi) @@ -217,9 +217,9 @@ subroutine build(self, type, theta, phi) self % theta = theta * PI / 180.0_defReal ! Save rotation angle - if (phi <= ZERO .or. phi >= 360.0_defReal) then - call fatalError(Here, 'Rotation angle of wedge must be in the range 0-360 degrees '//& - & '(extremes excluded). It is: '//numToChar(phi)) + if (phi < ZERO .or. phi > 360.0_defReal) then + call fatalError(Here, 'Rotation angle of wedge must be in the range 0-360 degrees. '//& + & 'It is: '//numToChar(phi)) end if self % phi = phi * PI / 180.0_defReal diff --git a/docs/User Manual.rst b/docs/User Manual.rst index 2cb159d58..e60229350 100644 --- a/docs/User Manual.rst +++ b/docs/User Manual.rst @@ -560,8 +560,9 @@ Example: :: - altitude: altitude of the triangular face of the wedge. [cm] - opening: half angle, determines the opening of the triangular face of the wedge. Must be positive and between 0-90. [degrees] - - rotation: rotation angle around the edge of the wedge. The rotation angle is with respect to the axis: - +y for a xWedge; +x for a yWedge and zWedge. Must be positive and between 0-360. [degrees] + - rotation (*optional*, default = 0.0): rotation angle around the edge of the wedge. The rotation + angle is with respect to the axis: +y for a xWedge; +x for a yWedge and zWedge. Must be positive + and between 0-360. [degrees] Example: :: @@ -571,8 +572,9 @@ Example: :: .. note:: A wedge can be used as a bounding surface. In this case, this surface will accept 5 boundary condition values: (face1 face2 face3 -base +base). Note that face3 refers to the face in front - of the axis of the wedge; face1 and face2 are the two slanted faces defined by the opening angle: - face1 is the face rotated by -opening compared to the triangle altitude; face2 is rotated by +opening. + of the axis of the wedge, and it only accepts vacuum boundary conditions; face1 and face2 are the + two slanted faces defined by the opening angle: face1 is the face rotated by -opening compared to + the triangle altitude; face2 is rotated by +opening. Cells ##### From c70bcb35a8a1850b10e4b71d7647ea3b02d5dd34 Mon Sep 17 00:00:00 2001 From: valeriaRaffuzzi <108435337+valeriaRaffuzzi@users.noreply.github.com> Date: Fri, 28 Nov 2025 13:55:49 +0000 Subject: [PATCH 3/7] Unit correction --- SharedModules/universalVariables.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SharedModules/universalVariables.f90 b/SharedModules/universalVariables.f90 index f80847173..36fc8c3d8 100644 --- a/SharedModules/universalVariables.f90 +++ b/SharedModules/universalVariables.f90 @@ -84,8 +84,8 @@ module universalVariables energyPerFission = 200.0_defReal ! MeV ! Unit conversion - real(defReal), parameter :: joulesPerMeV = 1.60218e-13 ,& ! Convert MeV to J - shakesPerS = 1.0e-8 ! Convert shakes to s + real(defReal), parameter :: joulesPerMeV = 1.60218e-13_defReal ,& ! Convert MeV to J + shakesPerS = 1.0e8_defReal ! Convert shakes to s ! Global name variables used to define specific geometry or field types character(nameLen), parameter :: nameUFS = 'uniFissSites' From 0622a78ab04354460a107659e0e751012d35792f Mon Sep 17 00:00:00 2001 From: "V. Raffuzzi" Date: Wed, 14 Jan 2026 17:44:43 +0000 Subject: [PATCH 4/7] Modified make ace script to be recursive --- scripts/make_ace_lib.sh | 55 ++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/scripts/make_ace_lib.sh b/scripts/make_ace_lib.sh index 7deeceba5..45ad6865d 100755 --- a/scripts/make_ace_lib.sh +++ b/scripts/make_ace_lib.sh @@ -2,23 +2,24 @@ HELP="Create a SCONE nuclear data library file from raw ACE Neutron CE files. -make_ace_lib.sh + +make_ace_lib.sh Arguments: - Library file to create. - Choose tosearch for CE Neutron cards (ZZAAA.TTc id). or SAB cards (XXXXXX.TTt) - List of files to search for the ID pattern - -The script searches each of the for a presence of an ID pattern (ZZAAA.TTc for CE; -XXXXXX.TTt for SAB card) at a beginning of the line. By ACE definition this should match only -a first line of a header of an ACE card. For each match the script prints a line of the SCONE -nuclear data library file to as: + Library file to create. + Choose tosearch for CE Neutron cards (ZZAAA.TTc id). or SAB cards (XXXXXX.TTt) + Expected suffix in the extension of the ace files + List of files to search for the ID pattern + +The script recursively searches inside for files with the given ; +in each file, it searches for the presence of an ID pattern (ZZAAA.TTc for CE; XXXXXX.TTt for SAB card) +within the first line. By ACE definition this should match only in the first line of a header of an +ACE card. For each match the script prints a line of the SCONE nuclear data library file to as: ZAID; LINE_NUMBER; FILE; ... " # Display help if number of arguments is wrong -if [ $# -le 2 ]; then +if [ $# -ne 4 ]; then echo "${HELP}" exit 1 fi @@ -26,7 +27,14 @@ fi # Pop first argument to be the library file OUTNAME=$1 MODE=$2 -shift 2 +SUFFIX=$3 +SEARCH_DIR=$4 + +# Check a path to directory is given correctly +if [ ! -d "$SEARCH_DIR" ]; then + echo "Error: '$SEARCH_DIR' is not a directory" + exit 1 +fi # If file already exists ask for confirmation and remove it if [ -f $OUTNAME ]; then @@ -38,19 +46,26 @@ if [ -f $OUTNAME ]; then rm $OUTNAME fi +FILES=() +while IFS= read -r -d '' f; do + FILES+=("$f") +done < <( + find "$SEARCH_DIR" -type f -name "*.*${SUFFIX}" -print0 +) + +if [ "${#FILES[@]}" -eq 0 ]; then + echo "No files with extension '.*${SUFFIX}' found in ${SEARCH_DIR}" + exit 1 +fi + # Process each ACE file with awk -for var in $@ +for var in "${FILES[@]}"; do - if [ ! -f $var ]; then - echo -e "File '${var}' does not exist \U0001F61E" - echo -e "Quitting \U0001F44B" - exit 1 - fi # We need full path to put in the file - FULL_PATH=$(realpath $var) + FULL_PATH=$(realpath "$var") + echo "Processing file $var" - echo "Processing file ${var}" if [[ $MODE =~ ^CE$ ]]; then awk -v FILE=$FULL_PATH \ '/^[[:space:]]*[[:digit:]][[:digit:]][[:digit:]][[:digit:]][[:digit:]]?.[[:digit:]][[:digit:]]c/\ @@ -66,4 +81,4 @@ do exit 1 fi -done +done \ No newline at end of file From 49c1f7c97c8da1728df65d6d1ac715ced0c23c30 Mon Sep 17 00:00:00 2001 From: valeriaRaffuzzi <108435337+valeriaRaffuzzi@users.noreply.github.com> Date: Wed, 14 Jan 2026 17:49:57 +0000 Subject: [PATCH 5/7] Update scripts/make_ace_lib.sh --- scripts/make_ace_lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/make_ace_lib.sh b/scripts/make_ace_lib.sh index 45ad6865d..512a4a127 100755 --- a/scripts/make_ace_lib.sh +++ b/scripts/make_ace_lib.sh @@ -8,7 +8,7 @@ Arguments: Library file to create. Choose tosearch for CE Neutron cards (ZZAAA.TTc id). or SAB cards (XXXXXX.TTt) Expected suffix in the extension of the ace files - List of files to search for the ID pattern + Path of the base directory where to search in The script recursively searches inside for files with the given ; in each file, it searches for the presence of an ID pattern (ZZAAA.TTc for CE; XXXXXX.TTt for SAB card) From 7ce78a4352f13c5647b8bb8803aae3ed73113253 Mon Sep 17 00:00:00 2001 From: "V. Raffuzzi" Date: Thu, 15 Jan 2026 21:15:05 +0000 Subject: [PATCH 6/7] update docs --- docs/Installation.rst | 18 +++++++++++++----- scripts/make_ace_lib.sh | 15 ++++++++------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/docs/Installation.rst b/docs/Installation.rst index 5eed6dbd8..d7af3f60d 100644 --- a/docs/Installation.rst +++ b/docs/Installation.rst @@ -271,15 +271,23 @@ To generate the library file from the collection of raw ACE files one can use th .. code-block:: bash - ./scripts/make_ace_lib.sh /path/lib.xsfile CE ./path_to_ace_files/*.ace + ./scripts/make_ace_lib.sh + +To get extra help run the script without any arguments. In the line above, is the file that +will be created; can be either ``CE`` for continuous energy neutron data cards and ``SAB`` for +thermal scattering S(α,β) cards; is the final part of the extension that is common to +all the ace files of interest; is the path to the folder than contains the ace +files. The script can search recursively inside folder structures too. An example call is: + +.. code-block:: bash + + ./scripts/make_ace_lib.sh ./endfb8.aceXS CE nc ./Lib80x/ -To get extra help run the script without any arguments. The ``CE`` letters allow to select between -searching for continuous energy neutron data cards and thermal scattering S(α,β) cards (SAB mode). Sadly the script can search only for a single type of card in one pass. Thus to create a full library with thermal data we need to do the following: .. code-block:: bash - ./scripts/make_ace_lib.sh ./tempCE CE ./path_to_CE_ace_files/*.ace - ./scripts/make_ace_lib.sh ./tempSAB SAB ./path_to_SAB_ace_files/*.ace + ./scripts/make_ace_lib.sh ./tempCE CE ace ./path_to_CE_ace_files/ + ./scripts/make_ace_lib.sh ./tempSAB SAB t ./path_to_SAB_ace_files/ cat tempCE tempSAB > fullLib.xsfile diff --git a/scripts/make_ace_lib.sh b/scripts/make_ace_lib.sh index 45ad6865d..904ce7d9f 100755 --- a/scripts/make_ace_lib.sh +++ b/scripts/make_ace_lib.sh @@ -7,13 +7,14 @@ make_ace_lib.sh Arguments: Library file to create. Choose tosearch for CE Neutron cards (ZZAAA.TTc id). or SAB cards (XXXXXX.TTt) - Expected suffix in the extension of the ace files - List of files to search for the ID pattern - -The script recursively searches inside for files with the given ; -in each file, it searches for the presence of an ID pattern (ZZAAA.TTc for CE; XXXXXX.TTt for SAB card) -within the first line. By ACE definition this should match only in the first line of a header of an -ACE card. For each match the script prints a line of the SCONE nuclear data library file to as: + Expected ending in the extension of the ace files + Path of the base directory where to search in + +The script recursively searches inside for files with an extension that ends with +the given common ; in each file, it searches for the presence of an ID pattern (ZZAAA.TTc for CE; +XXXXXX.TTt for SAB card) within the first line. By ACE definition this should match only in the first +line of a header of an ACE card. For each match the script prints a line of the SCONE nuclear data library +file to as: ZAID; LINE_NUMBER; FILE; ... " From 941bd49b2406f11f8faf94dddb704cd3ab6f114f Mon Sep 17 00:00:00 2001 From: "V. Raffuzzi" Date: Wed, 18 Feb 2026 13:29:07 +0000 Subject: [PATCH 7/7] Make ace script a bit more general --- docs/Installation.rst | 15 ++++++++++----- scripts/make_ace_lib.sh | 18 +++++++++--------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/docs/Installation.rst b/docs/Installation.rst index 23ca3f295..cd3ac5e58 100644 --- a/docs/Installation.rst +++ b/docs/Installation.rst @@ -308,17 +308,22 @@ To generate the library file from the collection of raw ACE files one can use th .. code-block:: bash - ./scripts/make_ace_lib.sh + ./scripts/make_ace_lib.sh To get extra help run the script without any arguments. In the line above, is the file that will be created; can be either ``CE`` for continuous energy neutron data cards and ``SAB`` for -thermal scattering S(α,β) cards; is the final part of the extension that is common to -all the ace files of interest; is the path to the folder than contains the ace -files. The script can search recursively inside folder structures too. An example call is: +thermal scattering S(α,β) cards; will restrict the search to files that include this +keyword in their name; is the path to the folder than contains the ace files. +The script can search recursively inside folder structures too. + +Some useful choices for the input could be: ``ace``, ``nc`` (e.g., for ENDFB/VIII.0), +``t`` for thermal scattering data, ``sssth`` for the Serpent thermal scattering file, or ``'*'`` to +search all files available in the path specified. Some example calls are: .. code-block:: bash - ./scripts/make_ace_lib.sh ./endfb8.aceXS CE nc ./Lib80x/ + ./scripts/make_ace_lib.sh ./endfb8.aceXS CE nc ./Lib80x/ + ./scripts/make_ace_lib.sh ./jeff40.aceXS CE '*' ./JEFF40/ Sadly the script can search only for a single type of card in one pass. Thus to create a full library with thermal data we need to do the following: diff --git a/scripts/make_ace_lib.sh b/scripts/make_ace_lib.sh index 904ce7d9f..702a46447 100755 --- a/scripts/make_ace_lib.sh +++ b/scripts/make_ace_lib.sh @@ -2,16 +2,16 @@ HELP="Create a SCONE nuclear data library file from raw ACE Neutron CE files. -make_ace_lib.sh +make_ace_lib.sh Arguments: - Library file to create. - Choose tosearch for CE Neutron cards (ZZAAA.TTc id). or SAB cards (XXXXXX.TTt) - Expected ending in the extension of the ace files + Library file to create. + Choose tosearch for CE Neutron cards (ZZAAA.TTc id). or SAB cards (XXXXXX.TTt) + Keyword expected within the name of the ace files (e.g., ace, nc, t, ENDF, sssth) Path of the base directory where to search in -The script recursively searches inside for files with an extension that ends with -the given common ; in each file, it searches for the presence of an ID pattern (ZZAAA.TTc for CE; +The script recursively searches inside for files with a name that includes the given +common ; in each file, it searches for the presence of an ID pattern (ZZAAA.TTc for CE; XXXXXX.TTt for SAB card) within the first line. By ACE definition this should match only in the first line of a header of an ACE card. For each match the script prints a line of the SCONE nuclear data library file to as: @@ -28,7 +28,7 @@ fi # Pop first argument to be the library file OUTNAME=$1 MODE=$2 -SUFFIX=$3 +WORD=$3 SEARCH_DIR=$4 # Check a path to directory is given correctly @@ -51,11 +51,11 @@ FILES=() while IFS= read -r -d '' f; do FILES+=("$f") done < <( - find "$SEARCH_DIR" -type f -name "*.*${SUFFIX}" -print0 + find "$SEARCH_DIR" -type f -name "*${WORD}*" -print0 ) if [ "${#FILES[@]}" -eq 0 ]; then - echo "No files with extension '.*${SUFFIX}' found in ${SEARCH_DIR}" + echo "No files with format '*${WORD}*' found in ${SEARCH_DIR}" exit 1 fi