OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_eroded_solid.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_solid_ (my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXS, int *NIXS, int *NUMELS, int *IPARTS, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM, int *NUMELQ, int *NUMELT, int *NUMELP, int *NUMELR)
void _FCALL C_H3D_ERODED_SOLID (my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXS, int *NIXS, int *NUMELS, int *IPARTS, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM, int *NUMELQ, int *NUMELT, int *NUMELP, int *NUMELR)
void c_h3d_eroded_solid__ (my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXS, int *NIXS, int *NUMELS, int *IPARTS, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM, int *NUMELQ, int *NUMELT, int *NUMELP, int *NUMELR)
void c_h3d_eroded_solid (my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXS, int *NIXS, int *NUMELS, int *IPARTS, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM, int *NUMELQ, int *NUMELT, int *NUMELP, int *NUMELR)
void c_h3d_create_solid_eroded_ (int *cpt_data, char *name, int *size, int *info, char *name1, int *size1)
void _FCALL C_H3D_CREATE_SOLID_ERODED (int *cpt_data, char *name, int *size, int *info, char *name1, int *size1)
void c_h3d_create_solid_eroded__ (int *cpt_data, char *name, int *size, int *info, char *name1, int *size1)
void c_h3d_create_solid_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_solid.cpp.

◆ _FCALL [2/2]

#define _FCALL

Definition at line 50 of file c_h3d_eroded_solid.cpp.

Function Documentation

◆ C_H3D_CREATE_SOLID_ERODED()

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

Definition at line 237 of file c_h3d_eroded_solid.cpp.

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

◆ c_h3d_create_solid_eroded()

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

Definition at line 243 of file c_h3d_eroded_solid.cpp.

244{c_h3d_create_solid_eroded_ (cpt_data, name, size, info, name1, size1);}

◆ c_h3d_create_solid_eroded_()

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

Definition at line 168 of file c_h3d_eroded_solid.cpp.

169{
170 char *cname,*cname1;
171 int cname_len,cname_len1;
172 int i;
173 float node[3];
174 H3D_ID node_id;
175 unsigned int elem_count = 1;
176
177 cname_len = *size + 1;
178 cname=(char*) malloc(sizeof(char)*cname_len);
179 for(i=0;i<*size;i++) cname[i] = name[i];
180 cname[*size]='\0';
181
182 cname_len1 = *size1 + 1;
183 cname1=(char*) malloc(sizeof(char)*cname_len1);
184 for(i=0;i<*size1;i++) cname1[i] = name1[i];
185 cname1[*size1]='\0';
186
187 char * LAYERPOOL = new char [*size1+11];
188 sprintf(LAYERPOOL, "%s %d" ,cname1,*info);
189 H3D_ID layer_pool_id = H3D_NULL_ID;
190 rc = Hyper3DAddString(h3d_file, LAYERPOOL, &layer_pool_id);
191
192 char edata_type[30];
193//
194
195 //printf( "scalar %d info = %d %s\n", *cpt_data , *info, name);
196 //fflush(stdout);
197
198 try {
199 // create result data types
200 dt_count++;
201
203 if( !rc ) throw rc;
204
205 pool_count = 2;
206
207 dt_id++;
208 //snprintf(edata_type, sizeof(edata_type), cname, H3D_DT_DELIMITER);
209 sprintf(edata_type, cname, H3D_DT_DELIMITER);
210 rc = Hyper3DDatatypeWrite(h3d_file, edata_type, *cpt_data , H3D_DS_EROSION,
211 H3D_DS_ELEM, pool_count);
212 if( !rc ) throw rc;
213
214 rc = Hyper3DDatatypeDescriptionWrite(h3d_file,dt_id, "N/A : element not deleted");
215
218 if( !rc ) throw rc;
219
221 if( !rc ) throw rc;
222
223 } // end of try
224
225 catch(...) {
227 }
228 delete [] LAYERPOOL;
229 free(cname);
230 free(cname1);
231
232}
H3DFileInfo * h3d_file
unsigned int pool_count
unsigned int dt_count
bool has_corners
bool rc
float poisson
H3D_ID * layername_ids
H3D_ID solid_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_solid_eroded__()

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

Definition at line 240 of file c_h3d_eroded_solid.cpp.

241{c_h3d_create_solid_eroded_ (cpt_data, name, size, info, name1, size1);}

◆ C_H3D_ERODED_SOLID()

