OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_eroded_oned.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_eroded_oned_ (my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXT, int *NIXT, int *NUMELT, int *IPARTT, int *IXP, int *NIXP, int *NUMELP, int *IPARTP, int *IXR, int *NIXR, int *NUMELR, int *IPARTR, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM)
void _FCALL C_H3D_ERODED_ONED (my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXT, int *NIXT, int *NUMELT, int *IPARTT, int *IXP, int *NIXP, int *NUMELP, int *IPARTP, int *IXR, int *NIXR, int *NUMELR, int *IPARTR, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM)
void c_h3d_eroded_oned__ (my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXT, int *NIXT, int *NUMELT, int *IPARTT, int *IXP, int *NIXP, int *NUMELP, int *IPARTP, int *IXR, int *NIXR, int *NUMELR, int *IPARTR, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM)
void c_h3d_eroded_oned (my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXT, int *NIXT, int *NUMELT, int *IPARTT, int *IXP, int *NIXP, int *NUMELP, int *IPARTP, int *IXR, int *NIXR, int *NUMELR, int *IPARTR, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM)
void c_h3d_create_oned_eroded_ (int *cpt_data, char *name, int *size, int *info, char *name1, int *size1)
void _FCALL C_H3D_CREATE_ONED_ERODED (int *cpt_data, char *name, int *size, int *info, char *name1, int *size1)
void c_h3d_create_oned_eroded__ (int *cpt_data, char *name, int *size, int *info, char *name1, int *size1)
void c_h3d_create_oned_eroded (int *cpt_data, char *name, int *size, int *info, char *name1, int *size1)

Macro Definition Documentation

◆ _FCALL [1/2]

#define _FCALL

Definition at line 50 of file c_h3d_eroded_oned.cpp.

◆ _FCALL [2/2]

#define _FCALL

Definition at line 50 of file c_h3d_eroded_oned.cpp.

Function Documentation

◆ C_H3D_CREATE_ONED_ERODED()

void _FCALL C_H3D_CREATE_ONED_ERODED ( int * cpt_data,
char * name,
int * size,
int * info,
char * name1,
int * size1 )

Definition at line 287 of file c_h3d_eroded_oned.cpp.

288{c_h3d_create_oned_eroded_ (cpt_data, name, size, info, name1, size1);}
void c_h3d_create_oned_eroded_(int *cpt_data, char *name, int *size, int *info, char *name1, int *size1)

◆ c_h3d_create_oned_eroded()

void c_h3d_create_oned_eroded ( int * cpt_data,
char * name,
int * size,
int * info,
char * name1,
int * size1 )

Definition at line 293 of file c_h3d_eroded_oned.cpp.

294{c_h3d_create_oned_eroded_ (cpt_data, name, size, info, name1, size1);}

◆ c_h3d_create_oned_eroded_()

void c_h3d_create_oned_eroded_ ( int * cpt_data,
char * name,
int * size,
int * info,
char * name1,
int * size1 )

Definition at line 210 of file c_h3d_eroded_oned.cpp.

211{
212 char *cname,*cname1;
213 int cname_len,cname_len1;
214 int i;
215 float node[3];
216 H3D_ID node_id;
217 unsigned int elem_count = 1;
218
219 cname_len = *size + 1;
220 cname=(char*) malloc(sizeof(char)*cname_len);
221 for(i=0;i<*size;i++) cname[i] = name[i];
222 cname[*size]='\0';
223
224 cname_len1 = *size1 + 1;
225 cname1=(char*) malloc(sizeof(char)*cname_len1);
226 for(i=0;i<*size1;i++) cname1[i] = name1[i];
227 cname1[*size1]='\0';
228
229 char * LAYERPOOL = new char [*size1+11];
230 sprintf(LAYERPOOL, "%s %d" ,cname1,*info);
231 H3D_ID layer_pool_id = H3D_NULL_ID;
232 rc = Hyper3DAddString(h3d_file, LAYERPOOL, &layer_pool_id);
233
234 char edata_type[30];
235//
236
237 //printf( "scalar %d info = %d %s\n", *cpt_data , *info, name);
238 //fflush(stdout);
239
240 try {
241 // create result data types
242 dt_count++;
243
245 if( !rc ) throw rc;
246
247 pool_count = 3;
248
249 dt_id++;
250 sprintf(edata_type, cname, H3D_DT_DELIMITER);
251 // snprintf(edata_type, sizeof(edata_type), cname, H3D_DT_DELIMITER);
252 rc = Hyper3DDatatypeWrite(h3d_file, edata_type, *cpt_data , H3D_DS_EROSION,
253 H3D_DS_ELEM, pool_count);
254 if( !rc ) throw rc;
255
256 rc = Hyper3DDatatypeDescriptionWrite(h3d_file,dt_id, "N/A : element not deleted");
257
260 if( !rc ) throw rc;
261
264 if( !rc ) throw rc;
265
268 if( !rc ) throw rc;
269
271 if( !rc ) throw rc;
272
273 } // end of try
274
275 catch(...) {
277 }
278 delete [] LAYERPOOL;
279 free(cname);
280 free(cname1);
281
282}
H3DFileInfo * h3d_file
unsigned int pool_count
unsigned int dt_count
bool has_corners
bool rc
H3D_ID spring_poolname_id
float poisson
H3D_ID beam_poolname_id
H3D_ID * layername_ids
H3D_ID truss_poolname_id
H3D_ID dt_id
char edata_type[50]
H3D_TENSOR_TYPE tensor_type
bool Hyper3DDatatypePools(H3DFileInfo *h3d_file, H3D_ID dt_id, H3D_ID poolname_id, unsigned int num_layers, H3D_ID *layername_ids, bool corners, H3D_TENSOR_TYPE tensor_type, float poisson)
Definition h3d_dl.c:1331
bool Hyper3DAddString(H3DFileInfo *h3d_file, const char *const string, H3D_ID *const str_id)
Definition h3d_dl.c:955
bool Hyper3DDatatypeEnd(H3DFileInfo *h3d_file)
Definition h3d_dl.c:1341
bool Hyper3DExportClearError(H3DFileInfo *h3d_file)
Definition h3d_dl.c:939
bool Hyper3DDatatypeDescriptionWrite(H3DFileInfo *h3d_file, H3D_ID dt_id, const char *description)
Definition h3d_dl.c:1324
bool Hyper3DDatatypeWrite(H3DFileInfo *h3d_file, const char *label, H3D_ID dt_id, H3D_DS_FORMAT format, H3D_DS_TYPE type, unsigned int num_pools)
Definition h3d_dl.c:1316
bool Hyper3DDatatypeBegin(H3DFileInfo *h3d_file, unsigned int count)
Definition h3d_dl.c:1310

