t4_geom_convert.Kernel.FileHandlers.Parser package

Submodules

t4_geom_convert.Kernel.FileHandlers.Parser.ParseMCNPCell module

exception t4_geom_convert.Kernel.FileHandlers.Parser.ParseMCNPCell.MissingLatticeOptError

Bases: Exception

An exception class to raise when the --lattice option is missing.

class t4_geom_convert.Kernel.FileHandlers.Parser.ParseMCNPCell.ParseMCNPCell(mcnp_parser, cell_cache_path, lattice_params)

Bases: object

Class that parses the CELLS block.

LIKE_RE = re.compile('like\\s+(\\d+)\\s+but')
static apply_but(parsed_cell, but_options)

Extend the list of cell options with the BUT options.

parse()

:brief method which permit to recover the information of each line of the block CELLS :return: dictionary which contains the ID of the cells as a key and as a value, a object from the CellMCNP class.

parse_all_cells()

Actually parse the cells.

parse_fill_kw(elt, kw_list)

Parse the arguments of the FILL and *FILL keywords.

parse_importance_cards()

Parse any importance cards and return the maximum importance value for each cell.

Returns:

the maximum importances.

Return type:

list(float)

parse_keywords(kw_list)

Parse the list of keywords following the cell definition.

static parse_lat_kw(kw_list)

Parse the argument of the LAT keyword.

static parse_material(material)

Parse the material/density pair.

parse_one_cell(parsed_cells, rank, lat_opt, parsed_cell)

Handle the LIKE n BUT syntax, delegate the real parsing to parse_one_cell_worker().

parse_one_cell_worker(rank, lat_opt, parsed_cell)

Parse one cell, return new CellMCNP object.

parse_trcl_kw(elt, kw_list)

Parse the arguments of the TRCL and *TRCL keywords.

static to_fillid(kws, lat_opt)

Convert the values of the fill-related keywords into a single fillid specification.

exception t4_geom_convert.Kernel.FileHandlers.Parser.ParseMCNPCell.ParseMCNPCellError

Bases: Exception

An exception class for errors in MCNP cell parsing.

t4_geom_convert.Kernel.FileHandlers.Parser.ParseMCNPComposition module

t4_geom_convert.Kernel.FileHandlers.Parser.ParseMCNPComposition.parseMCNPComposition(mcnpParser)

:brief method which permit to recover the information of each line of the block SURFACE :return: dictionary which contains the ID of the materials as a key and as a value, a object from the class CCompositionMCNP

t4_geom_convert.Kernel.FileHandlers.Parser.ParseMCNPSurface module

t4_geom_convert.Kernel.FileHandlers.Parser.ParseMCNPSurface.normalize_surface(typ, params)

Put the surface parametrization in a canonical form. For instance, planes defined by three points are transformed into the equivalent (A,B,C,D) representation.

t4_geom_convert.Kernel.FileHandlers.Parser.ParseMCNPSurface.parseMCNPSurface(mcnp_parser)

Function that recovers the information of each line of the block SURFACE.

Returns:

dictionary with keys given by the ID of the surfaces, as a MIP Surface, and value given by lists of (:class:`~.SurfaceMCNP, int)` pairs. The integer represents the side of the subsurface.

t4_geom_convert.Kernel.FileHandlers.Parser.ParseMCNPSurface.to_surface_mcnp(key, bound_cond, transform_id, enum_surface, params, transform_parsed)

Convert the parsed surface into a SurfaceMCNP.

t4_geom_convert.Kernel.FileHandlers.Parser.ParseMCNPSurface.to_surfaces_macro(key, bound_cond, transform_id, enum_surface, params, transform_parsed)

Convert the parsed macro body into a collection of SurfaceMCNP.

t4_geom_convert.Kernel.FileHandlers.Parser.ParseMCNPSurface.to_surfaces_mcnp(key, parsed_surface, transform_parsed)

Convert the parsed surface into a collection of SurfaceMCNP.

This function returns a list of (int, SurfaceMCNP) pairs. The integers represent the side of the surface that should be considered as positive (±1).

Module contents