OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
analyse_node.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/*
24 Cls41l32 : Create File
25*/
26/*********************************************************************
27 * INCLUDES
28 *********************************************************************/
29/*Cow416+++*/
30#include "hardware.inc"
31
32#if CPP_mach == CPP_w95 || CPP_mach == CPP_ant || CPP_mach == CPP_wnt
33/* el41m2 +1 #define _FCALL __stdcall*/
34#define _FCALL
35#elif 1
36#define _FCALL
37#endif
38/*Cow41l6---*/
39#include <stdio.h>
40#include <stdlib.h>
41
42#include "analyse_name.inc"
43
44#include "analyse.h"
45#include "analyse_node.h"
46
47static int NB_NODE;
48static int *TAB_NODE;
49
50void analyse_node_scan(int *tab_id)
51{
52 int i;
53 int nbshell, nbvolu, nbtruss, nbbeam, nbspring, nbrbm, nbrbs, nbmass, nb2n, nbused;
54 int nbstruct, nb2nds, nbrb, nbelt, nball;
55 int node_flying=0;
56 int node_rbm_struct=0;
57 int node_mass_elt=0;
58 int node_mass_flying=0;
59 int node_truss_elt=0;
60 int node_beam_elt=0;
61 int node_spring_elt=0;
62 int node_rbs_elt=0;
63
64 for(i=0; i<NB_NODE; i++)
65 {
66 /* Shell */
67 nbshell = (TAB_NODE[i] >> 0) & 0x1;
68
69 /* Volu */
70 nbvolu = (TAB_NODE[i] >> 1) & 0x1;
71
72 /* Truss */
73 nbtruss = (TAB_NODE[i] >> 2) & 0x3;
74
75 /* Beam */
76 nbbeam = (TAB_NODE[i] >> 4) & 0x3;
77
78 /* Spring */
79 nbspring = (TAB_NODE[i] >> 6) & 0x3;
80
81 /* RigidBody_Master */
82 nbrbm = (TAB_NODE[i] >> 8) & 0x1;
83
84 /* RigidBody_Slave */
85 nbrbs = (TAB_NODE[i] >> 9) & 0x1;
86
87 /* Mass */
88 nbmass = (TAB_NODE[i] >> 10) & 0x1;
89
90 /* 2N */
91 nb2n = (TAB_NODE[i] >> 11) & 0x3;
92
93 /* Used */
94 nbused = (TAB_NODE[i] >> 13) & 0x1;
95
96 nbstruct = nbshell + nbvolu;
97 nb2nds = nbtruss + nbbeam + nb2n;
98 nbrb = nbrbm + nbrbs;
99 nbelt = nbstruct + nb2nds + nbspring + nbrb;
100 nball = nbelt + nbmass + nbused;
101
102 if (nball == 0)
103 {
104 analyse_stack_int(tab_id[i]);
105 analyse_call_error(AN_WARNING, 447, ANINFO_BLIND_2);
106
107 node_flying++;
108 }
109
110 if ((nbrbm == 1) && ((nbstruct + nb2nds + nbspring + nbrbs) != 0))
111 {
112 analyse_stack_int(tab_id[i]);
113 analyse_call_error(AN_WARNING, 448, ANINFO_BLIND_2);
114
115 node_rbm_struct++;
116 }
117
118 if ((nbmass == 1) && (nbelt == 0))
119 {
120 analyse_stack_int(tab_id[i]);
121 analyse_call_error(AN_INFO, 449, ANINFO_BLIND_2);
122
123 node_mass_elt++;
124 }
125
126 if ((nbmass == 1) && (nball == 1))
127 {
128 analyse_stack_int(tab_id[i]);
129 analyse_call_error(AN_WARNING, 450, ANINFO_BLIND_2);
130
131 node_mass_flying++;
132 }
133
134 if ((nbtruss == 1) && (nbelt == 1))
135 {
136 analyse_stack_int(tab_id[i]);
137 analyse_call_error(AN_WARNING, 451, ANINFO_BLIND_2);
138
139 node_truss_elt++;
140 }
141
142 if ((nbbeam == 1) && (nbelt == 1))
143 {
144 analyse_stack_int(tab_id[i]);
145 analyse_call_error(AN_WARNING, 452, ANINFO_BLIND_2);
146
147 node_beam_elt++;
148 }
149
150 if ((nbspring == 1) && (nbelt == 1))
151 {
152 analyse_stack_int(tab_id[i]);
153 analyse_call_error(AN_WARNING, 453, ANINFO_BLIND_2);
154
155 node_spring_elt++;
156 }
157
158 if ((nbrbs == 1) && (nbelt == 1))
159 {
160 analyse_stack_int(tab_id[i]);
161 if ( nbmass == 1)
162 {
163 analyse_call_error(AN_WARNING, 455, ANINFO_BLIND_2);
164 }
165 else
166 {
167 analyse_call_error(AN_WARNING, 454, ANINFO_BLIND_2);
168 }
169
170 node_rbs_elt++;
171 }
172
173 }
174
175 analyse_stack_int(node_flying);
177
178 analyse_stack_int(node_rbm_struct);
180
181 analyse_stack_int(node_mass_elt);
183
184 analyse_stack_int(node_mass_flying);
186
187 analyse_stack_int(node_truss_elt);
189
190 analyse_stack_int(node_beam_elt);
192
193 analyse_stack_int(node_spring_elt);
195
196 analyse_stack_int(node_rbs_elt);
198
199}
200
201void anodscan(int *itab)
202{
203 analyse_node_scan(itab);
204}
205
206void anodscan_(int *itab)
207{
208 analyse_node_scan(itab);
209}
210
211void anodscan__(int *itab)
212{
213 analyse_node_scan(itab);
214}
215
216/* void ANODSCAN(int *itab)*/
217void _FCALL ANODSCAN(int *itab)
218{
219 analyse_node_scan(itab);
220}
221
222/*********************************************************************/
223
224void analyse_node_set(int nod_id, int type )
225{
226 /*
227 WARNING : START OF TAB IN FORTRAN AND C IS SHIFTED BY 1 :
228 nod_id = 1, is the first elt in model, this means tab_node[0]
229 */
230 nod_id = nod_id - 1;
231
232 switch(type)
233 {
234 case CHECK_SHELL:
235 TAB_NODE[nod_id] = TAB_NODE[nod_id] | 0x1;
236 break;
237
238 case CHECK_VOLU:
239 TAB_NODE[nod_id] = TAB_NODE[nod_id] | 0x2;
240 break;
241
242 case CHECK_TRUSS:
243 if(TAB_NODE[nod_id]&0x4)
244 {
245 if(!(TAB_NODE[nod_id]&0x8))
246 {
247 TAB_NODE[nod_id] = TAB_NODE[nod_id] & ~0x4;
248 TAB_NODE[nod_id] = TAB_NODE[nod_id] | 0x8;
249 }
250 }
251 else
252 {
253 TAB_NODE[nod_id] = TAB_NODE[nod_id] | 0x4;
254 }
255 break;
256
257 case CHECK_BEAM:
258 if(TAB_NODE[nod_id]&0x10)
259 {
260 if(!(TAB_NODE[nod_id]&0x20))
261 {
262 TAB_NODE[nod_id] = TAB_NODE[nod_id] & ~0x10;
263 TAB_NODE[nod_id] = TAB_NODE[nod_id] | 0x20;
264 }
265 }
266 else
267 {
268 TAB_NODE[nod_id] = TAB_NODE[nod_id] | 0x10;
269 }
270 break;
271
272 case CHECK_SPRING:
273 if(TAB_NODE[nod_id]&0x40)
274 {
275 if(!(TAB_NODE[nod_id]&0x80))
276 {
277 TAB_NODE[nod_id] = TAB_NODE[nod_id] & ~0x40;
278 TAB_NODE[nod_id] = TAB_NODE[nod_id] | 0x80;
279 }
280 }
281 else
282 {
283 TAB_NODE[nod_id] = TAB_NODE[nod_id] | 0x40;
284 }
285 break;
286
287
288 case CHECK_RB_M:
289 TAB_NODE[nod_id] = TAB_NODE[nod_id] | 0x100;
290 break;
291
292 case CHECK_RB_S:
293 TAB_NODE[nod_id] = TAB_NODE[nod_id] | 0x200;
294 break;
295
296 case CHECK_MASS:
297 TAB_NODE[nod_id] = TAB_NODE[nod_id] | 0x400;
298 break;
299
300 case CHECK_2N:
301 if(TAB_NODE[nod_id]&0x800)
302 {
303 if(!(TAB_NODE[nod_id]&0x1000))
304 {
305 TAB_NODE[nod_id] = TAB_NODE[nod_id] & ~0x800;
306 TAB_NODE[nod_id] = TAB_NODE[nod_id] | 0x1000;
307 }
308 }
309 else
310 {
311 TAB_NODE[nod_id] = TAB_NODE[nod_id] | 0x800;
312 }
313 break;
314
315 case CHECK_USED:
316 TAB_NODE[nod_id] = TAB_NODE[nod_id] | 0x2000;
317 break;
318 }
319}
320
321void anodset(int *id, int *type)
322{
323 analyse_node_set(*id, *type);
324}
325
326void anodset_(int *id, int *type)
327{
328 analyse_node_set(*id, *type);
329}
330
331void anodset__(int *id, int *type)
332{
333 analyse_node_set(*id, *type);
334}
335
336/*Cow41l6 void ANODSET(int *id, int *type)*/
337void _FCALL ANODSET(int *id, int *type)
338{
339 analyse_node_set(*id, *type);
340}
341
342/*********************************************************************/
343
344static void analyse_node_tab_init( int nb)
345{
346 int i;
347
348 TAB_NODE = (int *) malloc(sizeof(int)*nb);
349 NB_NODE = nb;
350
351 for(i=0; i<NB_NODE; i++)
352 {
353 TAB_NODE[i] = 0;
354 }
355}
356
357void anodin( int *nb)
358{
360}
361
362void anodin_(int *nb)
363{
365}
366
367void anodin__( int *nb)
368{
370}
371
372
373void _FCALL ANODIN(int *nb)
374{
376}
void analyse_stack_int(int i)
Definition analyse.c:334
void analyse_call_check(int id)
Definition analyse.c:802
void analyse_call_error(int type, int id, int mode)
Definition analyse.c:580
static int NB_NODE
void _FCALL ANODSCAN(int *itab)
void _FCALL ANODSET(int *id, int *type)
void anodin_(int *nb)
void analyse_node_scan(int *tab_id)
void anodin(int *nb)
void anodset(int *id, int *type)
void anodset__(int *id, int *type)
void anodin__(int *nb)
void analyse_node_set(int nod_id, int type)
void anodscan_(int *itab)
void anodscan(int *itab)
void anodscan__(int *itab)
void anodset_(int *id, int *type)
static void analyse_node_tab_init(int nb)
void _FCALL ANODIN(int *nb)
static int * TAB_NODE
#define _FCALL