void _FCALL C_H3D_ERODED_SOLID ( my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
int * IXS,
int * NIXS,
int * NUMELS,
int * IPARTS,
my_real * FUNC,
int * ID_ELEM,
int * CPT_DATATYPE,
int * ITY_ELEM,
int * NUMELQ,
int * NUMELT,
int * NUMELP,
int * NUMELR )

Definition at line 146 of file c_h3d_eroded_solid.cpp.

149{c_h3d_eroded_solid_ (TT,IH3D,ITAB,NUMNOD,IXS,NIXS,NUMELS,IPARTS,FUNC,ID_ELEM,CPT_DATATYPE,ITY_ELEM,
150 NUMELQ,NUMELT,NUMELP,NUMELR);}
void c_h3d_eroded_solid_(my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXS, int *NIXS, int *NUMELS, int *IPARTS, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM, int *NUMELQ, int *NUMELT, int *NUMELP, int *NUMELR)
#define FUNC
Definition clamov.c:8

◆ c_h3d_eroded_solid()

void c_h3d_eroded_solid ( my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
int * IXS,
int * NIXS,
int * NUMELS,
int * IPARTS,
my_real * FUNC,
int * ID_ELEM,
int * CPT_DATATYPE,
int * ITY_ELEM,
int * NUMELQ,
int * NUMELT,
int * NUMELP,
int * NUMELR )

Definition at line 158 of file c_h3d_eroded_solid.cpp.

161{c_h3d_eroded_solid_ (TT,IH3D,ITAB,NUMNOD,IXS,NIXS,NUMELS,IPARTS,FUNC,ID_ELEM,CPT_DATATYPE,ITY_ELEM,
162 NUMELQ,NUMELT,NUMELP,NUMELR);}

◆ c_h3d_eroded_solid_()

void c_h3d_eroded_solid_ ( my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
int * IXS,
int * NIXS,
int * NUMELS,
int * IPARTS,
my_real * FUNC,
int * ID_ELEM,
int * CPT_DATATYPE,
int * ITY_ELEM,
int * NUMELQ,
int * NUMELT,
int * NUMELP,
int * NUMELR )

Definition at line 80 of file c_h3d_eroded_solid.cpp.

83{
84 int i;
85 int offset;
86 H3D_ID elem_id;
87 H3D_ID comp_id;
88//
89 // initialize
90
91 try {
92 // create Subcase (Loadcase)
93 unsigned int max_sims = 10;
94 unsigned int sub_count = 1;
95 float elem_result[] = { 0.0f, 0.0f, 0.0f };
96
97 // create Result Data sets
98 unsigned int num_corners = 0;
99 unsigned int num_modes = 0;
100 bool complex = false;
101 unsigned int cpt1 = 0;
102 float value[1] ;
103
104 sim_idx = *IH3D;
105
106 if(*NUMELS != 0)
107 {
108 rc = Hyper3DDatasetBegin(h3d_file, *NUMELS, sim_idx, subcase_id, H3D_DS_ELEM,
109 H3D_DS_EROSION, num_corners, num_modes, *CPT_DATATYPE,
111 if( !rc ) fflush(stdout);
112 if( !rc ) throw rc;
113
114 offset = 0;
115
116 for( i = 0; i < *NUMELS; i++ )
117 {
118 if( ITY_ELEM[i] == 1 )
119 {
120 elem_id = ID_ELEM[i];
121 elem_result[0] = 0.0f;
122 if( FUNC[i] == 0.0f )
123 {
124 elem_result[0] = 1.0f;
125 rc = Hyper3DDatasetWrite(h3d_file, elem_id, &elem_result[0]);
126
127 if( !rc ) fflush(stdout);
128 if( !rc ) throw rc;
129 }
130 }
131 }
132
134 if( !rc ) throw rc;
135 }
136
137
138 } // end of try
139
140 catch(...) {
142 }
143
144}
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_solid__()

void c_h3d_eroded_solid__ ( my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
int * IXS,
int * NIXS,
int * NUMELS,
int * IPARTS,
my_real * FUNC,
int * ID_ELEM,
int * CPT_DATATYPE,
int * ITY_ELEM,
int * NUMELQ,
int * NUMELT,
int * NUMELP,
int * NUMELR )

Definition at line 152 of file c_h3d_eroded_solid.cpp.

155{c_h3d_eroded_solid_ (TT,IH3D,ITAB,NUMNOD,IXS,NIXS,NUMELS,IPARTS,FUNC,ID_ELEM,CPT_DATATYPE,ITY_ELEM,
156 NUMELQ,NUMELT,NUMELP,NUMELR);}