OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_create_rbe3.cpp File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <fcntl.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <time.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dlfcn.h>
#include <stdbool.h>
#include "h3dpublic_defs.h"
#include "h3dpublic_export.h"
#include "h3d_values.h"

Go to the source code of this file.

Macros

#define _FCALL
#define _FCALL

Functions

void c_h3d_create_rbe3_ (int *ITAB, int *NUMNOD, int *IRBE3, int *NRBE3L, int *LRBE3, int *NRBE3, int *COMPID_RBE3S)
void _FCALL C_H3D_CREATE_RBE3 (int *ITAB, int *NUMNOD, int *IRBE3, int *NRBE3L, int *LRBE3, int *NRBE3, int *COMPID_RBE3S)
void c_h3d_create_rbe3__ (int *ITAB, int *NUMNOD, int *IRBE3, int *NRBE3L, int *LRBE3, int *NRBE3, int *COMPID_RBE3S)
void c_h3d_create_rbe3 (int *ITAB, int *NUMNOD, int *IRBE3, int *NRBE3L, int *LRBE3, int *NRBE3, int *COMPID_RBE3S)
void c_h3d_create_rbe3_impi_ (int *ITAB, int *NRBE3, int *IADRBE3, int *SLAVENODS, int *P0RBE3BUF, int *ID_RBE3, int *COMPID_RBE3S)
void _FCALL C_H3D_CREATE_RBE3_IMPI (int *ITAB, int *NRBE3, int *IADRBE3, int *SLAVENODS, int *P0RBE3BUF, int *ID_RBE3, int *COMPID_RBE3S)
void c_h3d_create_rbe3_impi__ (int *ITAB, int *NRBE3, int *IADRBE3, int *SLAVENODS, int *P0RBE3BUF, int *ID_RBE3, int *COMPID_RBE3S)
void c_h3d_create_rbe3_impi (int *ITAB, int *NRBE3, int *IADRBE3, int *SLAVENODS, int *P0RBE3BUF, int *ID_RBE3, int *COMPID_RBE3S)

Macro Definition Documentation

