OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_create_quad_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_quad_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_QUAD_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_quad_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_quad_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_quad_tensor_datatype.cpp.

◆ _FCALL [2/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_quad_tensor_datatype.cpp.

Function Documentation

◆ c_create_quad_tensor_datatype()

void c_create_quad_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 204 of file c_h3d_create_quad_tensor_datatype.cpp.

207{c_h3d_create_quad_tensor_datatype_ (cpt_data, name1, size1, info, name2, size2, layer, nuvar, ir, is, it, comment, s_comment);}
void c_h3d_create_quad_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_QUAD_TENSOR_DATATYPE()

void _FCALL C_H3D_CREATE_QUAD_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 194 of file c_h3d_create_quad_tensor_datatype.cpp.

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

◆ c_h3d_create_quad_tensor_datatype_()

void c_h3d_create_quad_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_quad_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 if( strncmp(cname,"Strain",6) == 0 ) tensor_type = H3D_DS_STRAIN;
99 if( strncmp(cname,"Strn rate",9) == 0 ) tensor_type = H3D_DS_STRAIN;
100
101 char * LAYERPOOL = new char [100];
102 LAYERPOOL[0] ='\0';
103 char * LAYER_STRING = new char [100];
104 LAYER_STRING[0] ='\0';
105 char * NUVAR_STRING = new char [100];
106 NUVAR_STRING[0] ='\0';
107 char * IR_STRING = new char [100];
108 IR_STRING[0] ='\0';
109 char * IS_STRING = new char [100];
110 IS_STRING[0] ='\0';
111 char * IT_STRING = new char [100];
112 IT_STRING[0] ='\0';
113 char * MID_STRING = new char [100];
114 MID_STRING[0] ='\0';
115
116 H3D_ID layer_pool_id = H3D_NULL_ID;
117 if(*layer > 0 || *nuvar > 0 || *ir > 0 || *is > 0 || *it > 0 )
118 {
119 if(*ir > 0 && *is > 0)
120 {
121 sprintf(LAYER_STRING, "IR IS %d %d" ,*ir,*is);
122#ifdef _WIN64
123 strcat_s(LAYERPOOL,100,LAYER_STRING);
124#else
125 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
126#endif
127
128 }
129 }
130 else
131 {
132 sprintf(LAYER_STRING, "Mid" );
133#ifdef _WIN64
134 strcat_s(LAYERPOOL,100,LAYER_STRING);
135#else
136 LAYERPOOL = strcat(LAYERPOOL,LAYER_STRING);
137#endif
138
139 }
140
141 char edata_type[50];
142
143 try {
144 // create result data types
145 dt_count++;
146
147 rc = Hyper3DAddString(h3d_file, LAYERPOOL, &layer_pool_id);
148 if( !rc ) throw rc;
149
151 if( !rc ) throw rc;
152
153 pool_count = 2;
154
155 dt_id++;
156 sprintf(edata_type, cname, H3D_DT_DELIMITER);
157
158 rc = Hyper3DDatatypeWrite(h3d_file, edata_type, *cpt_data , H3D_DS_TENSOR3D,
159 H3D_DS_ELEM, pool_count);
160 if( !rc ) throw rc;
161
162 if (strlen(ccomment) != 0)
163 {
164 rc = Hyper3DDatatypeDescriptionWrite(h3d_file, *cpt_data, ccomment);
165 if( !rc ) throw rc;
166 }
167
169 &layer_pool_id, has_corners, tensor_type, poisson);
170 if( !rc ) throw rc;
171
173 if( !rc ) throw rc;
174
175 } // end of try
176
177 catch(...) {
179 }
180 delete [] LAYERPOOL;
181 delete [] LAYER_STRING;
182 delete [] NUVAR_STRING;
183 delete [] IR_STRING;
184 delete [] IS_STRING;
185 delete [] IT_STRING;
186 delete [] MID_STRING;
187 free(cname);
188 free(ccomment);
189
190}
H3DFileInfo * h3d_file
unsigned int pool_count
unsigned int dt_count
bool has_corners
bool rc
float poisson
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 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_quad_tensor_datatype__()

void c_h3d_create_quad_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 199 of file c_h3d_create_quad_tensor_datatype.cpp.

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