OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_create_solid_vector_datatype.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_solid_vector_datatype_ (int *cpt_data, char *name1, int *size1, int *info, char *name2, int *size2, int *layer, int *nuvar, int *ir, int *is, int *it, char *comment, int *s_comment)
void _FCALL C_H3D_CREATE_SOLID_VECTOR_DATATYPE (int *cpt_data, char *name1, int *size1, int *info, char *name2, int *size2, int *layer, int *nuvar, int *ir, int *is, int *it, char *comment, int *s_comment)
void c_h3d_create_solid_vector_datatype__ (int *cpt_data, char *name1, int *size1, int *info, char *name2, int *size2, int *layer, int *nuvar, int *ir, int *is, int *it, char *comment, int *s_comment)
void c_create_solid_vector_datatype (int *cpt_data, char *name1, int *size1, int *info, char *name2, int *size2, int *layer, int *nuvar, int *ir, int *is, int *it, char *comment, int *s_comment)

Macro Definition Documentation

◆ _FCALL [1/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_solid_vector_datatype.cpp.

◆ _FCALL [2/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_solid_vector_datatype.cpp.

Function Documentation

◆ c_create_solid_vector_datatype()

void c_create_solid_vector_datatype ( int * cpt_data,
char * name1,
int * size1,
int * info,
char * name2,
int * size2,
int * layer,
int * nuvar,
int * ir,
int * is,
int * it,
char * comment,
int * s_comment )

Definition at line 291 of file c_h3d_create_solid_vector_datatype.cpp.

294{c_h3d_create_solid_vector_datatype_ (cpt_data, name1, size1, info, name2, size2, layer, nuvar, ir, is, it, comment, s_comment);}
void c_h3d_create_solid_vector_datatype_(int *cpt_data, char *name1, int *size1, int *info, char *name2, int *size2, int *layer, int *nuvar, int *ir, int *is, int *it, char *comment, int *s_comment)

◆ C_H3D_CREATE_SOLID_VECTOR_DATATYPE()

void _FCALL C_H3D_CREATE_SOLID_VECTOR_DATATYPE ( int * cpt_data,
char * name1,
int * size1,
int * info,
char * name2,
int * size2,
int * layer,
int * nuvar,
int * ir,
int * is,
int * it,
char * comment,
int * s_comment )

Definition at line 281 of file c_h3d_create_solid_vector_datatype.cpp.

284{c_h3d_create_solid_vector_datatype_ (cpt_data, name1, size1, info, name2, size2, layer, nuvar, ir, is, it, comment, s_comment);}

◆ c_h3d_create_solid_vector_datatype_()

void c_h3d_create_solid_vector_datatype_ ( int * cpt_data,
char * name1,
int * size1,
int * info,
char * name2,
int * size2,
int * layer,
int * nuvar,
int * ir,
int * is,
int * it,
char * comment,
int * s_comment )

Definition at line 71 of file c_h3d_create_solid_vector_datatype.cpp.

74{
75 char *cname,*cname2,*ccomment;
76 int cname_len,cname_len1,ccomment_len;
77 int i,cpt_size;
78 float node[3];
79 H3D_ID node_id;
80 unsigned int elem_count = 1;
81
82 cname_len = *size1 + 1;
83 cname=(char*) malloc(sizeof(char)*cname_len);
84 for(i=0;i<*size1;i++) cname[i] = name1[i];
85
86 cpt_size = 0;
87 for(i=0;i<*size1;i++)
88 {
89 if(name1[i] != ' ') cpt_size = i;
90 }
91 cname[cpt_size+1]='\0';
92
93 ccomment_len = *s_comment + 1;
94 ccomment=(char*) malloc(sizeof(char)*ccomment_len);
95 for(i=0;i<*s_comment;i++) ccomment[i] = comment[i];
96 ccomment[*s_comment]='\0';
97
98 char * LAYERPOOL = new char [100];
99 LAYERPOOL[0] ='\0';
100 char * LAYER_STRING = new char [100];
101 LAYER_STRING[0] ='\0';
102 char * NUVAR_STRING = new char [100];
103 NUVAR_STRING[0] ='\0';
104 char * IR_STRING = new char [100];
105 IR_STRING[0] ='\0';
106 char * IS_STRING = new char [100];
107 IS_STRING[0] ='\0';
108 char * IT_STRING = new char [100];
109 IT_STRING[0] ='\0';
110 char * MID_STRING = new char [100];
111 MID_STRING[0] ='\0';
112 char * RES_STRING = new char [100];
113 RES_STRING[0] ='\0';
114
115 H3D_ID layer_pool_id = H3D_NULL_ID;
116
117
118#ifdef _WIN64
119 strcat_s(RES_STRING,100,cname);
120#else
121 RES_STRING = strcat(RES_STRING,cname);
122#endif
123 if(*nuvar > 0)
124 {
125 sprintf(NUVAR_STRING, " %d ",*nuvar);
126#ifdef _WIN64
127 strcat_s(RES_STRING,100,NUVAR_STRING);
128#else
129 RES_STRING = strcat(RES_STRING,NUVAR_STRING);
130#endif
131 }
132
133 if(*layer > 0 || *nuvar > 0 || *ir > 0 || *is > 0 || *it > 0 )
134 {
135
136 if(*nuvar > 0 && *layer > 0 && *ir > 0 && *is > 0)
137 {
138 sprintf(LAYER_STRING, "USER VARIABLE %d / LAYER IR IS %d %d %d" ,*nuvar,*ir,*is,*it);
139#ifdef _WIN64
140 strcat_s(LAYERPOOL,100,LAYER_STRING);
141#else
142 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
143#endif
144 }
145 else if(*nuvar > 0 && *ir > 0 && *is > 0 && *it > 0)
146 {
147 sprintf(LAYER_STRING, "USER VARIABLE %d / IR IS IT %d %d %d" ,*nuvar,*ir,*is,*it);
148#ifdef _WIN64
149 strcat_s(LAYERPOOL,100,LAYER_STRING);
150#else
151 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
152#endif
153 }
154 else if(*nuvar > 0)
155 {
156 sprintf(LAYER_STRING, "USER VARIABLE %d " ,*nuvar);
157#ifdef _WIN64
158 strcat_s(LAYERPOOL,100,LAYER_STRING);
159#else
160 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
161#endif
162 }
163 else if(*layer > 0 && *ir > 0 && *is > 0 )
164 {
165 sprintf(LAYER_STRING, "LAYER IR IS %d %d %d " ,*layer,*ir,*is);
166#ifdef _WIN64
167 strcat_s(LAYERPOOL,100,LAYER_STRING);
168#else
169 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
170#endif
171 }
172 else if(*layer > 0)
173 {
174 sprintf(LAYER_STRING, "LAYER %d " ,*layer);
175#ifdef _WIN64
176 strcat_s(LAYERPOOL,100,LAYER_STRING);
177#else
178 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
179#endif
180 }
181 else if(*ir > 0 && *is > 0 && *it > 0)
182 {
183 sprintf(LAYER_STRING, "IR IS IT %d %d %d" ,*ir,*is,*it);
184#ifdef _WIN64
185 strcat_s(LAYERPOOL,100,LAYER_STRING);
186#else
187 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
188#endif
189 }
190 }
191 else if(*layer < -1 )
192 {
193 if(*layer == -2)
194 {
195 sprintf(LAYER_STRING, "Layer Lower " );
196#ifdef _WIN64
197 strcat_s(LAYERPOOL,100,LAYER_STRING);
198#else
199 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
200#endif
201 }
202 if(*layer == -3)
203 {
204 sprintf(LAYER_STRING, "Layer Upper " );
205#ifdef _WIN64
206 strcat_s(LAYERPOOL,100,LAYER_STRING);
207#else
208 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
209#endif
210 }
211 }
212 else
213 {
214 sprintf(LAYER_STRING, "Mid" );
215#ifdef _WIN64
216 strcat_s(LAYERPOOL,100,LAYER_STRING);
217#else
218 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
219#endif
220 }
221 rc = Hyper3DAddString(h3d_file, LAYERPOOL, &layer_pool_id);
222
223 char edata_type[50];
224//
225
226 //printf( "scalar %d info = %d %s\n", *cpt_data , *info1, name);
227 //fflush(stdout);
228
229 try {
230 // create result data types
231 dt_count++;
232
234 if( !rc ) throw rc;
235
236 pool_count = 2;
237
238 dt_id++;
239 sprintf(edata_type, RES_STRING, H3D_DT_DELIMITER);
240
241 rc = Hyper3DDatatypeWrite(h3d_file, edata_type, *cpt_data , H3D_DS_VECTOR,
242 H3D_DS_ELEM, pool_count);
243 if( !rc ) throw rc;
244
245 if (strlen(ccomment) != 0)
246 {
247 rc = Hyper3DDatatypeDescriptionWrite(h3d_file, *cpt_data, ccomment);
248 if( !rc ) throw rc;
249 }
250
252 &layer_pool_id, has_corners, tensor_type, poisson);
253 if( !rc ) throw rc;
254
256 &layer_pool_id, has_corners, tensor_type, poisson);
257 if( !rc ) throw rc;
258
260 if( !rc ) throw rc;
261
262 } // end of try
263
264 catch(...) {
266 }
267 delete [] LAYERPOOL;
268 delete [] LAYER_STRING;
269 delete [] NUVAR_STRING;
270 delete [] IR_STRING;
271 delete [] IS_STRING;
272 delete [] IT_STRING;
273 delete [] MID_STRING;
274 delete [] RES_STRING;
275 free(cname);
276 free(ccomment);
277}
H3DFileInfo * h3d_file
unsigned int pool_count
unsigned int dt_count
bool has_corners
bool rc
float poisson
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_vector_datatype__()

void c_h3d_create_solid_vector_datatype__ ( int * cpt_data,
char * name1,
int * size1,
int * info,
char * name2,
int * size2,
int * layer,
int * nuvar,
int * ir,
int * is,
int * it,
char * comment,
int * s_comment )

Definition at line 286 of file c_h3d_create_solid_vector_datatype.cpp.

289{c_h3d_create_solid_vector_datatype_ (cpt_data, name1, size1, info, name2, size2, layer, nuvar, ir, is, it, comment, s_comment);}