Abaqus UMAT/VUMAT Subroutines
The Abaqus UMAT and VUMAT interfaces allow you to integrate the micromechanical models in Abaqus. The following code is an example of the UMAT subroutine:
#include <iostream>
#include "micromechanical/changhicher.hpp"
namespace mm = micromechanical;
extern "C" void umat(double* stress, double* statev, double* ddsdde, double* sse, double* spd, double* scd, double* rpl,
double* ddsddt, double* drplde, double* drpldt, double* stran, double* dstran, double* time,
double* dtime, double* temp, double* dtemp, double* predef, double* dpred, char* cmname, int* ndi,
int* nshr, int* ntens, int* nstatv, double* props, int* nprops, double* coords, double* drot,
double* pnewdt, double* celent, double* dfgrd0, double* dfgrd1, int* noel, int* npt, int* layer,
int* kspt, int* jstep, int* kinc) {
auto model = mm::ChangHicher<double>(mm::ContactLawType::OSIMSAND, mm::Material<double>::osimsand(props));
// Perform an increment
try {
model.abaqus_initialize = *jstep <= 1 && *kinc <= 1;
model.umat(dstran, stress, statev, ddsdde);
} catch (const std::exception& e) {
throw e;
}
}
To compile the subroutine, you need to set the environment variable INCLUDE to the output of the command musica --include and set the environment variable CL to /bigobj /std:c++17. After that, you can use the following command to compile the it:
After compilation, you can use the generated library in your Abaqus model, i.e.:
State variables
SDV1-SDV6: StressSDV7-SDV12: StrainSDV13-SDV18: Plastic strainSDV19-SDV24: Deviatoric fabric tensorSDV25: Void ratioSDV26: Critical void ratio
SDV1-SDV6: StressSDV7-SDV12: StrainSDV13-SDV18: Plastic strainSDV19-SDV24: Deviatoric fabric tensorSDV25: Void ratioSDV26: Critical void ratioSDV27-SDV137: Contact forces (37*3, rowwise)SDV138-SDV248: Contact displacements (37*3, rowwise)SDV249-SDV285: Work (37)SDV286-SDV396: Plastic contact displacements (37*3, rowwise)
SDV1-SDV6: StressSDV7-SDV12: StrainSDV13-SDV18: Plastic strainSDV19-SDV24: Deviatoric fabric tensorSDV25: Void ratioSDV26: Critical void ratioSDV27-SDV209: Contact forces (61*3, rowwise)SDV210-SDV392: Contact displacements (61*3, rowwise)SDV393-SDV453: Work (61)SDV454-SDV636: Plastic contact displacements (61*3, rowwise)