.. _sec-expandhashall: [ Expand Hash-all ] section ================================================== This section is a preprocessing feature that automatically divides and then expands a background region containing **#all** mainly for air and vacuum. Even without this feature, **#all** is automatically expanded internally by PHITS; however, that automatic expansion may make the number of regions excluded from a single cell excessively large, resulting in memory shortages or longer computation times. In such a case, run PHITS with **icntl=18** using an input file containing **[expand hash-all]**. The background region is then automatically divided, and the expanded result of **#all** is output in a form that excludes only the cells contained in each divided region. Usage flow -------------------------------------------------- The basic workflow is as follows. #. Define a cell containing **#all** in the **[cell]** section. #. Define mesh parameters and the output file name in the **[expand hash-all]** section. #. Run PHITS with **icntl=18**. #. Include the generated ``*_surface`` and ``*_cell`` files in the **[surface]** and **[cell]** sections using the ``infl`` command. #. Comment out the definition of the original background region, namely the cell containing **#all**. #. Reset **icntl=0** and run PHITS in the ordinary particle-transport mode. Input format -------------------------------------------------- .. code-block:: text [ Expand Hash-all ] mesh = xyz x-type = ... nx = ... xmin = ... xmax = ... y-type = ... ny = ... ymin = ... ymax = ... z-type = ... nz = ... zmin = ... zmax = ... file = expand_all.out margin = 1.0 reg xmin xmax ymin ymax zmin zmax ... .. rst-class:: no-caption-number .. list-table:: Main parameters :header-rows: 1 * - Item - Explanation * - **mesh** - Currently, only **xyz** can be specified. * - **x-type**, **nx**, **xmin**, **xmax** - Mesh definition in the x direction. * - **y-type**, **ny**, **ymin**, **ymax** - Mesh definition in the y direction. * - **z-type**, **nz**, **zmin**, **zmax** - Mesh definition in the z direction. * - **file** - Specifies the base output file name. * - **margin** - Margin added to the estimated bounding box in each direction. The default value is **1.0**. The mesh parameters for each axis are specified in the same manner as an ordinary xyz mesh. Among them, **mesh=xyz** and **file** are required. Initial bounding-box table -------------------------------------------------- If necessary, you can provide initial bounding boxes in a table at the end of the section. .. code-block:: text reg xmin xmax ymin ymax zmin zmax 10 -5.0 5.0 -2.0 2.0 0.0 10.0 15 0.0 1.0 0.0 1.0 0.0 1.0 This table is useful when you want to give initial values for narrow regions or regions that are difficult to detect by sampling. The columns are **reg xmin xmax ymin ymax zmin zmax**, and **reg** specifies the target cell number. Generated files -------------------------------------------------- Using the name specified by **file** as the base name, the following three kinds of files are generated. 1. A base file containing the bounding-box table 2. A ``*_surface`` file containing generated surface definitions 3. A ``*_cell`` file containing expanded cell definitions The surface file contains generated **px**, **py**, and **pz** surfaces based on the estimated bounding boxes. The cell file contains expanded cell definitions corresponding to cells containing **#all**. Restrictions and notes -------------------------------------------------- - This feature is available only when **icntl=18** is used. - At present, **MPI parallel execution is not supported**. Use single or OpenMP execution. - The target-cell search is limited to cells with **u=0**. Cells inside universes are not automatically searched. - The cell containing **#all** itself is excluded from bounding-box estimation. - If **margin** is too small, the estimated box may fail to cover the intended region near the boundary. Input example -------------------------------------------------- .. code-block:: text [ parameters ] icntl = 18 [ cell ] 1 0 -10 2 -1 #all [ expand hash-all ] mesh = xyz x-type = 1 nx = 20 xmin = -100.0 xmax = 100.0 y-type = 1 ny = 20 ymin = -100.0 ymax = 100.0 z-type = 1 nz = 20 zmin = -100.0 zmax = 100.0 file = expand_all.out margin = 1.0 This input generates the bounding boxes and include files required to expand **#all**.