## Keyboard shortcuts

Press `←` or `→` to navigate between chapters

Press `S` or `/` to search in the book

Press `?` to show this help

Press `Esc` to hide this help

# Material properties

## Class member variables

    bool gpu_enabled;
    int num_hist;
    int pos_epsp;
    int pos_temp;
    int pos_texture;
    int pos_damage;
    int erode_flag;
    int pos_erode_flag;
    std::vector<int> curve;
    std::vector<std::pair<int, std::string>> contour;

## Description

    bool gpu_enabled

Set to `true` if GPU acceleration should be used, otherwise `false`.

    int num_hist

The number of state variables used by each material model. The state variable array (`p_history`) is a container where one can store data for each integration point. These variables can change throughout the simulation.

    int pos_epsp

Specifies where in the state variables array (`p_history`) the effective plastic strain variable is located. This is also used for damage properties.

    int pos_temp

Thermal definition from for example `*INITIAL_TEMPERATURE` can be obtained through the `pos_temp` value. The value set will specify where in the state variables array (`p_history`) to set the initial temperature. This is also used for damage properties.

    int pos_texture

When implementing material models using fiber direction (for example fiber composites) with `*INITIAL_MATERIAL_DIRECTION_WRAP`, a texture location must be set. The location tells IMPETUS Solver where in the state variables array (`p_history`) to set the initial fiber direction. It requires 9 slots (3 vectors) in the state variables array (from the specified index). Make sure to allocate enough space when setting `num_hist`.

    int pos_damage

When node splitting is enabled (erode_flag = 2), the engine must know which damage variable to use. `pos_damage` shall point to where (index) in the state variable array (`p_history`) the damage is stored.

    int erode_flag

Specifies how the material model should handle damage evolution.

- `0`: no element erosion / node splitting
- `1`: element erosion
- `2`: node splitting

    int pos_erode_flag

Specifies the position of the erosion flag defined in material parameter list (`p_cmat` / `cmat`). If `pos_erode_flag` is set, the value in this position in `cmat` will be copied to `cmat[80]`.

    std::vector<int> curve

Specifies where in the material parameter list (`p_cmat` / `cmat`) the curve / function ID’s are located. Up to 50 curves can be specified per material models. Use `curve.emplace_back(id)` to add new entries.

    std::vector<std::pair<int, std::string>> contour

Set a specific state variable for output, which can then be visualised as a contour plot in the GUI. Use `contour.emplace_back(id, "Contour plot name");` to add new entries.