OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_create_1d_scalar_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_scalar_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_SCALAR_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_scalar_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_scalar_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_scalar_datatype.cpp.

◆ _FCALL [2/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_1d_scalar_datatype.cpp.

Function Documentation

◆ c_create_1d_scalar_datatype()

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

Definition at line 238 of file c_h3d_create_1d_scalar_datatype.cpp.

240{c_h3d_create_1d_scalar_datatype_ (cpt_data, name, size, info1, name1, size1, comment, s_comment, ipt);}
void c_h3d_create_1d_scalar_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_SCALAR_DATATYPE()

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

Definition at line 230 of file c_h3d_create_1d_scalar_datatype.cpp.

232{c_h3d_create_1d_scalar_datatype_ (cpt_data, name, size, info1, name1, size1, comment, s_comment, ipt);}

◆ c_h3d_create_1d_scalar_datatype_()

void c_h3d_create_1d_scalar_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_scalar_datatype.cpp.

73{
74 char *cname,*cname1,*ccomment;
75 int cname_len,cname_len1,ccomment_len;
76 int i,cpt_size;
77 float node[3];
78 H3D_ID node_id;
79 unsigned int elem_count = 1;
80
81 cname_len = *size + 1;
82 cname=(char*) malloc(sizeof(char)*cname_len);
83 for(i=0;i<*size;i++) cname[i] = name[i];
84// cname[*size]='\0';
85
86 cname_len1 = *size1 + 1;
87 cname1=(char*) malloc(sizeof(char)*cname_len1);
88 for(i=0;i<*size1;i++) cname1[i] = name1[i];
89 cname1[*size1]='\0';
90
91 cpt_size = 0;
92 for(i=0;i<*size;i++)
93 {
94 if(name[i] != ' ') cpt_size = i;
95 }
96 cname[cpt_size+1]='\0';
97
98 ccomment_len = *s_comment + 1;
99 ccomment=(char*) malloc(sizeof(char)*ccomment_len);
100 for(i=0;i<*s_comment;i++) ccomment[i] = comment[i];
101 ccomment[*s_comment]='\0';
102
103// char * LAYERPOOL = new char [*size1+11];
104 char * LAYERPOOL = new char [100];
105 LAYERPOOL[0] ='\0';
106 char * IPT_STRING = new char [100];
107 IPT_STRING[0] ='\0';
108// char * RES_STRING = new char [100];
109// RES_STRING[0] ='\0';
110
111 H3D_ID layer_pool_id = H3D_NULL_ID;
112
113// RES_STRING = strcat(RES_STRING,cname);
114
115// sprintf(LAYERPOOL, "%s %d" ,cname1,*info1);
116 if( *ipt > 0 )
117 {
118 sprintf(IPT_STRING, "IPT %d" ,*ipt);
119#ifdef _WIN64
120 strcat_s(LAYERPOOL,100,IPT_STRING);
121#else
122 LAYERPOOL = strcat(LAYERPOOL,IPT_STRING);
123#endif
124
125 }
126 else
127 {
128 sprintf(LAYERPOOL, "%s %d" ,cname1,*info1);
129#ifdef _WIN64
130 strcat_s(LAYERPOOL,100,IPT_STRING);
131#else
132 LAYERPOOL = strcat(LAYERPOOL,IPT_STRING);
133#endif
134
135 }
136
137 rc = Hyper3DAddString(h3d_file, LAYERPOOL, &layer_pool_id);
138
139 char edata_type[50];
140//
141
142 //printf( "scalar %d info = %d %s\n", *cpt_data , *info1, name);
143 //fflush(stdout);
144
145 try {
146
147 char TRUSSPOOL[] = "TRUSS";
149 if( !rc ) throw rc;
150
151 char BEAMPOOL[] = "BEAM";
153 if( !rc ) throw rc;
154
155 char SPRINGPOOL[] = "SPRING";
157 if( !rc ) throw rc;
158
159 // create result data types
160 dt_count++;
161
163 if( !rc ) throw rc;
164
165 pool_count = 3;
166
167 dt_id++;
168// strcpy(edata_type, RES_STRING);
169
170 sprintf(edata_type, cname, H3D_DT_DELIMITER);
171 rc = Hyper3DDatatypeWrite(h3d_file, edata_type, *cpt_data , H3D_DS_SCALAR,
172 H3D_DS_ELEM, pool_count);
173 if( !rc ) throw rc;
174
175 if (strlen(ccomment) != 0)
176 {
177 rc = Hyper3DDatatypeDescriptionWrite(h3d_file, *cpt_data, ccomment);
178 if( !rc ) throw rc;
179 }
180
181// if(*info1 != 0 && *cpt_data != 0)
182// {
184 &layer_pool_id, has_corners, tensor_type, poisson);
185 if( !rc ) throw rc;
186
188 &layer_pool_id, has_corners, tensor_type, poisson);
189 if( !rc ) throw rc;
190
192 &layer_pool_id, has_corners, tensor_type, poisson);
193 if( !rc ) throw rc;
194// }
195// else if (*cpt_data != 0)
196// {
197// rc = Hyper3DDatatypePools(h3d_file, *cpt_data , truss_poolname_id, 0,
198// layername_ids, has_corners, tensor_type, poisson);
199// if( !rc ) throw rc;
200//
201// rc = Hyper3DDatatypePools(h3d_file, *cpt_data , beam_poolname_id, 0,
202// layername_ids, has_corners, tensor_type, poisson);
203// if( !rc ) throw rc;
204
205// rc = Hyper3DDatatypePools(h3d_file, *cpt_data , spring_poolname_id, 0,
206// layername_ids, has_corners, tensor_type, poisson);
207// if( !rc ) throw rc;
208// }
209
211 if( !rc ) throw rc;
212
213 } // end of try
214
215 catch(...) {
217 }
218 delete [] LAYERPOOL;
219 delete [] IPT_STRING;
220// delete [] RES_STRING;
221 free(cname);
222 free(cname1);
223 free(ccomment);
224
225}
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_scalar_datatype__()

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

Definition at line 234 of file c_h3d_create_1d_scalar_datatype.cpp.

236{c_h3d_create_1d_scalar_datatype_ (cpt_data, name, size, info1, name1, size1, comment, s_comment, ipt);}