◆ _FCALL [1/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_rbe3.cpp.

◆ _FCALL [2/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_rbe3.cpp.

Function Documentation

◆ C_H3D_CREATE_RBE3()

void _FCALL C_H3D_CREATE_RBE3 ( int * ITAB,
int * NUMNOD,
int * IRBE3,
int * NRBE3L,
int * LRBE3,
int * NRBE3,
int * COMPID_RBE3S )

Definition at line 174 of file c_h3d_create_rbe3.cpp.

175{c_h3d_create_rbe3_ (ITAB, NUMNOD, IRBE3, NRBE3L, LRBE3, NRBE3,COMPID_RBE3S);}
void c_h3d_create_rbe3_(int *ITAB, int *NUMNOD, int *IRBE3, int *NRBE3L, int *LRBE3, int *NRBE3, int *COMPID_RBE3S)

◆ c_h3d_create_rbe3()

void c_h3d_create_rbe3 ( int * ITAB,
int * NUMNOD,
int * IRBE3,
int * NRBE3L,
int * LRBE3,
int * NRBE3,
int * COMPID_RBE3S )

Definition at line 180 of file c_h3d_create_rbe3.cpp.

181{c_h3d_create_rbe3_ (ITAB, NUMNOD, IRBE3, NRBE3L, LRBE3, NRBE3,COMPID_RBE3S);}

◆ c_h3d_create_rbe3_()

void c_h3d_create_rbe3_ ( int * ITAB,
int * NUMNOD,
int * IRBE3,
int * NRBE3L,
int * LRBE3,
int * NRBE3,
int * COMPID_RBE3S )

Definition at line 69 of file c_h3d_create_rbe3.cpp.

70{
71 try {
72
73
74 // create Elements
75 H3D_ID elem_id ;
76 H3D_ID RigidElem ;
77 int i,j,nsn;
78
79 char RBE3POOL[] = "Rbe3";
81 if( !rc ) throw rc;
82
83 char RIGIDPOOL[] = "Rigid";
85 if( !rc ) throw rc;
86
87 unsigned int elem_count = 1;
88 unsigned int *conn;
89 double *coef;
90 int *dof;
91
92 if(*COMPID_RBE3S != 0 && *NRBE3 != 0)
93 {
95 H3D_ELEM_CONFIG_RIGIDLINK, *COMPID_RBE3S,
97 for(i=0;i<*NRBE3;i++)
98 {
99 elem_id = IRBE3[*NRBE3L * i + 1];
100 nsn = IRBE3[*NRBE3L * i + 4];
101 comp_id = 1;
102
103 conn =(unsigned int *)malloc(nsn*sizeof(unsigned int));
104 coef =(double *)malloc(nsn*sizeof(double));
105 dof =(int *)malloc(nsn*sizeof(int));
106
107 for(j=0;j<nsn;j++) conn[j] = ITAB[LRBE3[IRBE3[*NRBE3L * i ] + j ] - 1 ];
108
109 RigidElem = IRBE3[*NRBE3L * i + 1] ;
110
111 unsigned int conn1[1];
112 double coef1[1] = {1.0};
113 int dof1[1] = {6};
114 conn1[0] = ITAB[IRBE3[*NRBE3L * i + 2]-1];
115
116 if( !rc ) throw rc;
117 rc = Hyper3DElement2Write(h3d_file, elem_id, conn1, dof1 , coef1 , 1 ,conn, dof, coef, nsn);
118 if( !rc ) throw rc;
119
120 free(conn);
121 free(coef);
122 free(dof);
123
124 }
126 if( !rc ) throw rc;
127 }
128 else
129 {
130 for(i=0;i<*NRBE3;i++)
131 {
132 elem_id = IRBE3[*NRBE3L * i + 1];
133 nsn = IRBE3[*NRBE3L * i + 4];
134 comp_id = 1;
135
136 conn =(unsigned int *)malloc(nsn*sizeof(unsigned int));
137 coef =(double *)malloc(nsn*sizeof(double));
138 dof =(int *)malloc(nsn*sizeof(int));
139
140 for(j=0;j<nsn;j++) conn[j] = ITAB[LRBE3[IRBE3[*NRBE3L * i ] + j ] - 1 ];
141
142 RigidElem = IRBE3[*NRBE3L * i + 1] ;
143
144 unsigned int conn1[1];
145 double coef1[1] = {1.0};
146 int dof1[1] = {6};
147 conn1[0] = ITAB[IRBE3[*NRBE3L * i + 2]-1];
148
149
151 H3D_ELEM_CONFIG_RIGIDLINK, RigidElem,
153 if( !rc ) throw rc;
154 rc = Hyper3DElement2Write(h3d_file, elem_id, conn1, dof1 , coef1 , 1 ,conn, dof, coef, nsn);
155 if( !rc ) throw rc;
157 if( !rc ) throw rc;
158
159 free(conn);
160 free(coef);
161 free(dof);
162 }
163 }
164
165
166 } // end of try
167
168 catch(...) {
170 }
171
172}
H3DFileInfo * h3d_file
H3D_ID rigid_poolname_id
H3D_ID node_poolname_id
bool rc
H3D_ID rbe3_poolname_id
H3D_ID comp_id
bool Hyper3DElement2Write(H3DFileInfo *h3d_file, H3D_ID id, unsigned int *inode, int *idof, double *icoeff, unsigned int num_inodes, unsigned int *dnode, int *ddof, double *dcoeff, unsigned int num_dnodes)
Definition h3d_dl.c:1170
bool Hyper3DAddString(H3DFileInfo *h3d_file, const char *const string, H3D_ID *const str_id)
Definition h3d_dl.c:955
bool Hyper3DExportClearError(H3DFileInfo *h3d_file)
Definition h3d_dl.c:939
bool Hyper3DElement2End(H3DFileInfo *h3d_file)
Definition h3d_dl.c:1181
bool Hyper3DElement2Begin(H3DFileInfo *h3d_file, unsigned int count, H3D_ID poolname_id, H3D_ElementConfig config, H3D_ID parent_id, H3D_ID parent_poolname_id, H3D_ID node_poolname_id)
Definition h3d_dl.c:1160

◆ c_h3d_create_rbe3__()

void c_h3d_create_rbe3__ ( int * ITAB,
int * NUMNOD,
int * IRBE3,
int * NRBE3L,
int * LRBE3,
int * NRBE3,
int * COMPID_RBE3S )

Definition at line 177 of file c_h3d_create_rbe3.cpp.

178{c_h3d_create_rbe3_ (ITAB, NUMNOD, IRBE3, NRBE3L, LRBE3, NRBE3,COMPID_RBE3S);}

◆ C_H3D_CREATE_RBE3_IMPI()

void _FCALL C_H3D_CREATE_RBE3_IMPI ( int * ITAB,
int * NRBE3,
int * IADRBE3,
int * SLAVENODS,
int * P0RBE3BUF,
int * ID_RBE3,
int * COMPID_RBE3S )

Definition at line 302 of file c_h3d_create_rbe3.cpp.

304{c_h3d_create_rbe3_impi_ (ITAB,NRBE3,IADRBE3,SLAVENODS,P0RBE3BUF,ID_RBE3,COMPID_RBE3S);}
void c_h3d_create_rbe3_impi_(int *ITAB, int *NRBE3, int *IADRBE3, int *SLAVENODS, int *P0RBE3BUF, int *ID_RBE3, int *COMPID_RBE3S)

◆ c_h3d_create_rbe3_impi()

void c_h3d_create_rbe3_impi ( int * ITAB,
int * NRBE3,
int * IADRBE3,
int * SLAVENODS,
int * P0RBE3BUF,
int * ID_RBE3,
int * COMPID_RBE3S )

Definition at line 310 of file c_h3d_create_rbe3.cpp.

312{c_h3d_create_rbe3_impi_ (ITAB,NRBE3,IADRBE3,SLAVENODS,P0RBE3BUF,ID_RBE3,COMPID_RBE3S);}

◆ c_h3d_create_rbe3_impi_()

void c_h3d_create_rbe3_impi_ ( int * ITAB,
int * NRBE3,
int * IADRBE3,
int * SLAVENODS,
int * P0RBE3BUF,
int * ID_RBE3,
int * COMPID_RBE3S )

Definition at line 187 of file c_h3d_create_rbe3.cpp.

189{
190
191 try {
192
193
194 // create Elements
195 H3D_ID elem_id ;
196 H3D_ID RigidElem ;
197 int i,j,n,p,nsn,nsn_loc,ptr,iadg;
198 //int PTRPO_TMP[*NSPMD + 1];
199
200 char RBE3POOL[] = "Rbe3";
202 if( !rc ) throw rc;
203
204 char RIGIDPOOL[] = "Rigid";
206 if( !rc ) throw rc;
207
208 unsigned int *conn;
209 double *coef;
210 int *dof;
211 unsigned int elem_count = 1;
212
213
214 if(*COMPID_RBE3S != 0 && *NRBE3 != 0)
215 {
217 H3D_ELEM_CONFIG_RIGIDLINK, *COMPID_RBE3S,
219 for(i=0;i<*NRBE3;i++)
220 {
221 elem_id = ID_RBE3[i];
222 nsn =IADRBE3[i+1] - IADRBE3[i];
223 iadg = IADRBE3[i] ;
224
225
226 conn =(unsigned int *)malloc(nsn*sizeof(unsigned int));
227 coef =(double *)malloc(nsn*sizeof(double));
228 dof =(int *)malloc(nsn*sizeof(int));
229 unsigned int conn1[1];
230 //double coef[nsn];
231 double coef1[1] = {1.0};
232 //int dof[nsn];
233 int dof1[1] = {6};
234 conn1[0] = SLAVENODS[i];
235 j = 0;
236 for(n=0;n<nsn;n++)
237 {
238 conn[n] = P0RBE3BUF[iadg + n];
239 }
240
241 if( !rc ) throw rc;
242 rc = Hyper3DElement2Write(h3d_file, elem_id, conn1, dof1 , coef1 , 1 ,conn, dof, coef, nsn);
243 if( !rc ) throw rc;
244
245 free(conn);
246 free(coef);
247 free(dof);
248 }
250 if( !rc ) throw rc;
251 }
252 else
253 {
254 for(i=0;i<*NRBE3;i++)
255 {
256 elem_id = ID_RBE3[i];
257 nsn =IADRBE3[i+1] - IADRBE3[i];
258 iadg = IADRBE3[i] ;
259
260
261 conn =(unsigned int *)malloc(nsn*sizeof(unsigned int));
262 coef =(double *)malloc(nsn*sizeof(double));
263 dof =(int *)malloc(nsn*sizeof(int));
264 unsigned int conn1[1];
265 //double coef[nsn];
266 double coef1[1] = {1.0};
267 //int dof[nsn];
268 int dof1[1] = {6};
269 conn1[0] = SLAVENODS[i];
270 j = 0;
271 for(n=0;n<nsn;n++)
272 {
273 conn[n] = P0RBE3BUF[iadg + n];
274 }
275
276
277
279 H3D_ELEM_CONFIG_RIGIDLINK, elem_id,
281 if( !rc ) throw rc;
282 rc = Hyper3DElement2Write(h3d_file, elem_id, conn1, dof1 , coef1 , 1 ,conn, dof, coef, nsn);
283 if( !rc ) throw rc;
285 if( !rc ) throw rc;
286
287 free(conn);
288 free(coef);
289 free(dof);
290 }
291 }
292
293
294 } // end of try
295
296 catch(...) {
298 }
299
300}
n

◆ c_h3d_create_rbe3_impi__()

void c_h3d_create_rbe3_impi__ ( int * ITAB,
int * NRBE3,
int * IADRBE3,
int * SLAVENODS,
int * P0RBE3BUF,
int * ID_RBE3,
int * COMPID_RBE3S )

Definition at line 306 of file c_h3d_create_rbe3.cpp.

308{c_h3d_create_rbe3_impi_ (ITAB,NRBE3,IADRBE3,SLAVENODS,P0RBE3BUF,ID_RBE3,COMPID_RBE3S);}