Example

mat_metal.cpp

MatMetal::MatMetal()
{
    // Enable GPU implementation of this material model
    gpu_enabled = true;

    // Material configuration
    num_hist       =  6;    // Number of state variables per integration point
    pos_epsp       =  0;    // For prop damage, sensor output
    pos_temp       =  4;    // For prop damage, prop thermal
    pos_texture    = -1;    // For texture, not used by this material model
    pos_damage     =  1;    // For damage, position in the state variable array
    erode_flag     =  2;    // Erosion flag (0=no erosion, 1=element erosion, 2=node splitting)
    pos_erode_flag = -1;    // Not used, since this material model does not use element erosion
    pos_depsp      =  5;    // For prop damage
    pos_rate       = -1;    // For prop damage
    pos_evol       = -1;    // For prop damage
    pos_damage1    =  1;    // For prop damage
    pos_damage2    =  2;    // For prop damage

    // Curve definitions
    curve.emplace_back(6);     // A curve ID is present at position 6 in the material parameter array (cmat)

    // Add the location in the state variable array and the output name for contour plot
    contour.emplace_back(std::make_pair(0, "Effective plastic strain"));
    contour.emplace_back(std::make_pair(1, "Damage"));
    contour.emplace_back(std::make_pair(4, "Temperature"));

    // Stiffness reduction (for GPU only)
    stiff_shear = NO_REDUCTION;
    stiff_bulk  = NO_REDUCTION;
    stiff_xi    = NO_REDUCTION;
    stiff_bfac  = NO_REDUCTION;
}