OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
callback_c.c
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#include <stdio.h>
24#include <string.h>
25#include <stdlib.h>
26
27#define _FCALL
28/*=================================================================*/
29/* CALLBACK INTERFACE */
30/*=================================================================*/
31
32int *sav_buf[1000];
33
34
35
36#ifdef _WIN64
37#define sav_buf_point_ SAV_BUF_POINT
38#endif
39
40void _FCALL sav_buf_point_(int *buf ,int *i)
41{
42 if(*i<0||*i>=1000){fprintf(stderr,"ERROR in SAV_BUF: table overflow\n");exit(1);}
43 sav_buf[*i] = buf;
44}
45
46
47#ifdef _WIN64
48#define get_buf_point_ GET_BUF_POINT
49#endif
50
51void _FCALL get_buf_point_(int *loca,int *ish,int *i)
52{
53 *ish = (sav_buf[*i] - loca);
54}
55
56
57#ifdef _WIN64
58#define get_var_user_f_ GET_VAR_USER_F
59#endif
60void _FCALL get_var_user_f_ (int *buf, int *decalage, double *resultat)
61{
62 double *res;
63 res= ((double*) (sav_buf[*buf]) )+ (*decalage -1);
64 *resultat = *res;
65}
66
67
68#ifdef _WIN64
69#define get_var_user_f_sp_ GET_VAR_USER_F_SP
70#endif
71void _FCALL get_var_user_f_sp_ (int * buf,int * decalage,float * resultat)
72{
73 float *res;
74 res= ((float*) (sav_buf[*buf]) )+ (*decalage -1);
75 *resultat = *res;
76}
77
78
79#ifdef _WIN64
80#define set_var_user_f_ SET_VAR_USER_F
81#endif
82void _FCALL set_var_user_f_ (int *buf, int* decalage,double *variable)
83{
84 double *res;
85 res= ((double*)(sav_buf[*buf])) +(*decalage -1);
86 *res = *variable;
87}
88
89
90#ifdef _WIN64
91#define set_var_user_f_sp_ SET_VAR_USER_F_SP
92#endif
93void _FCALL set_var_user_f_sp_ (int * buf,int *decalage,float * variable)
94{
95 float *res;
96 res= ((float*) (sav_buf[*buf]))+ (*decalage -1);
97 *res = *variable;
98}
99
100
101#ifdef _WIN64
102#define get_var_user_i_ GET_VAR_USER_I
103#endif
104void _FCALL get_var_user_i_(int * buf,int * decalage,int * resultat)
105{
106 int *res;
107 res= (int*) (sav_buf[*buf]+ (*decalage) -1);
108 *resultat = *res;
109}
110
111
112#ifdef _WIN64
113#define set_var_user_i_ SET_VAR_USER_I
114#endif
115void _FCALL set_var_user_i_ (int *buf,int *decalage,int *variable)
116{
117 int *res;
118 res= (int*) (sav_buf[*buf]+ (*decalage) -1);
119 *res = *variable;
120}
121
122
123#ifdef _WIN64
124#define get_array_user_f_ GET_ARRAY_USER_F
125#endif
126void _FCALL get_array_user_f_(int *buf, int *decalage, double *array, int *array_lenght)
127{
128 int i;
129 double *ar;
130 ar = ((double *) (sav_buf[*buf]))+ (*decalage) -1;
131 for (i=0;i<(*array_lenght);i++)
132 { *(array+i)= *(ar+i); }
133}
134
135
136#ifdef _WIN64
137#define set_array_user_f_ SET_ARRAY_USER_F
138#endif
139void _FCALL set_array_user_f_(int *buf, int *decalage, double * array, int *array_lenght)
140{
141 int i;
142 double *ar;
143 ar = ((double *) (sav_buf[*buf]))+ (*decalage) -1;
144 for (i=0;i<(*array_lenght);i++)
145 { *(ar+1) = *(array+i);}
146}
147
148
149#ifdef _WIN64
150#define get_array_user_f_sp_ GET_ARRAY_USER_F_SP
151#endif
152void _FCALL get_array_user_f_sp_(int *buf, int *decalage, float *array, int *array_lenght)
153{
154 int i;
155 float *ar;
156 ar = ((float *) (sav_buf[*buf]))+ (*decalage) -1;
157 for (i=0;i<(*array_lenght);i++)
158 { *(array+i)= *(ar+i); }
159}
160
161
162#ifdef _WIN64
163#define set_array_user_f_sp_ SET_ARRAY_USER_F_SP
164#endif
165void _FCALL set_array_user_f_sp_(int *buf, int *decalage, float *array, int *array_lenght)
166{
167 int i;
168 float *ar;
169 ar = ((float *) (sav_buf[*buf]))+ (*decalage) -1;
170 for (i=0;i<(*array_lenght);i++)
171 { *(ar+i) = *(array+i);}
172}
173
174
175#ifdef _WIN64
176#define get_array_user_i_ GET_ARRAY_USER_I
177#endif
178void get_array_user_i_(int *buf, int *decalage, int *array, int *array_lenght)
179{
180 int i;
181 int *ar;
182 ar = ((int *) (sav_buf[*buf]))+ (*decalage) -1;
183 for (i=0;i<(*array_lenght);i++)
184 { *(array+i)= *(ar+i); }
185}
186
187
188#ifdef _WIN64
189#define set_array_user_i_ SET_ARRAY_USER_I
190#endif
191void set_array_user_i_(int *buf, int *decalage, int *array, int *array_lenght)
192{
193 int i;
194 int *ar;
195 ar = ((int *) (sav_buf[*buf]))+ (*decalage) -1;
196 for (i=0;i<(*array_lenght);i++)
197 { *(ar+i) = *(array+i); }
198}
199
200
void _FCALL get_array_user_f_(int *buf, int *decalage, double *array, int *array_lenght)
Definition callback_c.c:126
void _FCALL set_array_user_f_(int *buf, int *decalage, double *array, int *array_lenght)
Definition callback_c.c:139
void _FCALL sav_buf_point_(int *buf, int *i)
Definition callback_c.c:40
void _FCALL get_var_user_i_(int *buf, int *decalage, int *resultat)
Definition callback_c.c:104
void get_array_user_i_(int *buf, int *decalage, int *array, int *array_lenght)
Definition callback_c.c:178
void _FCALL set_array_user_f_sp_(int *buf, int *decalage, float *array, int *array_lenght)
Definition callback_c.c:165
void _FCALL get_var_user_f_sp_(int *buf, int *decalage, float *resultat)
Definition callback_c.c:71
void _FCALL set_var_user_i_(int *buf, int *decalage, int *variable)
Definition callback_c.c:115
void _FCALL get_array_user_f_sp_(int *buf, int *decalage, float *array, int *array_lenght)
Definition callback_c.c:152
void _FCALL get_buf_point_(int *loca, int *ish, int *i)
Definition callback_c.c:51
void _FCALL set_var_user_f_(int *buf, int *decalage, double *variable)
Definition callback_c.c:82
void _FCALL get_var_user_f_(int *buf, int *decalage, double *resultat)
Definition callback_c.c:60
void _FCALL set_var_user_f_sp_(int *buf, int *decalage, float *variable)
Definition callback_c.c:93
void set_array_user_i_(int *buf, int *decalage, int *array, int *array_lenght)
Definition callback_c.c:191
int * sav_buf[1000]
Definition callback_c.c:32
#define _FCALL