OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_create_nodal_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_nodal_tensor_datatype_ (int *cpt_data, char *name, int *size, int *info1, int *info2, char *name1, int *size1, char *comment, int *s_comment)
void _FCALL C_H3D_CREATE_NODAL_TENSOR_DATATYPE (int *cpt_data, char *name, int *size, int *info1, int *info2, char *name1, int *size1, char *comment, int *s_comment)
void c_h3d_create_nodal_tensor_datatype__ (int *cpt_data, char *name, int *size, int *info1, int *info2, char *name1, int *size1, char *comment, int *s_comment)
void c_create_nodal_tensor_datatype (int *cpt_data, char *name, int *size, int *info1, int *info2, char *name1, int *size1, char *comment, int *s_comment)

Macro Definition Documentation

◆ _FCALL [1/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_nodal_tensor_datatype.cpp.

◆ _FCALL [2/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_nodal_tensor_datatype.cpp.

Function Documentation

◆ c_create_nodal_tensor_datatype()

void c_create_nodal_tensor_datatype ( int * cpt_data,
char * name,
int * size,
int * info1,
int * info2,
char * name1,
int * size1,
char * comment,
int * s_comment )

Definition at line 174 of file c_h3d_create_nodal_tensor_datatype.cpp.

176{c_h3d_create_nodal_tensor_datatype_ (cpt_data, name, size, info1, info2, name1, size1, comment, s_comment);}
void c_h3d_create_nodal_tensor_datatype_(int *cpt_data, char *name, int *size, int *info1, int *info2, char *name1, int *size1, char *comment, int *s_comment)

◆ C_H3D_CREATE_NODAL_TENSOR_DATATYPE()

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

Definition at line 166 of file c_h3d_create_nodal_tensor_datatype.cpp.

168{c_h3d_create_nodal_tensor_datatype_ (cpt_data, name, size, info1, info2, name1, size1, comment, s_comment);}

◆ c_h3d_create_nodal_tensor_datatype_()

void c_h3d_create_nodal_tensor_datatype_ ( int * cpt_data,
char * name,
int * size,
int * info1,
int * info2,
char * name1,
int * size1,
char * comment,
int * s_comment )

Definition at line 71 of file c_h3d_create_nodal_tensor_datatype.cpp.

73{
74 char *cname,*cname1,*ccomment;
75 int cname_len,cname_len1,ccomment_len;
76 int i;
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 if (strncmp(cname,"Grid Point Stress",17)==0) tensor_type = H3D_DS_STRESS;
87 if (strncmp(cname,"Grid Point Strain",17)==0) tensor_type = H3D_DS_STRAIN;
88
89 cname_len1 = *size1 + 1;
90 cname1=(char*) malloc(sizeof(char)*cname_len1);
91 for(i=0;i<*size1;i++) cname1[i] = name1[i];
92 cname1[*size1]='\0';
93
94 ccomment_len = *s_comment + 1;
95 ccomment=(char*) malloc(sizeof(char)*ccomment_len);
96 for(i=0;i<*s_comment;i++) ccomment[i] = comment[i];
97 ccomment[*s_comment]='\0';
98
99 char * LAYERPOOL = new char [*size1+11];
100 H3D_ID layer_pool_id = H3D_NULL_ID;
101 if(*info2 != 0)
102 {
103 sprintf(LAYERPOOL, "%s %d %d" ,cname1,*info1,*info2);
104 rc = Hyper3DAddString(h3d_file, LAYERPOOL, &layer_pool_id);
105 }
106 else
107 {
108 sprintf(LAYERPOOL, "%s %d" ,cname1,*info1);
109 rc = Hyper3DAddString(h3d_file, LAYERPOOL, &layer_pool_id);
110 }
111
112
113 char edata_type[50];
114
115 try {
116 // create result data types
117 dt_count++;
118
120 if( !rc ) throw rc;
121
122 pool_count = 2;
123
124 dt_id++;
125 sprintf(edata_type, cname, H3D_DT_DELIMITER);
126 rc = Hyper3DDatatypeWrite(h3d_file, edata_type, *cpt_data , H3D_DS_TENSOR3D,
127 H3D_DS_NODE, pool_count);
128 if( !rc ) throw rc;
129
130 rc = Hyper3DDatatypeDescriptionWrite(h3d_file, *cpt_data, ccomment);
131 if( !rc ) throw rc;
132
133 if(*info1 != 0 && *cpt_data != 0)
134 {
136 &layer_pool_id, has_corners, tensor_type, poisson);
137 if( !rc ) throw rc;
138
139 }
140 else if (*cpt_data != 0)
141 {
144 if( !rc ) throw rc;
145
146 }
147
149 if( !rc ) throw rc;
150
151 } // end of try
152
153 catch(...) {
155 }
156 delete [] LAYERPOOL;
157 free(cname);
158 free(cname1);
159 free(ccomment);
160
161}
H3DFileInfo * h3d_file
unsigned int pool_count
unsigned int dt_count
bool has_corners
H3D_ID node_poolname_id
bool rc
float poisson
H3D_ID * layername_ids
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_nodal_tensor_datatype__()

void c_h3d_create_nodal_tensor_datatype__ ( int * cpt_data,
char * name,
int * size,
int * info1,
int * info2,
char * name1,
int * size1,
char * comment,
int * s_comment )

Definition at line 170 of file c_h3d_create_nodal_tensor_datatype.cpp.

172{c_h3d_create_nodal_tensor_datatype_ (cpt_data, name, size, info1, info2, name1, size1, comment, s_comment);}