************************************************** Region error check ************************************************** In developing a complex geometry, it is difficult to define the geometry without mistakes such as double-defined or undefined regions. Correspondingly, a function for automatically detecting double-defined or undefined regions was implemented after version 2.67. This geometry check function works when specifying a tally for generating the two-dimensional view of a geometry: such tallies include **[t-gshow]**, **[t-rshow]**, and other tallies involving setting **axis=xy,yz,xz** or the **gshow** (**icntl=8**) or **rshow** (**icntl=10**) options. :numref:`fig-RegionCheck` shows an example of a two-dimensional view with geometry errors. Double-defined regions are painted in black, while undefined regions are in purple. When an undefined region is detected, its surrounding regions may disappear from the figure. .. figure:: ./assets/RegionCheck.png :width: 25em :name: fig-RegionCheck :align: center Output including geometry errors. When PHITS detects a geometry error, a geometry error file named ``[original-tally-name].err`` is output (``[original-tally-name]`` indicates the original tally output file name without the extension). In this file, the :math:`(x,y,z)` coordinates together with the overlapping cell numbers are written as follows: .. code-block:: text :caption: Example of geometry error output Errors of cell definition in EPS Page No. = 1 Overlapped Cell IDs x, y, z coodinates (Cells 0 0 indicate undefined region) 100 102 -4.847761E+00 1.234568E-11 -1.211940E+00 0 0 -4.241791E+00 -2.500000E+00 -8.079602E-01 The first line indicates that cell numbers 100 and 102 overlap at the point ``x=-4.847761E+00, y=1.234568E-11, z=-1.211940E+00``. The second line indicates that an undefined region is detected at the point ``x=-4.241791E+00, y=-2.500000E+00, z=-8.079602E-01``. Geometry errors can easily be found using this geometry check function. Note that the function can detect geometry error only when an error occurs on the grid points of the **xyz** mesh of the tally, while geometry errors outside the tally region cannot be detected. Even in the tally region, a small error region might also remain undetected if the region does not contain a grid point.