OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_create_skin_tensor_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_skin_tensor_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_SKIN_TENSOR_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_skin_tensor_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_skin_tensor_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_skin_tensor_datatype.cpp.

◆ _FCALL [2/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_skin_tensor_datatype.cpp.

Function Documentation

◆ c_create_skin_tensor_datatype()

void c_create_skin_tensor_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 269 of file c_h3d_create_skin_tensor_datatype.cpp.

272{c_h3d_create_skin_tensor_datatype_ (cpt_data, name1, size1, info, name2, size2, layer, nuvar, ir, is, it, comment, s_comment);}
void c_h3d_create_skin_tensor_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_SKIN_TENSOR_DATATYPE()

void _FCALL C_H3D_CREATE_SKIN_TENSOR_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 259 of file c_h3d_create_skin_tensor_datatype.cpp.

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

◆ c_h3d_create_skin_tensor_datatype_()

void c_h3d_create_skin_tensor_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_skin_tensor_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
113/* if( strncmp(cname,"Strain",6) == 0 ) tensor_type = H3D_DS_STRAIN; */
114 if( strncmp(cname,"Strain",6) == 0 ) tensor_type = H3D_DS_STRAIN_2D;
115 if( strncmp(cname,"Stress",6) == 0 ) tensor_type = H3D_DS_STRESS_2D;
116 if( strncmp(cname,"Strn rate",9) == 0 ) tensor_type = H3D_DS_STRAIN_2D;
117
118 H3D_ID layer_pool_id = H3D_NULL_ID;
119 if(*layer > 0 || *nuvar > 0 || *ir > 0 || *is > 0 || *it > 0 )
120 {
121
122 if(*nuvar > 0 && *layer > 0 && *ir > 0 && *is > 0)
123 {
124 sprintf(LAYER_STRING, "USER VARIABLE %d / LAYER IR IS %d %d %d" ,*nuvar,*ir,*is,*it);
125#ifdef _WIN64
126 strcat_s(LAYERPOOL,100,LAYER_STRING);
127#else
128 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
129#endif
130 }
131 else if(*nuvar > 0 && *ir > 0 && *is > 0 && *it > 0)
132 {
133 sprintf(LAYER_STRING, "USER VARIABLE %d / IR IS IT %d %d %d" ,*nuvar,*ir,*is,*it);
134#ifdef _WIN64
135 strcat_s(LAYERPOOL,100,LAYER_STRING);
136#else
137 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
138#endif
139 }
140 else if(*nuvar > 0)
141 {
142 sprintf(LAYER_STRING, "USER VARIABLE %d " ,*nuvar);
143#ifdef _WIN64
144 strcat_s(LAYERPOOL,100,LAYER_STRING);
145#else
146 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
147#endif
148 }
149 else if(*layer > 0 && *ir > 0 && *is > 0 )
150 {
151 sprintf(LAYER_STRING, "LAYER IR IS %d %d %d " ,*layer,*ir,*is);
152#ifdef _WIN64
153 strcat_s(LAYERPOOL,100,LAYER_STRING);
154#else
155 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
156#endif
157 }
158 else if(*layer > 0)
159 {
160 sprintf(LAYER_STRING, "LAYER %d " ,*layer);
161#ifdef _WIN64
162 strcat_s(LAYERPOOL,100,LAYER_STRING);
163#else
164 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
165#endif
166 }
167 else if(*ir > 0 && *is > 0 && *it > 0)
168 {
169 sprintf(LAYER_STRING, "IR IS IT %d %d %d" ,*ir,*is,*it);
170#ifdef _WIN64
171 strcat_s(LAYERPOOL,100,LAYER_STRING);
172#else
173 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
174#endif
175 }
176 }
177 else if(*layer < -1 )
178 {
179 if(*layer == -2)
180 {
181 sprintf(LAYER_STRING, "Layer Lower " );
182#ifdef _WIN64
183 strcat_s(LAYERPOOL,100,LAYER_STRING);
184#else
185 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
186#endif
187 }
188 if(*layer == -3)
189 {
190 sprintf(LAYER_STRING, "Layer Upper " );
191#ifdef _WIN64
192 strcat_s(LAYERPOOL,100,LAYER_STRING);
193#else
194 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
195#endif
196 }
197 }
198 else
199 {
200 sprintf(LAYER_STRING, "OUTER" );
201#ifdef _WIN64
202 strcat_s(LAYERPOOL,100,LAYER_STRING);
203#else
204 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
205#endif
206 }
207 rc = Hyper3DAddString(h3d_file, LAYERPOOL, &layer_pool_id);
208
209 char edata_type[50];
210
211 try {
212 // create result data types
213 dt_count++;
214
216 if( !rc ) throw rc;
217
218 pool_count = 2;
219
220 dt_id++;
221 sprintf(edata_type, cname, H3D_DT_DELIMITER);
222
223 rc = Hyper3DDatatypeWrite(h3d_file, edata_type, *cpt_data , H3D_DS_TENSOR2D,
224 H3D_DS_ELEM, pool_count);
225 if( !rc ) throw rc;
226
227 if (strlen(ccomment) != 0)
228 {
229 rc = Hyper3DDatatypeDescriptionWrite(h3d_file, *cpt_data, ccomment);
230 if( !rc ) throw rc;
231 }
232
234 &layer_pool_id, has_corners, tensor_type, poisson);
235 if( !rc ) throw rc;
236
238 if( !rc ) throw rc;
239
240 } // end of try
241
242 catch(...) {
244 }
245 delete [] LAYERPOOL;
246 delete [] LAYER_STRING;
247 delete [] NUVAR_STRING;
248 delete [] IR_STRING;
249 delete [] IS_STRING;
250 delete [] IT_STRING;
251 delete [] MID_STRING;
252 free(cname);
253 free(ccomment);
254
255}
H3DFileInfo * h3d_file
unsigned int pool_count
unsigned int dt_count
bool has_corners
bool rc
float poisson
H3D_ID skin_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_skin_tensor_datatype__()

void c_h3d_create_skin_tensor_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 264 of file c_h3d_create_skin_tensor_datatype.cpp.

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