OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_update_nodes.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_update_nodes_ (char *name, int *size, my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, my_real *D, int *NRWALL, int *MAX_NOD_ID, my_real *XWL, my_real *YWL, my_real *ZWL, my_real *V1, my_real *V2, my_real *V3, my_real *VV1, my_real *VV2, my_real *VV3, int *KXSP, int *NISP, int *NUMSPH, int *TAGNOD, int *NPRW)
void _FCALL C_H3D_UPDATE_NODES (char *name, int *size, my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, my_real *D, int *NRWALL, int *MAX_NOD_ID, my_real *XWL, my_real *YWL, my_real *ZWL, my_real *V1, my_real *V2, my_real *V3, my_real *VV1, my_real *VV2, my_real *VV3, int *KXSP, int *NISP, int *NUMSPH, int *TAGNOD, int *NPRW)
void c_h3d_update_nodes__ (char *name, int *size, my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, my_real *D, int *NRWALL, int *MAX_NOD_ID, my_real *XWL, my_real *YWL, my_real *ZWL, my_real *V1, my_real *V2, my_real *V3, my_real *VV1, my_real *VV2, my_real *VV3, int *KXSP, int *NISP, int *NUMSPH, int *TAGNOD, int *NPRW)
void c_h3d_update_h3dfile_nodes (char *name, int *size, my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, my_real *D, int *NRWALL, int *MAX_NOD_ID, my_real *XWL, my_real *YWL, my_real *ZWL, my_real *V1, my_real *V2, my_real *V3, my_real *VV1, my_real *VV2, my_real *VV3, int *KXSP, int *NISP, int *NUMSPH, int *TAGNOD, int *NPRW)

Macro Definition Documentation

◆ _FCALL [1/2]

#define _FCALL

Definition at line 50 of file c_h3d_update_nodes.cpp.

◆ _FCALL [2/2]

#define _FCALL

Definition at line 50 of file c_h3d_update_nodes.cpp.

Function Documentation

◆ c_h3d_update_h3dfile_nodes()

void c_h3d_update_h3dfile_nodes ( char * name,
int * size,
my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
my_real * D,
int * NRWALL,
int * MAX_NOD_ID,
my_real * XWL,
my_real * YWL,
my_real * ZWL,
my_real * V1,
my_real * V2,
my_real * V3,
my_real * VV1,
my_real * VV2,
my_real * VV3,
int * KXSP,
int * NISP,
int * NUMSPH,
int * TAGNOD,
int * NPRW )

Definition at line 261 of file c_h3d_update_nodes.cpp.

264{c_h3d_update_nodes_ (name,size,TT,IH3D,ITAB,NUMNOD,D, NRWALL, MAX_NOD_ID,
265 XWL, YWL, ZWL, V1, V2, V3, VV1, VV2 , VV3, KXSP, NISP, NUMSPH, TAGNOD, NPRW);}
void c_h3d_update_nodes_(char *name, int *size, my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, my_real *D, int *NRWALL, int *MAX_NOD_ID, my_real *XWL, my_real *YWL, my_real *ZWL, my_real *V1, my_real *V2, my_real *V3, my_real *VV1, my_real *VV2, my_real *VV3, int *KXSP, int *NISP, int *NUMSPH, int *TAGNOD, int *NPRW)

◆ C_H3D_UPDATE_NODES()

void _FCALL C_H3D_UPDATE_NODES ( char * name,
int * size,
my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
my_real * D,
int * NRWALL,
int * MAX_NOD_ID,
my_real * XWL,
my_real * YWL,
my_real * ZWL,
my_real * V1,
my_real * V2,
my_real * V3,
my_real * VV1,
my_real * VV2,
my_real * VV3,
int * KXSP,
int * NISP,
int * NUMSPH,
int * TAGNOD,
int * NPRW )

Definition at line 249 of file c_h3d_update_nodes.cpp.

252{c_h3d_update_nodes_ (name,size,TT,IH3D,ITAB,NUMNOD,D, NRWALL, MAX_NOD_ID,
253 XWL, YWL, ZWL, V1, V2, V3, VV1, VV2 , VV3, KXSP, NISP, NUMSPH, TAGNOD, NPRW);}

◆ c_h3d_update_nodes_()

