2. micmec.builder – The Micromechanical Model Builder.

2.1. micmec.builder.builder_io – Input and output handling of the Micromechanical Model Builder.

Input and output handling of the Micromechanical Model Builder.

micmec.builder.builder_io.build_input(output)

Build the input of the Builder application (builder.py) from a dictionary.

Parameters
outputdict

A dictionary which is ready to be stored as a CHK file, containing a complete description of the micromechanical system.

Returns
datadict

A dictionary with the names of the micromechanical cell types as keys. The corresponding values are dictionaries which contain information about the cell types.

colors_typesdict

A dictionary with integer keys. These integers appear in the three-dimensional grid. The values corresponding to the keys are tuples of a color and the name of a type.

gridnumpy.ndarray, dtype=int, shape=(nx, ny, nz)

A three-dimensional grid that maps the types of cells present in the micromechanical system. An integer value of 0 in the grid signifies an empty cell, a vacancy. An integer value of 1 signifies a cell of type 1, a value of 2 signifies a cell of type 2, etc.

pbclist of bool

The domain vectors for which periodic boundary conditions should be enabled.

Notes

build_input is the inverse operation of build_output.

micmec.builder.builder_io.build_output(data, colors_types, grid, pbc)

Build the output of the Builder application (builder.py) and store it as a dictionary.

Parameters
datadict

A dictionary with the names of the micromechanical cell types as keys. The corresponding values are dictionaries which contain information about the cell types.

colors_typesdict

A dictionary with integer keys. These integers appear in the three-dimensional grid. The values corresponding to the keys are tuples of a color and the name of a type.

gridnumpy.ndarray, dtype=int, shape=(nx, ny, nz)

A three-dimensional grid that maps the types of cells present in the micromechanical system. An integer value of 0 in the grid signifies an empty cell, a vacancy. An integer value of 1 signifies a cell of type 1, a value of 2 signifies a cell of type 2, etc.

pbclist of bool

The domain vectors for which periodic boundary conditions should be enabled.

Returns
outputdict

A dictionary which is ready to be stored as a CHK file, containing a complete description of the micromechanical system.

Notes

build_input is the inverse operation of build_output.