◆ c_h3d_create_oned_eroded__()

void c_h3d_create_oned_eroded__ ( int * cpt_data,
char * name,
int * size,
int * info,
char * name1,
int * size1 )

Definition at line 290 of file c_h3d_eroded_oned.cpp.

291{c_h3d_create_oned_eroded_ (cpt_data, name, size, info, name1, size1);}

◆ C_H3D_ERODED_ONED()

void _FCALL C_H3D_ERODED_ONED ( my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
int * IXT,
int * NIXT,
int * NUMELT,
int * IPARTT,
int * IXP,
int * NIXP,
int * NUMELP,
int * IPARTP,
int * IXR,
int * NIXR,
int * NUMELR,
int * IPARTR,
my_real * FUNC,
int * ID_ELEM,
int * CPT_DATATYPE,
int * ITY_ELEM )

Definition at line 191 of file c_h3d_eroded_oned.cpp.

194{c_h3d_eroded_oned_ (TT,IH3D,ITAB,NUMNOD,IXT,NIXT,NUMELT,IPARTT,IXP,NIXP,NUMELP,IPARTP,IXR,NIXR,NUMELR,IPARTR,FUNC,ID_ELEM,CPT_DATATYPE,
195 ITY_ELEM);}
void c_h3d_eroded_oned_(my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXT, int *NIXT, int *NUMELT, int *IPARTT, int *IXP, int *NIXP, int *NUMELP, int *IPARTP, int *IXR, int *NIXR, int *NUMELR, int *IPARTR, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM)
#define FUNC
Definition clamov.c:8

◆ c_h3d_eroded_oned()

void c_h3d_eroded_oned ( my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
int * IXT,
int * NIXT,
int * NUMELT,
int * IPARTT,
int * IXP,
int * NIXP,
int * NUMELP,
int * IPARTP,
int * IXR,
int * NIXR,
int * NUMELR,
int * IPARTR,
my_real * FUNC,
int * ID_ELEM,
int * CPT_DATATYPE,
int * ITY_ELEM )

Definition at line 203 of file c_h3d_eroded_oned.cpp.

206{c_h3d_eroded_oned_ (TT,IH3D,ITAB,NUMNOD,IXT,NIXT,NUMELT,IPARTT,IXP,NIXP,NUMELP,IPARTP,IXR,NIXR,NUMELR,IPARTR,FUNC,ID_ELEM,CPT_DATATYPE,
207 ITY_ELEM);}

◆ c_h3d_eroded_oned_()

void c_h3d_eroded_oned_ ( my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
int * IXT,
int * NIXT,
int * NUMELT,
int * IPARTT,
int * IXP,
int * NIXP,
int * NUMELP,
int * IPARTP,
int * IXR,
int * NIXR,
int * NUMELR,
int * IPARTR,
my_real * FUNC,
int * ID_ELEM,
int * CPT_DATATYPE,
int * ITY_ELEM )

Definition at line 78 of file c_h3d_eroded_oned.cpp.

