krakentools.serpentrestarts.mapper.map_material_names

krakentools.serpentrestarts.mapper.map_material_names(mesh1, loading_map1, dir1, input_path1, mesh2, loading_map2, dir2, input_path2, transfers, empty_positions=['w'], plot_patches=False, plot_points=False)

Creates a material mapping from one Serpent calculation to another.

Queries material names from two Serpent calcluations and provides mapping from the starting geometry to the target geometry according to transfers given as input argument. The function uses the input meshes for describing geometries and creating material name queries. Errors in the geometry and transfers can be inspected by enabling plotting.

Parameters:
  • mesh1 (MixedNestedMesh) – Mesh describing the starting Serpent geometry.

  • loading_map1 (str) – Loading map of the starting Serpent geometry.

  • dir1 (str) – Working directory for the starting geometry. Used for queries.

  • input_path1 (str) – Path to starting Serpent calculation input file. Can be relative to the working directory.

  • mesh2 (MixedNestedMesh) – Mesh describing the target Serpent geometry.

  • loading_map2 (str) – Loading map of the target Serpent geometry.

  • dir2 (str) – Working directory for the target geometry. Used for queries.

  • input_path2 (str) – Path to target Serpent calculation input file. Can be relative to the working directory.

  • transfers (Dict[str, str]) – Dictionary describing which assembly is transferred from the starting geometry and where in the target geometry. Keys are tokens in the starting loading map and values are tokens in the target loading map.

  • empty_positions – List of tokens indicating empty spots in the loading map. Defaults to [‘w’].

  • plot_pathces – Option for plotting starting and target geometry.

  • plot_points – Option for plotting starting point lists and target point lists used for material queries.

Return type:

List[Tuple[str]]

Returns:

A tuple containing material names. The first value is a material name in the starting geometry and the second value is the corresponding material name in the target geometry.

Raises:

RuntimeError – If multiple materials are mapped from the starting geometry into a single material in the target geometry.