void c_h3d_update_nodes_ ( char * name,
int * size,
my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
my_real * D,
int * NRWALL,
int * MAX_NOD_ID,
my_real * XWL,
my_real * YWL,
my_real * ZWL,
my_real * V1,
my_real * V2,
my_real * V3,
my_real * VV1,
my_real * VV2,
my_real * VV3,
int * KXSP,
int * NISP,
int * NUMSPH,
int * TAGNOD,
int * NPRW )

Definition at line 80 of file c_h3d_update_nodes.cpp.

83{
84 char *cname;
85 int cname_len;
86 int i;
87 float time = (float) *TT;
88 float node[3];
89 H3D_ID node_id;
90 unsigned int elem_count = 1;
91//
92 cname_len = *size + 1;
93 cname=(char*) malloc(sizeof(char)*cname_len);
94 for(i=0;i<*size;i++) cname[i] = name[i];
95 cname[*size]='\0';
96//
97 // initialize
98
99 try {
100 // create Subcase (Loadcase)
101 unsigned int max_sims = 10;
102 unsigned int sub_count = 1;
103
104 // create Simulations
105 H3D_SIM_IDX sim_idx;
107 if( !rc ) throw rc;
108 sim_idx=*IH3D;
109 char name[32];
110 sprintf(name,"Time = %f",time);
111
112 if(*size != 0) rc = Hyper3DSimulationWrite(h3d_file, sim_idx, cname,time);
113 if(*size == 0) rc = Hyper3DSimulationWrite(h3d_file, sim_idx, name,time);
114 if( !rc ) throw rc;
115
117 if( !rc ) throw rc;
118
119 // create Result Data sets
120 unsigned int num_corners = 0;
121 unsigned int num_modes = 0;
122 bool complex = false;
123
124 H3D_ID dt_id = 2; // the displacement data type
125 sim_idx = *IH3D;
126 if( *NUMNOD != 0)
127 {
128 rc = Hyper3DDatasetBegin(h3d_file, *NUMNOD , sim_idx, subcase_id, H3D_DS_NODE,
129 H3D_DS_VECTOR, num_corners, num_modes, dt_id,
130 H3D_DS_NO_LAYER, node_poolname_id, complex);
131 if( !rc ) throw rc;
132
133 for( i = 0; i < *NUMNOD; i++ ) {
134 if( TAGNOD[i] == 1 )
135 {
136 node[0] = D[3*i ];
137 node[1] = D[3*i + 1];
138 node[2] = D[3*i + 2];
139 node_id = ITAB[i];
140 if (node_id != 0 ) rc = Hyper3DDatasetWrite(h3d_file, node_id, node);
141 if( !rc ) throw rc;
142 }
143 }
144
146 if( !rc ) throw rc;
147
148 node_id = *MAX_NOD_ID;
149
150 for(i = 0 ; i< *NRWALL; i++ )
151 {
152 int ityp = NPRW[i + *NRWALL*3];
153
154 if( ityp == 1 || ityp == 4)
155 {
156
157 rc = Hyper3DDatasetBegin(h3d_file, 4 , sim_idx, subcase_id, H3D_DS_NODE,
158 H3D_DS_VECTOR, num_corners, num_modes, dt_id,
159 H3D_DS_NO_LAYER, node_poolname_id, complex);
160
161 node[0] = XWL[i] + V1[i];
162 node[1] = YWL[i] + V2[i];
163 node[2] = ZWL[i] + V3[i];
164 node_id = node_id + 1 ;
165
166 rc = Hyper3DDatasetWrite(h3d_file, node_id, node);
167 if( !rc ) throw rc;
168
169
170 node[0] = XWL[i] + VV1[i];
171 node[1] = YWL[i] + VV2[i];
172 node[2] = ZWL[i] + VV3[i];
173 node_id = node_id + 1 ;
174
175 rc = Hyper3DDatasetWrite(h3d_file, node_id, node);
176 if( !rc ) throw rc;
177
178 node[0] = XWL[i] - V1[i];
179 node[1] = YWL[i] - V2[i];
180 node[2] = ZWL[i] - V3[i];
181 node_id = node_id + 1 ;
182
183 rc = Hyper3DDatasetWrite(h3d_file, node_id, node);
184 if( !rc ) throw rc;
185
186 node[0] = XWL[i] - VV1[i];
187 node[1] = YWL[i] - VV2[i];
188 node[2] = ZWL[i] - VV3[i];
189 node_id = node_id + 1 ;
190
191 rc = Hyper3DDatasetWrite(h3d_file, node_id, node);
192 if( !rc ) throw rc;
193
195 if( !rc ) throw rc;
196 }
197 else if(ityp == 2)
198 {
199 rc = Hyper3DDatasetBegin(h3d_file, 48 , sim_idx, subcase_id, H3D_DS_NODE,
200 H3D_DS_VECTOR, num_corners, num_modes, dt_id,
201 H3D_DS_NO_LAYER, node_poolname_id, complex);
202 for(int ii=0;ii<48;ii++)
203 {
204 node[0] = XWL[i] + V1[i];
205 node[1] = YWL[i] + V2[i];
206 node[2] = ZWL[i] + V3[i];
207 node_id = node_id + 1 ;
208
209 rc = Hyper3DDatasetWrite(h3d_file, node_id, node);
210 if( !rc ) throw rc;
211 }
212
214 if( !rc ) throw rc;
215
216 }
217
218 else if(ityp == 3)
219 {
220 rc = Hyper3DDatasetBegin(h3d_file, 294 , sim_idx, subcase_id, H3D_DS_NODE,
221 H3D_DS_VECTOR, num_corners, num_modes, dt_id,
222 H3D_DS_NO_LAYER, node_poolname_id, complex);
223 for(int ii=0;ii<294;ii++)
224 {
225 node[0] = XWL[i] + V1[i];
226 node[1] = YWL[i] + V2[i];
227 node[2] = ZWL[i] + V3[i];
228 node_id = node_id + 1 ;
229
230 rc = Hyper3DDatasetWrite(h3d_file, node_id, node);
231 if( !rc ) throw rc;
232 }
233
235 if( !rc ) throw rc;
236
237 }
238
239 }
240 }
241
242 } // end of try
243
244 catch(...) {
246 }
247}
H3DFileInfo * h3d_file
H3D_ID node_poolname_id
bool rc
H3D_SIM_IDX sim_idx
H3D_ID subcase_id
H3D_ID dt_id
bool Hyper3DDatasetBegin(H3DFileInfo *h3d_file, unsigned int count, H3D_SIM_IDX idx, H3D_ID subcase_id, H3D_DS_TYPE type, H3D_DS_FORMAT format, unsigned int num_corners, unsigned int num_modes, H3D_ID dt_id, int layer_idx, H3D_ID data_poolname_id, bool complex)
Definition h3d_dl.c:1352
bool Hyper3DSimulationWrite(H3DFileInfo *h3d_file, H3D_SIM_IDX idx, const char *label, float syncValue)
Definition h3d_dl.c:1292
bool Hyper3DExportClearError(H3DFileInfo *h3d_file)
Definition h3d_dl.c:939
bool Hyper3DDatasetEnd(H3DFileInfo *h3d_file)
Definition h3d_dl.c:1400
bool Hyper3DSimulationEnd(H3DFileInfo *h3d_file)
Definition h3d_dl.c:1299
bool Hyper3DSimulationBegin(H3DFileInfo *h3d_file, unsigned int count, H3D_ID subcase_id)
Definition h3d_dl.c:1285
bool Hyper3DDatasetWrite(H3DFileInfo *h3d_file, H3D_ID id, const float *data)
Definition h3d_dl.c:1372

◆ c_h3d_update_nodes__()

void c_h3d_update_nodes__ ( char * name,
int * size,
my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
my_real * D,
int * NRWALL,
int * MAX_NOD_ID,
my_real * XWL,
my_real * YWL,
my_real * ZWL,
my_real * V1,
my_real * V2,
my_real * V3,
my_real * VV1,
my_real * VV2,
my_real * VV3,
int * KXSP,
int * NISP,
int * NUMSPH,
int * TAGNOD,
int * NPRW )

Definition at line 255 of file c_h3d_update_nodes.cpp.

258{c_h3d_update_nodes_ (name,size,TT,IH3D,ITAB,NUMNOD,D, NRWALL, MAX_NOD_ID,
259 XWL, YWL, ZWL, V1, V2, V3, VV1, VV2 , VV3, KXSP, NISP, NUMSPH, TAGNOD, NPRW);}