OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_create_1d_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_1d_tensor_datatype_ (int *cpt_data, char *name, int *size, int *info1, char *name1, int *size1, char *comment, int *s_comment, int *ipt)
void _FCALL C_H3D_CREATE_1D_TENSOR_DATATYPE (int *cpt_data, char *name, int *size, int *info1, char *name1, int *size1, char *comment, int *s_comment, int *ipt)
void c_h3d_create_1d_tensor_datatype__ (int *cpt_data, char *name, int *size, int *info1, char *name1, int *size1, char *comment, int *s_comment, int *ipt)
void c_create_1d_tensor_datatype (int *cpt_data, char *name, int *size, int *info1, char *name1, int *size1, char *comment, int *s_comment, int *ipt)

Macro Definition Documentation

◆ _FCALL [1/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_1d_tensor_datatype.cpp.

◆ _FCALL [2/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_1d_tensor_datatype.cpp.

Function Documentation

◆ c_create_1d_tensor_datatype()

void c_create_1d_tensor_datatype ( int * cpt_data,
char * name,
int * size,
int * info1,
char * name1,
int * size1,
char * comment,
int * s_comment,
int * ipt )

Definition at line 199 of file c_h3d_create_1d_tensor_datatype.cpp.

201{c_h3d_create_1d_tensor_datatype_ (cpt_data, name, size, info1, name1, size1, comment, s_comment, ipt);}
void c_h3d_create_1d_tensor_datatype_(int *cpt_data, char *name, int *size, int *info1, char *name1, int *size1, char *comment, int *s_comment, int *ipt)

◆ C_H3D_CREATE_1D_TENSOR_DATATYPE()

void _FCALL C_H3D_CREATE_1D_TENSOR_DATATYPE ( int * cpt_data,
char * name,
int * size,
int * info1,
char * name1,
int * size1,
char * comment,
int * s_comment,
int * ipt )

Definition at line 191 of file c_h3d_create_1d_tensor_datatype.cpp.

193{c_h3d_create_1d_tensor_datatype_ (cpt_data, name, size, info1, name1, size1, comment, s_comment, ipt);}

◆ c_h3d_create_1d_tensor_datatype_()

void c_h3d_create_1d_tensor_datatype_ ( int * cpt_data,
char * name,
int * size,
int * info1,
char * name1,
int * size1,
char * comment,
int * s_comment,
int * ipt )

Definition at line 71 of file c_h3d_create_1d_tensor_datatype.cpp.

73{
74
75 char *cname,*cname1,*ccomment;
76 int cname_len,cname_len1,ccomment_len;
77 int i;
78 float node[3];
79 H3D_ID node_id;
80 unsigned int elem_count = 1;
81//
82 cname_len = *size + 1;
83 cname=(char*) malloc(sizeof(char)*cname_len);
84 for(i=0;i<*size;i++) cname[i] = name[i];
85 cname[*size]='\0';
86
87 cname_len1 = *size1 + 1;
88 cname1=(char*) malloc(sizeof(char)*cname_len1);
89 for(i=0;i<*size1;i++) cname1[i] = name1[i];
90 cname1[*size1]='\0';
91
92 ccomment_len = *s_comment + 1;
93 ccomment=(char*) malloc(sizeof(char)*ccomment_len);
94 for(i=0;i<*s_comment;i++) ccomment[i] = comment[i];
95 ccomment[*s_comment]='\0';
96
97 char * LAYERPOOL = new char [100];
98 LAYERPOOL[0] ='\0';
99 char * IPT_STRING = new char [100];
100 IPT_STRING[0] ='\0';
101
102 H3D_ID layer_pool_id = H3D_NULL_ID;
103 if(*ipt > 0)
104 {
105 sprintf(IPT_STRING, "IPT %d" ,*ipt);
106 }
107 else
108 {
109 sprintf(IPT_STRING, "Mid" );
110 }
111
112#ifdef _WIN64
113 strcat_s(LAYERPOOL,100,IPT_STRING);
114#else
115 LAYERPOOL = strcat(LAYERPOOL,IPT_STRING);
116#endif
117
118 rc = Hyper3DAddString(h3d_file, LAYERPOOL, &layer_pool_id);
119
120
121 char edata_type[50];
122
123 try {
124
125 char TRUSSPOOL[] = "TRUSS";
127 if( !rc ) throw rc;
128
129 char BEAMPOOL[] = "BEAM";
131 if( !rc ) throw rc;
132
133 char SPRINGPOOL[] = "SPRING";
135 if( !rc ) throw rc;
136
137 // create result data types
138 dt_count++;
139
141 if( !rc ) throw rc;
142
143 pool_count = 3;
144
145 dt_id++;
146 sprintf(edata_type, cname, H3D_DT_DELIMITER);
147
148 rc = Hyper3DDatatypeWrite(h3d_file, edata_type, *cpt_data , H3D_DS_TENSOR3D,
149 H3D_DS_ELEM, pool_count);
150 if( !rc ) throw rc;
151
152 if (strlen(ccomment) != 0)
153 {
154 rc = Hyper3DDatatypeDescriptionWrite(h3d_file, *cpt_data, ccomment);
155 if( !rc ) throw rc;
156 }
157
158
159 if (*cpt_data != 0)
160 {
162 &layer_pool_id, has_corners, tensor_type, poisson);
163 if( !rc ) throw rc;
164
166 &layer_pool_id, has_corners, tensor_type, poisson);
167 if( !rc ) throw rc;
168
170 &layer_pool_id, has_corners, tensor_type, poisson);
171 }
172
174 if( !rc ) throw rc;
175
176 } // end of try
177
178 catch(...) {
180 }
181 delete [] LAYERPOOL;
182 free(cname);
183 free(cname1);
184 free(ccomment);
185
186}
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 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_1d_tensor_datatype__()

void c_h3d_create_1d_tensor_datatype__ ( int * cpt_data,
char * name,
int * size,
int * info1,
char * name1,
int * size1,
char * comment,
int * s_comment,
int * ipt )

Definition at line 195 of file c_h3d_create_1d_tensor_datatype.cpp.

197{c_h3d_create_1d_tensor_datatype_ (cpt_data, name, size, info1, name1, size1, comment, s_comment, ipt);}