OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_create_quad_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_quad_scalar_datatype_ (int *cpt_data, char *name1, int *size1, int *info, char *name2, int *size2, int *nuvar, char *comment, int *s_comment, int *id, int *mode)
void _FCALL C_H3D_CREATE_QUAD_SCALAR_DATATYPE (int *cpt_data, char *name1, int *size1, int *info, char *name2, int *size2, int *nuvar, char *comment, int *s_comment, int *id, int *mode)
void c_h3d_create_quad_scalar_datatype__ (int *cpt_data, char *name1, int *size1, int *info, char *name2, int *size2, int *nuvar, char *comment, int *s_comment, int *id, int *mode)
void c_create_quad_scalar_datatype (int *cpt_data, char *name1, int *size1, int *info, char *name2, int *size2, int *nuvar, char *comment, int *s_comment, int *id, int *mode)

Macro Definition Documentation

◆ _FCALL [1/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_quad_scalar_datatype.cpp.

◆ _FCALL [2/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_quad_scalar_datatype.cpp.

Function Documentation

◆ c_create_quad_scalar_datatype()

void c_create_quad_scalar_datatype ( int * cpt_data,
char * name1,
int * size1,
int * info,
char * name2,
int * size2,
int * nuvar,
char * comment,
int * s_comment,
int * id,
int * mode )

Definition at line 210 of file c_h3d_create_quad_scalar_datatype.cpp.

212{c_h3d_create_quad_scalar_datatype_ (cpt_data, name1, size1, info, name2, size2, nuvar, comment, s_comment, id, mode);}
void c_h3d_create_quad_scalar_datatype_(int *cpt_data, char *name1, int *size1, int *info, char *name2, int *size2, int *nuvar, char *comment, int *s_comment, int *id, int *mode)

◆ C_H3D_CREATE_QUAD_SCALAR_DATATYPE()

void _FCALL C_H3D_CREATE_QUAD_SCALAR_DATATYPE ( int * cpt_data,
char * name1,
int * size1,
int * info,
char * name2,
int * size2,
int * nuvar,
char * comment,
int * s_comment,
int * id,
int * mode )

Definition at line 202 of file c_h3d_create_quad_scalar_datatype.cpp.

204{c_h3d_create_quad_scalar_datatype_ (cpt_data, name1, size1, info, name2, size2, nuvar, comment, s_comment, id, mode);}

◆ c_h3d_create_quad_scalar_datatype_()

void c_h3d_create_quad_scalar_datatype_ ( int * cpt_data,
char * name1,
int * size1,
int * info,
char * name2,
int * size2,
int * nuvar,
char * comment,
int * s_comment,
int * id,
int * mode )

Definition at line 71 of file c_h3d_create_quad_scalar_datatype.cpp.

73{
74 char *cname,*cname2,*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 = *size1 + 1;
82 cname=(char*) malloc(sizeof(char)*cname_len);
83 for(i=0;i<*size1;i++) cname[i] = name1[i];
84
85 cpt_size = 0;
86 for(i=0;i<*size1;i++)
87 {
88 if(name1[i] != ' ') cpt_size = i;
89 }
90 cname[cpt_size+1]='\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 * LAYER_STRING = new char [100];
100 LAYER_STRING[0] ='\0';
101 char * NUVAR_STRING = new char [100];
102 NUVAR_STRING[0] ='\0';
103 char * IR_STRING = new char [100];
104 IR_STRING[0] ='\0';
105 char * IS_STRING = new char [100];
106 IS_STRING[0] ='\0';
107 char * IT_STRING = new char [100];
108 IT_STRING[0] ='\0';
109 char * MID_STRING = new char [100];
110 MID_STRING[0] ='\0';
111 char * RES_STRING = new char [100];
112 RES_STRING[0] ='\0';
113 char * ID_STRING = new char [100];
114 ID_STRING[0] ='\0';
115 char *MODE_STRING = new char[100];
116 ID_STRING[0] = '\0';
117
118 H3D_ID layer_pool_id = H3D_NULL_ID;
119
120
121#ifdef _WIN64
122 strcat_s(RES_STRING,100,cname);
123#else
124 RES_STRING = strcat(RES_STRING,cname);
125#endif
126
127
128 if(*nuvar > 0)
129 {
130 sprintf(NUVAR_STRING, " %d",*nuvar);
131#ifdef _WIN64
132 strcat_s(RES_STRING,100,NUVAR_STRING);
133#else
134 RES_STRING = strcat(RES_STRING,NUVAR_STRING);
135#endif
136 }
137
138
139 char edata_type[100];
140//
141
142 //printf( "scalar %d info = %d %s\n", *cpt_data , *info1, name);
143 //fflush(stdout);
144
145 try {
146 // create result data types
147 dt_count++;
148
150 if( !rc ) throw rc;
151
152 pool_count = 2;
153
154 dt_id++;
155 sprintf(edata_type, RES_STRING, H3D_DT_DELIMITER);
156
157 rc = Hyper3DDatatypeWrite(h3d_file, edata_type, *cpt_data , H3D_DS_SCALAR,
158 H3D_DS_ELEM, pool_count);
159 if( !rc ) throw rc;
160
161 if (strlen(ccomment) != 0)
162 {
163 rc = Hyper3DDatatypeDescriptionWrite(h3d_file, *cpt_data, ccomment);
164 if( !rc ) throw rc;
165 }
166
169 if( !rc ) throw rc;
170
173 if( !rc ) throw rc;
174
176 if( !rc ) throw rc;
177
178 } // end of try
179
180 catch(...) {
182 }
183 delete [] LAYERPOOL;
184 delete [] LAYER_STRING;
185 delete [] NUVAR_STRING;
186 delete [] IR_STRING;
187 delete [] IS_STRING;
188 delete [] IT_STRING;
189 delete [] MID_STRING;
190 delete [] RES_STRING;
191 delete [] MODE_STRING;
192
193
194
195 free(cname);
196 free(ccomment);
197
198}
H3DFileInfo * h3d_file
unsigned int pool_count
unsigned int dt_count
bool has_corners
bool rc
float poisson
H3D_ID * layername_ids
H3D_ID dt_id
H3D_ID quad_poolname_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 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_quad_scalar_datatype__()

void c_h3d_create_quad_scalar_datatype__ ( int * cpt_data,
char * name1,
int * size1,
int * info,
char * name2,
int * size2,
int * nuvar,
char * comment,
int * s_comment,
int * id,
int * mode )

Definition at line 206 of file c_h3d_create_quad_scalar_datatype.cpp.

208{c_h3d_create_quad_scalar_datatype_ (cpt_data, name1, size1, info, name2, size2, nuvar, comment, s_comment, id, mode);}