4#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(WIN64) || defined(__WIN64__) || defined(_WIN64)
6#define _CRT_SECURE_NO_DEPRECATE
9#if defined (__linux) || defined (linux) || defined(__linux__)
13#if defined (__MACH) || defined (MACH) || defined(__MACH__)
39#define SMSMIN(a,b) (((a)<(b))?(a):(b))
42#define SMSMAX(a,b) (((a)>(b))?(a):(b))
49#define DLLEXPORT __declspec(dllexport)
58#define _copysign copysign
73#define _copysign copysign
86#define ID_IDataLength 0
87#define ID_RDataLength 1
92#define ID_TotalIteration 6
93#define ID_LinearEstimate 7
94#define ID_ErrorStatus 8
95#define ID_MaterialState 9
96#define ID_NoSensParameters 10
97#define ID_ElementShape 11
98#define ID_SensIndex 12
99#define ID_OutputFile 13
100#define ID_MissingSubroutine 14
101#define ID_SubDivergence 15
102#define ID_ElementState 16
106#define ID_NoElements 20
108#define ID_MaxEquations 22
110#define ID_NoDimensions 24
111#define ID_SymmetricTangent 25
112#define ID_MinNoTmpData 26
113#define ID_NoEquations 27
114#define ID_NegativePivots 28
116#define ID_NoSubIterations 30
117#define ID_CurrentElement 31
118#define ID_MaxPhysicalState 32
119#define ID_ExtrapolationType 33
120#define ID_TmpContents 34
121#define ID_AssemblyNodeResidual 35
122#define ID_NodeReordering 36
123#define ID_SkipSolver 37
125#define ID_SetSolver 39
126#define ID_NoDesignVelocityFields 40
127#define ID_GeometricTangentMatrix 41
128#define ID_DataMemory 42
129#define ID_SolverMemory 43
131#define ID_ErrorElement 45
132#define ID_SkipTangent 46
133#define ID_SkipResidual 47
134#define ID_SubIterationMode 48
140#define ID_ContactProblem 54
141#define ID_Contact1 55
142#define ID_Contact2 56
143#define ID_Contact3 57
144#define ID_Contact4 58
145#define ID_Contact5 59
146#define ID_PostIteration 60
148#define ID_PostIterationCall 62
150#define ID_DebugElement 64
151#define ID_ZeroPivots 65
152#define ID_GlobalIterationMode 66
153#define ID_NoDiscreteEvents 67
154#define ID_LineSearchUpdate 68
155#define ID_NoBackStep 69
156#define ID_SkipSubIteration 70
157#define ID_HideIndeterminate 71
158#define ID_NoMessages 72
159#define ID_MaxMessages 73
160#define ID_NoThreads 74
161#define ID_NoMultipliers 75
162#define ID_NoBCFields 76
163#define ID_NoLinearConstraints 77
164#define ID_DOFScaling 78
165#define ID_SensIndexStart 79
166#define ID_SensIndexEnd 80
167#define ID_SensMaxGroupLength 81
168#define ID_NoFirstOrderDerivatives 82
169#define ID_NoSecondOrderDerivatives 83
170#define ID_NoThirdOrderDerivatives 84
171#define ID_TangentMatrixMemory 85
172#define ID_ArcLengthStatus 86
173#define ID_ArcLengthPredictorSignCriterion 87
174#define ID_ArcLengthMethod 88
175#define ID_NoSystemNodes 89
179#define ID_SolverIDataLength 91
180#define ID_SolverRDataLength 92
181#define ID_NoSensProblems 93
182#define ID_NoShapeFields 94
183#define ID_NoParameterFields 95
184#define ID_VVectorSize 96
185#define ID_NoAllNodes 97
186#define ID_MaxNoNodes 98
187#define ID_MaxNoElements 99
188#define ID_NoSensDerivatives 100
189#define ID_SensRowStart 101
190#define ID_SensRowEnd 102
191#define IData_Last 103
192#define IData_Length 400
194#define ERROR_NoError 0
195#define ERROR_Warning 1
196#define ERROR_StepCut 2
201#define TASK_TangentAndResidual 1
202#define TASK_Residual 2
203#define TASK_SensitivityPseudoLoad 3
204#define TASK_DependentSensitivity 4
205#define TASK_Postprocessing 5
206#define TASK_Tangent 6
207#define TASK_GlobalInitialisation 7
208#define TASK_ElementInitialisation 8
209#define TASK_NodePositionsNormals 9
211#define TMPContents_ZERO 0
212#define TMPContents_Residual 1
213#define TMPContents_Post 2
215#define SOLVER_FALSE 0
220#define SOLVER_PARDISO 5
221#define SOLVER_ITERATIVE 6
223#define RD_Multiplier 0
224#define RD_ResidualError 1
225#define RD_IncrementError 2
227#define RD_SubMFlops 4
229#define RD_TimeIncrement 6
230#define RD_MultiplierIncrement 7
231#define RD_SubIterationTolerance 8
232#define RD_LineSearchStepLength 9
233#define RD_PostMaxValue 10
234#define RD_PostMinValue 11
235#define RD_TotalEnergy 12
236#define RD_PotentialEnergy 13
237#define RD_KineticEnergy 14
243#define RD_Contact1 20
244#define RD_Contact2 21
245#define RD_Contact3 22
246#define RD_Contact4 23
247#define RD_Contact5 24
248#define RD_ContactSearchTolerance 25
255#define RD_XYZRange 32
256#define RD_KAndRTime 33
257#define RD_SolverTime 34
258#define RD_PreviousMultiplierIncrement 35
259#define RD_SpatialTolerance 36
260#define RD_Parameter 37
261#define RD_ParameterIncrement 38
262#define RD_ArcLengthPsi1 39
263#define RD_ArcLengthPsi2 40
264#define RD_ArcLengthDirectionCheck 41
265#define RD_ArcLengthDirectionTolerance 42
266#define RD_MinElementSize 43
268#define RD_SensRTime 45
269#define RD_SensSolTime 46
270#define RD_ProfileTime 47
272#define RData_Length 400
275#define NoGroupData NoDomainData
276#define GroupDataNames DomainDataNames
356#define DEFAULT_USER_ARGUMENTS double*,void*,ElementData*,NodeSpec**,NodeData**,double*,int*
357#ifndef USER1_ARGUMENTS
358#define USER1_ARGUMENTS DEFAULT_USER_ARGUMENTS
360#ifndef USER2_ARGUMENTS
361#define USER2_ARGUMENTS DEFAULT_USER_ARGUMENTS
363#ifndef USER3_ARGUMENTS
364#define USER3_ARGUMENTS DEFAULT_USER_ARGUMENTS
366#ifndef USER4_ARGUMENTS
367#define USER4_ARGUMENTS DEFAULT_USER_ARGUMENTS
369#ifndef USER5_ARGUMENTS
370#define USER5_ARGUMENTS DEFAULT_USER_ARGUMENTS
372#ifndef USER6_ARGUMENTS
373#define USER6_ARGUMENTS DEFAULT_USER_ARGUMENTS
375#ifndef USER7_ARGUMENTS
376#define USER7_ARGUMENTS DEFAULT_USER_ARGUMENTS
382 int (*SetElSpec)(
struct ElementSpec *,
int *,int ,int);
390 void (*User1)(USER1_ARGUMENTS);
391 void (*User2)(USER2_ARGUMENTS);
392 void (*User3)(USER3_ARGUMENTS);
393 void (*User4)(USER4_ARGUMENTS);
394 void (*User5)(USER5_ARGUMENTS);
396 void (*User7)(USER7_ARGUMENTS);
398 int *,
int *,
int *,
double *,
int *,
double *);
400 int *idata,
double **h,
double **ha,
double **hb,
double **dh);
416 int SymmetricTangent;
421 int ShapeSensitivity;
424 int DefaultIntegrationCode;
426 int NoAdditionalData;
430 int CreateDummyNodes;
431 int PostIterationCall;
435 int SensitivityOrder;
436 int WorkingVectorSize;
439 char **DomainDataNames;
450 double *ReferenceNodes;
452 double *AdditionalData;
454 char *AdditionalNodes;
456 char *AdditionalGraphics;
459 double *DoubleSwitch;
460 char **SensitivityNames;
464 int *SensLowerOrderIndex;
467 char *MMAPreIteration;
476 double *PostNodeWeights;
477 int *MMAInitialisation;
486 void (*Execute)(
char *f,
char *m);
487 void (*BreakPoint)(
char *s,
char *c,
int m,
int p);
488 int (*BoundCheck)(
int i,
int j,
int k,
char *m,
char *s,
char *d,
char *e);
491double *SMTIntPoints(
int *icode,
int *ngpo);
493double *SMTMultiIntPoints(
int *icode,
int *idata,
int *ngpo,
int *na,
int *nb,
int *nc,
int all);
495double *SMTSetReferenceNodes(
char *code);
497double SMSDot(
double a[],
double b[],
int n);
499double SMSSum(
double a[],
int n);
501_inline
double SMSDeltaPart(
double *a,
int i,
int j,
int k);
503void SMSMove(
double a[],
double b[],
int n);
505void SMSZero(
double a[],
int n);
507void SMSRecover(
double *hb,
double *hg,
double *du,
int nb,
int ne);
509void SMSCondense(
double **s,
double *p,
double *hb,
double *hg,
int nb,
int ne);
511double SMSIsDOFConstrained(
int i,
double a,
double b);
516#define PD_MAXSensFirstOrder 200
520#define SMSKDelta(i,j) (((i)==(j))?(1e0):(0e0))
521#define Power SMSPower
522#define SMSPower(x,y) (pow((double)(x),(double)(y)))
523#define Sqrt(x) (sqrt((double)(x)))
524#define Cbrt(x) ( x<0 ? -pow(-(double)(x),1./3.) : pow((double)(x),1./3.) )
525#define SMSAbs(x) (fabs((double)(x)))
526#define Less(a,b,c) (a<b && b<c)
527#define LessEqual(a,b,c) (a<=b && b<=c)
528#define Greater(a,b,c) (a>b && b>c)
529#define GreaterEqual(a,b,c) (a>=b && b>=c)
534#define MAX_DATA_LEN 100
536#define OPT_DIVERGENCE "Divergence"
537#define OPT_AUTOMATIC "Automatic"
538#define OPT_TRUE "True"
539#define OPT_FALSE "False"
540#define OPT_LIST "List"
541#define OPT_IGNORE "Ignore"
543#define STAT_N_A "N/A"
544#define STAT_NULL "Null"
545#define STAT_MAX_ITERATIONS "MaxIterations"
546#define STAT_CONVERGENCE "Convergence"
547#define STAT_ERR_STATUS_2 "ErrorStatus-2"
548#define STAT_ALTERNATE "Alternate"
549#define STAT_GLOB_DIVERGENCE "Global divergence"
550#define STAT_ERR_AND_DIVERGENCE "ErrorStatus & Divergence"
551#define STAT_IGNORE_MINB_ALTERNATE "IgnoredMinBound-Alternate"
552#define STAT_IGNORE_MINB_CONV "IgnoredMinBound-Convergence"
553#define STAT_MIN_BOUND "MinBound"
555#define T_Abort "Abort"
556#define T_Interrupt "Interrupt"
557#define T_Analyze "Analyze"
558#define T_AdaptiveBC "Adaptive BC"
559#define T_AdaptivePower "Adaptive Power"
560#define T_AdaptiveTime "Adaptive Time"
561#define T_MaxBound "MaxBound"
562#define T_IgnoredMinBound "IgnoredMinBound"
563#define T_MinBound "MinBound"
565#define TYPE_INT "int"
566#define TYPE_DOUBLE "double"
567#define TYPE_LONG "long"
573 char Alternate[MAX_DATA_LEN];
574 double AlternateList[6];
577 int AlternativeTarget;
578 char Type[MAX_DATA_LEN];
579 int TargetIterations;
589 char Indeterminate[MAX_DATA_LEN];
590 char MaxIterations[MAX_DATA_LEN];
591 char Convergence[MAX_DATA_LEN];
592 char ErrorStatus[MAX_DATA_LEN];
593 char Alternate[MAX_DATA_LEN];
594 char Divergence[MAX_DATA_LEN];
595 char Other[MAX_DATA_LEN];
604 char Report[MAX_DATA_LEN];
620 int FirstAlternateIter;
629 int* NoDiscreteEvents;
630 int NoDiscreteEventsLen;
631 int ConvergedIteration;
632 double ResidualError;
640 double TimeFrequency;
641 double MultiplierFrequency;
642 double StepFrequency;
653 int LastIntegerOutputSize;
654 int LastRealOutputSize;
661 int IntegerOutputLength;
663 int RealOutputLength;
665 int *IntegerOutputForElements;
666 double *RealOutputForElements;
668 double *MatrixGlobal;
669 double *VectorGlobal;
674 char *SimulationDllFile;
676 void (*InitializeConvergence)();
677 int (*NextStep)(double, double, double);
679 int (*Convergence)(double, double,
char *);
680 double (*NewtonIteration)();
681 void (*FreeConvergence)();
683 void (*DumpState)(
char *dumpkey);
684 void (*RestartState)(
char *dumpkey);
685 double (*TimeStamp)(
char *msg);
687 void (*ExportVectorToH5File)(
char *,
char *,
void *, int,
char *);
692 int (*Task)(
char *code);
696 int (*Sensitivity)();
699 int (*FindNodes)(
char *,
int **);
700 int (*FindNodesPoint)(
double *,
char *,
double tol,
int **);
701 int (*FindNodesLine)(
double **, int,
char *,double,
int **);
702 int (*FindNodesPolygon)(
double **, int,
char *,
double tol,
int **);
703 int (*FindNodesTetrahedron)(
double **,
char *,
double tol,
int **);
704 int (*FindNodesHexahedron)(
double **,
char *,
double tol,
int **);
705 int (*FindNodesFunction)(int (*)(
double *, double),
char *,
int **);
706 int (*FindElements)(
int *, int ,int ,
int **);
707 void (*Free)(
void *);
711int RunDllSimulation(
char *dllFileName);
715void MatrixExponentialOMMF(
double m[9],
int *r,
double mf[9]);
716void MatrixExponentialOMMFS(
double m[6],
int *r,
double mf[6]);
717void MatrixExponentialOMM2D(
double m[5],
int *r,
double mf[5]);
718void MatrixExponentialOMM2DS(
double m[4],
int *r,
double mf[4]);
719void MatrixExponentialOMDMF(
double m[9],
int *r,
double mf[9],
double dmf[45]);
720void MatrixExponentialOMDMFS(
double m[6],
int *r,
double mf[6],
double dmf[21]);
721void MatrixExponentialOMDM2D(
double m[5],
int *r,
double mf[5],
double dmf[15]);
722void MatrixExponentialOMDM2DS(
double m[4],
int *r,
double mf[4],
double dmf[10]);
723void MatrixExponentialOMDDMF(
double m[9],
int *r,
double mf[9],
double dmf[45],
double ddmf[165]);
724void MatrixExponentialOMDDMFS(
double m[6],
int *r,
double mf[6],
double dmf[21],
double ddmf[74]);
725void MatrixExponentialOMDDM2D(
double m[5],
int *r,
double mf[5],
double dmf[15],
double ddmf[35]);
726void MatrixExponentialOMDDM2DS(
double m[4],
int *r,
double mf[4],
double dmf[10],
double ddmf[21]);
727void MatrixLogarithmOMMF(
double m[9],
int *r,
double mf[9]);
728void MatrixLogarithmOMMFS(
double m[6],
int *r,
double mf[6]);
729void MatrixLogarithmOMM2D(
double m[5],
int *r,
double mf[5]);
730void MatrixLogarithmOMM2DS(
double m[4],
int *r,
double mf[4]);
731void MatrixLogarithmOMDMF(
double m[9],
int *r,
double mf[9],
double dmf[45]);
732void MatrixLogarithmOMDMFS(
double m[6],
int *r,
double mf[6],
double dmf[21]);
733void MatrixLogarithmOMDM2D(
double m[5],
int *r,
double mf[5],
double dmf[15]);
734void MatrixLogarithmOMDM2DS(
double m[4],
int *r,
double mf[4],
double dmf[10]);
735void MatrixLogarithmOMDDMF(
double m[9],
int *r,
double mf[9],
double dmf[45],
double ddmf[165]);
736void MatrixLogarithmOMDDMFS(
double m[6],
int *r,
double mf[6],
double dmf[21],
double ddmf[74]);
737void MatrixLogarithmOMDDM2D(
double m[5],
int *r,
double mf[5],
double dmf[15],
double ddmf[35]);
738void MatrixLogarithmOMDDM2DS(
double m[4],
int *r,
double mf[4],
double dmf[10],
double ddmf[21]);
739void MatrixSquareRootOMMF(
double m[9],
int *r,
double mf[9]);
740void MatrixSquareRootOMMFS(
double m[6],
int *r,
double mf[6]);
741void MatrixSquareRootOMM2D(
double m[5],
int *r,
double mf[5]);
742void MatrixSquareRootOMM2DS(
double m[4],
int *r,
double mf[4]);
743void MatrixSquareRootOMDMF(
double m[9],
int *r,
double mf[9],
double dmf[45]);
744void MatrixSquareRootOMDMFS(
double m[6],
int *r,
double mf[6],
double dmf[21]);
745void MatrixSquareRootOMDM2D(
double m[5],
int *r,
double mf[5],
double dmf[15]);
746void MatrixSquareRootOMDM2DS(
double m[4],
int *r,
double mf[4],
double dmf[10]);
747void MatrixSquareRootOMDDMF(
double m[9],
int *r,
double mf[9],
double dmf[45],
double ddmf[165]);
748void MatrixSquareRootOMDDMFS(
double m[6],
int *r,
double mf[6],
double dmf[21],
double ddmf[74]);
749void MatrixSquareRootOMDDM2D(
double m[5],
int *r,
double mf[5],
double dmf[15],
double ddmf[35]);
750void MatrixSquareRootOMDDM2DS(
double m[4],
int *r,
double mf[4],
double dmf[10],
double ddmf[21]);
751void MatrixPowerOMMF(
double m[9],
double *p,
int *r,
double mf[9]);
752void MatrixPowerOMMFS(
double m[6],
double *p,
int *r,
double mf[6]);
753void MatrixPowerOMM2D(
double m[5],
double *p,
int *r,
double mf[5]);
754void MatrixPowerOMM2DS(
double m[4],
double *p,
int *r,
double mf[4]);
755void MatrixPowerOMDMF(
double m[9],
double *p,
int *r,
double mf[9],
double dmf[45]);
756void MatrixPowerOMDMFS(
double m[6],
double *p,
int *r,
double mf[6],
double dmf[21]);
757void MatrixPowerOMDM2D(
double m[5],
double *p,
int *r,
double mf[5],
double dmf[15]);
758void MatrixPowerOMDM2DS(
double m[4],
double *p,
int *r,
double mf[4],
double dmf[10]);
759void MatrixPowerOMDDMF(
double m[9],
double *p,
int *r,
double mf[9],
double dmf[45],
double ddmf[165]);
760void MatrixPowerOMDDMFS(
double m[6],
double *p,
int *r,
double mf[6],
double dmf[21],
double ddmf[74]);
761void MatrixPowerOMDDM2D(
double m[5],
double *p,
int *r,
double mf[5],
double dmf[15],
double ddmf[35]);
762void MatrixPowerOMDDM2DS(
double m[4],
double *p,
int *r,
double mf[4],
double dmf[10],
double ddmf[21]);
763void MatrixPowerSeriesOMMF(
double m[9],
double *cp,
int *n,
int *r,
double mf[9]);
764void MatrixPowerSeriesOMMFS(
double m[6],
double *cp,
int *n,
int *r,
double mf[6]);
765void MatrixPowerSeriesOMM2D(
double m[5],
double *cp,
int *n,
int *r,
double mf[5]);
766void MatrixPowerSeriesOMM2DS(
double m[4],
double *cp,
int *n,
int *r,
double mf[4]);
767void MatrixPowerSeriesOMDMF(
double m[9],
double *cp,
int *n,
int *r,
double mf[9],
double dmf[45]);
768void MatrixPowerSeriesOMDMFS(
double m[6],
double *cp,
int *n,
int *r,
double mf[6],
double dmf[21]);
769void MatrixPowerSeriesOMDM2D(
double m[5],
double *cp,
int *n,
int *r,
double mf[5],
double dmf[15]);
770void MatrixPowerSeriesOMDM2DS(
double m[4],
double *cp,
int *n,
int *r,
double mf[4],
double dmf[10]);
771void MatrixPowerSeriesOMDDMF(
double m[9],
double *cp,
int *n,
int *r,
double mf[9],
double dmf[45],
double ddmf[165]);
772void MatrixPowerSeriesOMDDMFS(
double m[6],
double *cp,
int *n,
int *r,
double mf[6],
double dmf[21],
double ddmf[74]);
773void MatrixPowerSeriesOMDDM2D(
double m[5],
double *cp,
int *n,
int *r,
double mf[5],
double dmf[15],
double ddmf[35]);
774void MatrixPowerSeriesOMDDM2DS(
double m[4],
double *cp,
int *n,
int *r,
double mf[4],
double dmf[10],
double ddmf[21]);
776void MatrixFunctionCompressMMF(
double m[3][3],
double mc[9]);
777void MatrixFunctionUncompressMFMF(
double mf[9],
double mffull[3][3]);
778void MatrixFunctionUncompressDMFMF(
double dmf[45],
double dmffull[3][3][3][3]);
779void MatrixFunctionUncompressDDMFMF(
double ddmf[165],
double ddmffull[3][3][3][3][3][3]);
780void MatrixFunctionCompressMMFS(
double m[3][3],
double mc[6]);
781void MatrixFunctionUncompressMFMFS(
double mf[6],
double mffull[3][3]);
782void MatrixFunctionUncompressDMFMFS(
double dmf[21],
double dmffull[3][3][3][3]);
783void MatrixFunctionUncompressDDMFMFS(
double ddmf[74],
double ddmffull[3][3][3][3][3][3]);
784void MatrixFunctionCompressMM2D(
double m[3][3],
double mc[5]);
785void MatrixFunctionUncompressMFM2D(
double mf[5],
double mffull[3][3]);
786void MatrixFunctionUncompressDMFM2D(
double dmf[15],
double dmffull[3][3][3][3]);
787void MatrixFunctionUncompressDDMFM2D(
double ddmf[35],
double ddmffull[3][3][3][3][3][3]);
788void MatrixFunctionCompressMM2DS(
double m[3][3],
double mc[4]);
789void MatrixFunctionUncompressMFM2DS(
double mf[4],
double mffull[3][3]);
790void MatrixFunctionUncompressDMFM2DS(
double dmf[10],
double dmffull[3][3][3][3]);
791void MatrixFunctionUncompressDDMFM2DS(
double ddmf[21],
double ddmffull[3][3][3][3][3][3]);