Prosty UMAT w C++
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
#include <math.h> #include <iostream> using namespace std; extern "C" void uhard(double *, double *, double *, double *, double *, double *, double *, double *, int *, int *, int *, int *, int *, int *, char *, int *, double *, int *, double *, double *, int*, double *); /** User subroutine UHARD: is called at all material calculation points of elements for which the material definition includes user-defined isotropic hardening or cyclic hardening for metal plasticity; - can be used to define a material's isotropic yield behavior; - can be used to define the size of the yield surface in a combined hardening model; - can include material behavior dependent on field variables or state variables; - and requires, when appropriate, that the values of the derivatives of the yield stress (or yield surface size in combined hardening models) be defined with respect to the strain, strain rate, and temperature. */ void uhard(double *syield, double *hard, double *eqplas, double *eqplasrt, double *time, double *dtime, double *temp, double *dtemp, int *noel, int *npt, int *layer, int *kspt, int *kstep, int *kinc, char *cmname, int *nstatev, double *statev, int *numfieldv, double *predef, double *dpred, int *numprops, double *props) { // USER CODING TO DEFINE: // SYIELD - (sigma_0) - Yield stress for isotropic plasticity. Yield surface size for combined hardening. // hard[0] - Variation of SYIELD with respect to the equivalent plastic strain // hard[1] - Variation of SYIELD with respect to the equivalent plastic strain rate, This quantity is not used with the combined hardening model. // hard[2] - Variation of SYIELD with respect to temperature, This quantity is required only in adiabatic, fully coupled temperature-displacement, and thermal-electrical-structural analyses. // statev@nstatev - Array containing the user - defined solution - dependent state variables at this point.These are supplied as values at the beginning of the increment or as values updated by other user subroutines and must be returned as values at the end of the increment. // VARIABLES PASSED IN FOR INFORMATION: // eqplas - Equivalent plastic strain // eqplasrt - Equivalent plastic strain rate // time[0] - Value of step time at the beginning of the current increment. // time[1] - Value of total time at the beginning of the current increment. // dtime - Time increment // temp - Temperature at the beginning of the increment. // dtemp - Increment of temperature. // noel - Element number. // npt - Integration point number. // layer - Layer number(for composite shells and layered solids). // kspt - Section point number within the current layer. // kstep - Step number. // kinc - Increment number. // cmname - User - specified material name, left justified. // nstatv - User - specified number of solution - dependent state variables associated with this material // numfieldv - Number of field variables. // predef@numfieldv - Array of interpolated values of predefined field variables at this material point at the start of the increment based on the values read in at the nodes(initial values at the beginning of the analysis and current values during the analysis). // dpred@numfieldv - Array of increments of predefined field variables at this material point for this increment; this includes any values updated by user subroutine USDFLD. // numprops - Number of hardening properties entered for this user - defined hardening definition. // props@numprops - Array of hardening properties entered for this user - defined hardening definition. double a = 800; double n = 0.2; const double zero = 0.0; double eps = 0; if(*eqplas == zero) { eps = 0.01; } // syield - Naprezenie - obliczone na podstawie odksztalcenia eqpla *syield = a * powf(eps, n); // hard[0] - wartosc pochodnej po odksztalceniu hard[0] = a * n * powf(eps, n - 1); // hard[1] - wartosc pochodnej po predkosci odksztalcenia // hard[2] - wartosc pochodnej po temperaturze return; } |
