OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_create_shell_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_shell_vector_datatype_ (int *cpt_data, char *name1, int *size1, int *info1, int *info2, char *name2, int *size2, int *layer, int *ipt, int *ply, int *nuvar, int *gauss, char *comment, int *s_comment)
void _FCALL C_H3D_CREATE_SHELL_VECTOR_DATATYPE (int *cpt_data, char *name1, int *size1, int *info1, int *info2, char *name2, int *size2, int *layer, int *ipt, int *ply, int *nuvar, int *gauss, char *comment, int *s_comment)
void c_h3d_create_shell_vector_datatype__ (int *cpt_data, char *name1, int *size1, int *info1, int *info2, char *name2, int *size2, int *layer, int *ipt, int *ply, int *nuvar, int *gauss, char *comment, int *s_comment)
void c_create_shell_vector_datatype (int *cpt_data, char *name1, int *size1, int *info1, int *info2, char *name2, int *size2, int *layer, int *ipt, int *ply, int *nuvar, int *gauss, char *comment, int *s_comment)

Macro Definition Documentation

◆ _FCALL [1/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_shell_vector_datatype.cpp.

◆ _FCALL [2/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_shell_vector_datatype.cpp.

Function Documentation

◆ c_create_shell_vector_datatype()

void c_create_shell_vector_datatype ( int * cpt_data,
char * name1,
int * size1,
int * info1,
int * info2,
char * name2,
int * size2,
int * layer,
int * ipt,
int * ply,
int * nuvar,
int * gauss,
char * comment,
int * s_comment )

Definition at line 301 of file c_h3d_create_shell_vector_datatype.cpp.

304{c_h3d_create_shell_vector_datatype_ (cpt_data, name1, size1, info1, info2, name2, size2,layer,ipt,ply,nuvar,gauss,comment,s_comment);}
void c_h3d_create_shell_vector_datatype_(int *cpt_data, char *name1, int *size1, int *info1, int *info2, char *name2, int *size2, int *layer, int *ipt, int *ply, int *nuvar, int *gauss, char *comment, int *s_comment)

◆ C_H3D_CREATE_SHELL_VECTOR_DATATYPE()

void _FCALL C_H3D_CREATE_SHELL_VECTOR_DATATYPE ( int * cpt_data,
char * name1,
int * size1,
int * info1,
int * info2,
char * name2,
int * size2,
int * layer,
int * ipt,
int * ply,
int * nuvar,
int * gauss,
char * comment,
int * s_comment )

Definition at line 291 of file c_h3d_create_shell_vector_datatype.cpp.

294{c_h3d_create_shell_vector_datatype_ (cpt_data, name1, size1, info1, info2, name2, size2,layer,ipt,ply,nuvar,gauss,comment,s_comment);}

◆ c_h3d_create_shell_vector_datatype_()

void c_h3d_create_shell_vector_datatype_ ( int * cpt_data,
char * name1,
int * size1,
int * info1,
int * info2,
char * name2,
int * size2,
int * layer,
int * ipt,
int * ply,
int * nuvar,
int * gauss,
char * comment,
int * s_comment )

Definition at line 71 of file c_h3d_create_shell_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 * IPT_STRING = new char [100];
103 IPT_STRING[0] ='\0';
104 char * GAUSS_STRING = new char [100];
105 GAUSS_STRING[0] ='\0';
106 char * PLY_STRING = new char [100];
107 PLY_STRING[0] ='\0';
108 char * NUVAR_STRING = new char [100];
109 NUVAR_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#ifdef _WIN64
118 strcat_s(RES_STRING,100,cname);
119#else
120 RES_STRING = strcat(RES_STRING,cname);
121#endif
122 if(*nuvar > 0)
123 {
124 sprintf(NUVAR_STRING, " %d ",*nuvar);
125#ifdef _WIN64
126 strcat_s(RES_STRING,100,NUVAR_STRING);
127#else
128 RES_STRING = strcat(RES_STRING,NUVAR_STRING);
129#endif
130 }
131
132 if(*layer > 0 || *ipt > 0 || *ply > 0|| *gauss > 0)
133 {
134
135 if(*layer > 0 && *ipt > 0)
136 {
137 sprintf(LAYER_STRING, "LAYER/IPT %d %d " ,*layer,*ipt);
138#ifdef _WIN64
139 strcat_s(LAYERPOOL,100,LAYER_STRING);
140#else
141 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
142#endif
143 }
144 else if(*layer > 0)
145 {
146 sprintf(LAYER_STRING, "LAYER %d " ,*layer);
147#ifdef _WIN64
148 strcat_s(LAYERPOOL,100,LAYER_STRING);
149#else
150 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
151#endif
152 }
153 else if(*ply > 0 && *ipt > 0)
154 {
155 sprintf(PLY_STRING, "PLY/IPT %d %d" ,*ply,*ipt);
156#ifdef _WIN64
157 strcat_s(LAYERPOOL,100,PLY_STRING);
158#else
159 LAYERPOOL = strcat(LAYERPOOL,PLY_STRING);
160#endif
161 }
162 else if(*ipt > 0)
163 {
164 sprintf(IPT_STRING, "IPT %d " ,*ipt);
165#ifdef _WIN64
166 strcat_s(LAYERPOOL,100,IPT_STRING);
167#else
168 LAYERPOOL = strcat(LAYERPOOL,IPT_STRING);
169#endif
170 }
171 else if(*ply > 0)
172 {
173 sprintf(IPT_STRING, "PLY %d " ,*ply);
174#ifdef _WIN64
175 strcat_s(LAYERPOOL,100,IPT_STRING);
176#else
177 LAYERPOOL = strcat(LAYERPOOL,IPT_STRING);
178#endif
179 }
180 }
181 else if(*layer < -1 || *ipt < -1 )
182 {
183 if(*layer == -2)
184 {
185 sprintf(LAYER_STRING, "Layer Lower " );
186#ifdef _WIN64
187 strcat_s(LAYERPOOL,100,LAYER_STRING);
188#else
189 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
190#endif
191 }
192 if(*layer == -3)
193 {
194 sprintf(LAYER_STRING, "Layer Upper " );
195#ifdef _WIN64
196 strcat_s(LAYERPOOL,100,LAYER_STRING);
197#else
198 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
199#endif
200 }
201 if(*ipt == -2)
202 {
203 sprintf(IPT_STRING, "ipt Lower " );
204#ifdef _WIN64
205 strcat_s(LAYERPOOL,100,IPT_STRING);
206#else
207 LAYERPOOL = strcat(LAYERPOOL,IPT_STRING);
208#endif
209 }
210 if(*ipt == -3)
211 {
212 sprintf(IPT_STRING, "ipt Upper " );
213#ifdef _WIN64
214 strcat_s(LAYERPOOL,100,IPT_STRING);
215#else
216 LAYERPOOL = strcat(LAYERPOOL,IPT_STRING);
217#endif
218 }
219 }
220 else
221 {
222 sprintf(IPT_STRING, "Mid" );
223#ifdef _WIN64
224 strcat_s(LAYERPOOL,100,IPT_STRING);
225#else
226 LAYERPOOL = strcat(LAYERPOOL,IPT_STRING);
227#endif
228 }
229 rc = Hyper3DAddString(h3d_file, LAYERPOOL, &layer_pool_id);
230
231 char edata_type[50];
232//
233
234 //printf( "scalar %d info = %d %s\n", *cpt_data , *info1, name);
235 //fflush(stdout);
236
237 try {
238 // create result data types
239 dt_count++;
240
242 if( !rc ) throw rc;
243
244 pool_count = 2;
245
246 dt_id++;
247 sprintf(edata_type, RES_STRING, H3D_DT_DELIMITER);
248
249 rc = Hyper3DDatatypeWrite(h3d_file, edata_type, *cpt_data , H3D_DS_VECTOR,
250 H3D_DS_ELEM, pool_count);
251 if( !rc ) throw rc;
252
253 if (strlen(ccomment) != 0)
254 {
255 rc = Hyper3DDatatypeDescriptionWrite(h3d_file, *cpt_data, ccomment);
256 if( !rc ) throw rc;
257 }
258
260 &layer_pool_id, has_corners, tensor_type, poisson);
261 if( !rc ) throw rc;
262
264 &layer_pool_id, has_corners, tensor_type, poisson);
265 if( !rc ) throw rc;
266
268 if( !rc ) throw rc;
269
270 } // end of try
271
272 catch(...) {
274 }
275 delete [] LAYERPOOL;
276 delete [] LAYER_STRING;
277 delete [] IPT_STRING;
278 delete [] GAUSS_STRING;
279 delete [] PLY_STRING;
280 delete [] NUVAR_STRING;
281 delete [] MID_STRING;
282 delete [] RES_STRING;
283 free(cname);
284 free(ccomment);
285
286}
H3DFileInfo * h3d_file
unsigned int pool_count
unsigned int dt_count
bool has_corners
bool rc
float poisson
H3D_ID sh4n_poolname_id
H3D_ID sh3n_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_shell_vector_datatype__()

void c_h3d_create_shell_vector_datatype__ ( int * cpt_data,
char * name1,
int * size1,
int * info1,
int * info2,
char * name2,
int * size2,
int * layer,
int * ipt,
int * ply,
int * nuvar,
int * gauss,
char * comment,
int * s_comment )

Definition at line 296 of file c_h3d_create_shell_vector_datatype.cpp.

299{c_h3d_create_shell_vector_datatype_ (cpt_data, name1, size1, info1, info2, name2, size2,layer,ipt,ply,nuvar,gauss,comment,s_comment);}