OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
userlib.h
Go to the documentation of this file.
1//Copyright> OpenRadioss
2//Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3//Copyright>
4//Copyright> This program is free software: you can redistribute it and/or modify
5//Copyright> it under the terms of the GNU Affero General Public License as published by
6//Copyright> the Free Software Foundation, either version 3 of the License, or
7//Copyright> (at your option) any later version.
8//Copyright>
9//Copyright> This program is distributed in the hope that it will be useful,
10//Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11//Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12//Copyright> GNU Affero General Public License for more details.
13//Copyright>
14//Copyright> You should have received a copy of the GNU Affero General Public License
15//Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16//Copyright>
17//Copyright>
18//Copyright> Commercial Alternative: Altair Radioss Software
19//Copyright>
20//Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21//Copyright> software under a commercial license. Contact Altair to discuss further if the
22//Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23/* ---------------
24 Global Headers
25 --------------- */
26
27#include <hardware.inc>
28#include <stdio.h>
29#include <string.h>
30#include <stdlib.h>
31#include <math.h>
32#include <fcntl.h>
33
34#define _FCALL
35
36
37#ifdef _WIN64
38
39#include <windows.h>
40#include <process.h>
41#include <io.h>
42#include <sys\types.h>
43#include <sys/stat.h>
44
45#elif 1
46
47#include <sys/resource.h>
48#include <sys/types.h>
49#include <time.h>
50#include <sys/stat.h>
51#include <unistd.h>
52#include <dlfcn.h>
53
54#endif
55
56
57/* ----------------------------------------------------------
58 include containing the routine pointers from userlibrary
59 ---------------------------------------------------------- */
60
61#ifdef MYREAL4
62#define my_real float
63#endif
64
65#ifdef MYREAL8
66#define my_real double
67#endif
68
69
70/*
71 ------------------------------------------------
72 Set libname / extension according to Arch name
73 ------------------------------------------------
74*/
75
76
77/* ------------ */
78/* WIN64 Macros */
79/* ------------ */
80#ifdef _WIN64
81
82#define ULIB_ARCH "_win64"
83#define ULIB_EXT ".dll"
84
85
86
87HINSTANCE mds_userlibhandler;
88
89#endif
90
91
92/* ------------ */
93/* Linux Macros */
94/* ------------ */
95
96#if CPP_mach==CPP_p4linux964
97
98 #define ULIB_EXT ".so"
99
100 #if CPP_rel==70
101 #define ULIB_ARCH "_linuxa64"
102 #elif 1
103 #define ULIB_ARCH "_linux64"
104 #endif
105
106#endif
107
108
109
110#define ULIB_SP "_sp"
111
113
114/*
115 -------------------------------
116 Current user library routines
117 -------------------------------
118*/
119
120
122
123void (*mds_userlib_id)(int * info);
124
125/* NEW MDS Starter Routine */
126void (*eng_mds_c) ( int * NCYCLE, int * MID, int * ELEMENT_UID ,
127 int * NEL , int * NPT, int * IT ,int * ILAY,int * IPG ,int * IFLAG,
128 my_real *UPARAM ,int * NUPARAM , my_real *UVAR ,int * NUVAR,
129 int *NFUNC , int *IFUNC , my_real FUNCTION_ARRAY ,int * NPF ,
130 my_real * TIME, my_real *TIMESTEP , my_real * RHO0, my_real *AREA, my_real *EINT,
131 my_real * THKLY ,my_real * THK ,my_real * SHF ,my_real * ETSE ,
132 my_real * EPSPXX ,my_real * EPSPYY ,my_real * EPSPXY ,my_real * EPSPYZ ,my_real * EPSPZX ,
133 my_real * DEPSXX ,my_real * DEPSYY ,my_real * DEPSXY ,my_real * DEPSYZ ,my_real * DEPSZX ,
134 my_real * EPSXX ,my_real * EPSYY ,my_real * EPSXY ,my_real * EPSYZ ,my_real * EPSZX ,
135 my_real * SOUNDSP ,my_real * VISCMAX ,my_real * PLA ,my_real * OFF ,
136 my_real * TEMP ,my_real * R11 ,my_real * R12 ,my_real * R13 ,my_real * R21 ,
137 my_real * R22 ,my_real * R23 ,my_real * R31 ,my_real * R32 ,my_real * R33 ,
138 my_real * SIGY ,my_real * SIGOXX ,my_real * SIGOYY ,my_real * SIGOXY ,my_real * SIGOYZ ,
139 my_real * SIGOZX ,my_real * SIGNXX ,my_real * SIGNYY ,my_real * SIGNXY ,
140 my_real * SIGNYZ ,my_real * SIGNZX ,my_real * SIGVXX ,my_real * SIGVYY ,my_real * SIGVXY ,
141 my_real * SIGVYZ ,my_real * SIGVZX ,my_real * DPLA ,
142 my_real * ADDITIONAL_FLT_PARAMETERS,my_real * ADDITIONAL_INT_PARAMETERS );
143
144void (*eng_mds_s) ( int * NCYCLE ,int * ID,int * IPTR,int * IPTS,int * IPTT,
145 int * NEL ,int * ELEMENT_UID,int * NUPARAM ,int *NUVAR ,int *NFUNC ,int *IFUNC ,
146 int * NPF ,my_real * FUNCTION_ARRAY,my_real * TIME ,my_real * TIMESTEP ,my_real * UPARAM ,my_real * UVAR ,
147 my_real * RHO0 ,my_real * RHO ,my_real * VOLUME ,my_real * EINT ,my_real * TEMP ,my_real * AMU ,
148 my_real * EPSPXX ,my_real * EPSPYY ,my_real * EPSPZZ ,my_real * EPSPXY ,my_real * EPSPYZ ,my_real * EPSPZX ,
149 my_real * DEPSXX ,my_real * DEPSYY ,my_real * DEPSZZ ,my_real * DEPSXY ,my_real * DEPSYZ ,my_real * DEPSZX ,
150 my_real * EPSXX ,my_real * EPSYY ,my_real * EPSZZ ,my_real * EPSXY ,my_real * EPSYZ ,my_real * EPSZX ,
151 my_real * SIGOXX ,my_real * SIGOYY ,my_real * SIGOZZ ,my_real * SIGOXY ,my_real * SIGOYZ ,my_real * SIGOZX ,
152 my_real * SIGNXX ,my_real * SIGNYY ,my_real * SIGNZZ ,my_real * SIGNXY ,my_real * SIGNYZ ,my_real * SIGNZX ,
153 my_real * SIGVXX ,my_real * SIGVYY ,my_real * SIGVZZ ,my_real * SIGVXY ,my_real * SIGVYZ ,my_real * SIGVZX ,
154 my_real * SOUNDSP ,my_real * VISCMAX ,my_real * OFF ,my_real * R11 ,my_real * R12 ,my_real * R13 ,
155 my_real * R21 ,my_real * R22 ,my_real * R23 ,my_real * R31 ,my_real * R32 ,my_real * R33 ,
156 int * ISMSTR ,my_real * ISMSTR10_ARRAYS ,my_real * PLA ,my_real * DPLA ,my_real * SIGY ,
157 my_real * ADDITIONAL_FLT_PARAMETERS, int * ADDITIONAL_INT_PARAMETERS ) ;
158
159void (*mds_eng_user_check) ( int *MY_RANK, double *TSTOP, int *NCYCLE, double *TT, int *MSTOP ) ;
160
161void (*mds_eng_user_finalize) ( int *MY_RANK ) ;
162
163void (*mds_eng_user_initialize) (int *NSPMD, int *NTHREAD, int *MY_RANK,double *TSTOP,
164 int * MDS_NMAT, int * MDS_MATID, char * MDS_FILES, char * MDS_LABEL, int * MDS_NDEPSVAR,int * MDS_MAXDEPVAR,int*MDS_OUTPUT_TABLE) ;
165
167 int i;
168 eng_mds_c = NULL;
169 eng_mds_s = NULL;
170 mds_userlibhandle = NULL;
171 mds_userlib_id = NULL;
172 mds_eng_user_check = NULL;
175}
176
177void mds_userlib_name_set(char * libname);
178void mds_userlib_name_get_(char * libname,int * length);
179
180
181
182#ifdef _WIN64
183 void mds_init_callback();
184 void (*set_mds_callback) (void * callback_array[200]);
185#endif
186
187
#define my_real
Definition cppsort.cpp:32
void(* mds_eng_user_finalize)(int *MY_RANK)
Definition userlib.h:161
void(* eng_mds_c)(int *NCYCLE, int *MID, int *ELEMENT_UID, int *NEL, int *NPT, int *IT, int *ILAY, int *IPG, int *IFLAG, my_real *UPARAM, int *NUPARAM, my_real *UVAR, int *NUVAR, int *NFUNC, int *IFUNC, my_real FUNCTION_ARRAY, int *NPF, my_real *TIME, my_real *TIMESTEP, my_real *RHO0, my_real *AREA, my_real *EINT, my_real *THKLY, my_real *THK, my_real *SHF, my_real *ETSE, my_real *EPSPXX, my_real *EPSPYY, my_real *EPSPXY, my_real *EPSPYZ, my_real *EPSPZX, my_real *DEPSXX, my_real *DEPSYY, my_real *DEPSXY, my_real *DEPSYZ, my_real *DEPSZX, my_real *EPSXX, my_real *EPSYY, my_real *EPSXY, my_real *EPSYZ, my_real *EPSZX, my_real *SOUNDSP, my_real *VISCMAX, my_real *PLA, my_real *OFF, my_real *TEMP, my_real *R11, my_real *R12, my_real *R13, my_real *R21, my_real *R22, my_real *R23, my_real *R31, my_real *R32, my_real *R33, my_real *SIGY, my_real *SIGOXX, my_real *SIGOYY, my_real *SIGOXY, my_real *SIGOYZ, my_real *SIGOZX, my_real *SIGNXX, my_real *SIGNYY, my_real *SIGNXY, my_real *SIGNYZ, my_real *SIGNZX, my_real *SIGVXX, my_real *SIGVYY, my_real *SIGVXY, my_real *SIGVYZ, my_real *SIGVZX, my_real *DPLA, my_real *ADDITIONAL_FLT_PARAMETERS, my_real *ADDITIONAL_INT_PARAMETERS)
Definition userlib.h:126
void(* eng_mds_s)(int *NCYCLE, int *ID, int *IPTR, int *IPTS, int *IPTT, int *NEL, int *ELEMENT_UID, int *NUPARAM, int *NUVAR, int *NFUNC, int *IFUNC, int *NPF, my_real *FUNCTION_ARRAY, my_real *TIME, my_real *TIMESTEP, my_real *UPARAM, my_real *UVAR, my_real *RHO0, my_real *RHO, my_real *VOLUME, my_real *EINT, my_real *TEMP, my_real *AMU, my_real *EPSPXX, my_real *EPSPYY, my_real *EPSPZZ, my_real *EPSPXY, my_real *EPSPYZ, my_real *EPSPZX, my_real *DEPSXX, my_real *DEPSYY, my_real *DEPSZZ, my_real *DEPSXY, my_real *DEPSYZ, my_real *DEPSZX, my_real *EPSXX, my_real *EPSYY, my_real *EPSZZ, my_real *EPSXY, my_real *EPSYZ, my_real *EPSZX, my_real *SIGOXX, my_real *SIGOYY, my_real *SIGOZZ, my_real *SIGOXY, my_real *SIGOYZ, my_real *SIGOZX, my_real *SIGNXX, my_real *SIGNYY, my_real *SIGNZZ, my_real *SIGNXY, my_real *SIGNYZ, my_real *SIGNZX, my_real *SIGVXX, my_real *SIGVYY, my_real *SIGVZZ, my_real *SIGVXY, my_real *SIGVYZ, my_real *SIGVZX, my_real *SOUNDSP, my_real *VISCMAX, my_real *OFF, my_real *R11, my_real *R12, my_real *R13, my_real *R21, my_real *R22, my_real *R23, my_real *R31, my_real *R32, my_real *R33, int *ISMSTR, my_real *ISMSTR10_ARRAYS, my_real *PLA, my_real *DPLA, my_real *SIGY, my_real *ADDITIONAL_FLT_PARAMETERS, int *ADDITIONAL_INT_PARAMETERS)
Definition userlib.h:144
void(* mds_eng_user_initialize)(int *NSPMD, int *NTHREAD, int *MY_RANK, double *TSTOP, int *MDS_NMAT, int *MDS_MATID, char *MDS_FILES, char *MDS_LABEL, int *MDS_NDEPSVAR, int *MDS_MAXDEPVAR, int *MDS_OUTPUT_TABLE)
Definition userlib.h:163
void(* mds_eng_user_check)(int *MY_RANK, double *TSTOP, int *NCYCLE, double *TT, int *MSTOP)
Definition userlib.h:159
void mds_userlib_name_set(char *libname)
void(* mds_userlib_id)(int *info)
Definition userlib.h:125
char * mds_userlib_name
Definition userlib.h:112
void mds_array_init_()
Definition userlib.h:133
void * mds_userlibhandle
Definition userlib.h:121
void _FCALL mds_userlib_name_get_(char *libname, int *length)