Damage Plasticity Model for plane stress problems based on Unger papers [1,2] in which plasticity is computed seperately from damage behavior with no hardening in compression.
Material: A variable containing material properties Material.E (modulus of elasticity), Material.v (poisson ratio) , Material.f_t (tensile strength), Material.g_f (normalized fracture energy), Material.f_c (uniaxial compressive strength) and Material.f_c2 (biaxial compressive strength)
Material_State: A history variable containing material state variables at previous increment or iteration. it includes Material_State.s (stress vector) , Material_State.e (strain vector) and Material_State.s_eff (effective stress), Material.k_RK (Rankine plastic multiplier), Material.k_DP (Drucker-Prager plastic multiplier), Material.k_D (maximium equivalent plastic strain), Material.d (damage).
Initial values for these history variables should be zeros
IMPORTANT: for this model, this variable should be called from the last converged state of material ((i.e. end of previous increment not from the last iteration) in order to avoid spurious unloading. See Section 6.2 in Crisfrield book 
e: Strain vector in the current iteration.
Material_State2: A history variable containing material state variables at current iteration
D: consistent tangent stiffness matrix
Note: More flow chart for return mapping algorithm are found in other references [4,5].
 Unger, Jörg F., Stefan Eckardt, and C. Kooenke. "A mesoscale model for concrete to simulate mechanical failure." Computers & Concrete 8.4 (2011): 401-423.
 Unger, Jörg F., and Stefan Eckardt. "Multiscale modeling of concrete." Archives of Computational Methods in Engineering18.3 (2011): 341.
 Crisfield, Michael A. Non-linear finite element analysis of solids and structures. Vol. 1. Wiley, 1993.
 Simo, Juan C., and Thomas JR Hughes. Computational inelasticity. Vol. 7. Springer Science & Business Media, 2006.
 Sena-Cruz, José, Joaquim AO Barros, and Álvaro FM Azevedo. Elasto-plastic multi-fixed smeared crack model for concrete. Universidade do Minho. Departamento de Engenharia Civil (DEC), 2004.o Minho. Departamento de Engenharia Civil (DEC), 2004.
Ayad Al-Rumaithi (2020). Damage Plasticity Model (Plane Stress) (https://www.mathworks.com/matlabcentral/fileexchange/74659-damage-plasticity-model-plane-stress), MATLAB Central File Exchange. Retrieved .