81{
82 int i;
83 int offset;
84 H3D_ID elem_id;
85 H3D_ID comp_id;
86//
87 // initialize
88
89 try {
90 // create Subcase (Loadcase)
91 unsigned int max_sims = 10;
92 unsigned int sub_count = 1;
93 float elem_result[] = { 0.0f, 0.0f, 0.0f };
94
95 // create Result Data sets
96 unsigned int num_corners = 0;
97 unsigned int num_modes = 0;
98 bool complex = false;
99 float value[1] ;
100
101 sim_idx = *IH3D;
102
103 if(*NUMELT != 0)
104 {
105 rc = Hyper3DDatasetBegin(h3d_file, *NUMELT, sim_idx, subcase_id, H3D_DS_ELEM,
106 H3D_DS_EROSION, num_corners, num_modes, *CPT_DATATYPE,
108 if( !rc ) fflush(stdout);
109 if( !rc ) throw rc;
110
111
112 offset = 0;
113
114 for( i = 0; i < *NUMELT + *NUMELP + *NUMELR; i++ )
115 {
116 if( ITY_ELEM[i] == 4 )
117 {
118 elem_id = ID_ELEM[i];
119 elem_result[0] = 0.0f;
120 if( FUNC[i] == 0.0f )
121 {
122 elem_result[0] = 1.0f;
123 rc = Hyper3DDatasetWrite(h3d_file, elem_id, &elem_result[0]);
124 }
125 }
126 }
127
129 if( !rc ) throw rc;
130 }
131
132 offset = *NUMELT;
133
134 if(*NUMELP != 0)
135 {
136 rc = Hyper3DDatasetBegin(h3d_file, *NUMELP, sim_idx, subcase_id, H3D_DS_ELEM,
137 H3D_DS_EROSION, num_corners, num_modes, *CPT_DATATYPE,
139 if( !rc ) fflush(stdout);
140 if( !rc ) throw rc;
141
142 for( i = 0; i < *NUMELT + *NUMELP + *NUMELR; i++ )
143 {
144 if( ITY_ELEM[i] == 5)
145 {
146 elem_id = ID_ELEM[i];
147 elem_result[0] = 0.0f;
148 if( FUNC[i] == 0.0f )
149 {
150 elem_result[0] = 1.0f;
151 rc = Hyper3DDatasetWrite(h3d_file, elem_id, &elem_result[0]);
152 }
153 }
154 }
156 if( !rc ) throw rc;
157 }
158 offset = *NUMELT + *NUMELP;
159
160 if(*NUMELR != 0)
161 {
162 rc = Hyper3DDatasetBegin(h3d_file, *NUMELR, sim_idx, subcase_id, H3D_DS_ELEM,
163 H3D_DS_EROSION, num_corners, num_modes, *CPT_DATATYPE,
165 if( !rc ) fflush(stdout);
166 if( !rc ) throw rc;
167
168 for( i = 0; i < *NUMELT + *NUMELP + *NUMELR; i++ )
169 {
170 if( ITY_ELEM[i] == 6)
171 {
172 elem_id = ID_ELEM[i];
173 elem_result[0] = 0.0f;
174 if( FUNC[i] == 0.0f )
175 {
176 elem_result[0] = 1.0f;
177 rc = Hyper3DDatasetWrite(h3d_file, elem_id, &elem_result[0]);
178 }
179 }
180 }
182 if( !rc ) throw rc;
183 }
184 } // end of try
185
186 catch(...) {
188 }
189}
H3D_ID comp_id
H3D_SIM_IDX sim_idx
H3D_ID subcase_id
bool Hyper3DDatasetBegin(H3DFileInfo *h3d_file, unsigned int count, H3D_SIM_IDX idx, H3D_ID subcase_id, H3D_DS_TYPE type, H3D_DS_FORMAT format, unsigned int num_corners, unsigned int num_modes, H3D_ID dt_id, int layer_idx, H3D_ID data_poolname_id, bool complex)
Definition h3d_dl.c:1352
bool Hyper3DDatasetEnd(H3DFileInfo *h3d_file)
Definition h3d_dl.c:1400
bool Hyper3DDatasetWrite(H3DFileInfo *h3d_file, H3D_ID id, const float *data)
Definition h3d_dl.c:1372
integer, dimension(:), allocatable offset
Definition rad2r.F:53

◆ c_h3d_eroded_oned__()

void c_h3d_eroded_oned__ ( my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
int * IXT,
int * NIXT,
int * NUMELT,
int * IPARTT,
int * IXP,
int * NIXP,
int * NUMELP,
int * IPARTP,
int * IXR,
int * NIXR,
int * NUMELR,
int * IPARTR,
my_real * FUNC,
int * ID_ELEM,
int * CPT_DATATYPE,
int * ITY_ELEM )

Definition at line 197 of file c_h3d_eroded_oned.cpp.

200{c_h3d_eroded_oned_ (TT,IH3D,ITAB,NUMNOD,IXT,NIXT,NUMELT,IPARTT,IXP,NIXP,NUMELP,IPARTP,IXR,NIXR,NUMELR,IPARTR,FUNC,ID_ELEM,CPT_DATATYPE,
201 ITY_ELEM);}