OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_update_solid_tensor.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_solid_tensor_ (my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXS, int *NIXS, int *NUMELS, int *IPARTS, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM, int *NUMELQ, int *NUMELT, int *NUMELP, int *NUMELR, int *IS_WRITTEN, my_real *FUNC_CORNER, int *IS_CORNER_DATA, int *ISOLNOD, int *MAXNOD)
void _FCALL C_H3D_UPDATE_SOLID_TENSOR (my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXS, int *NIXS, int *NUMELS, int *IPARTS, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM, int *NUMELQ, int *NUMELT, int *NUMELP, int *NUMELR, int *IS_WRITTEN, my_real *FUNC_CORNER, int *IS_CORNER_DATA, int *ISOLNOD, int *MAXNOD)
void c_h3d_update_solid_tensor__ (my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXS, int *NIXS, int *NUMELS, int *IPARTS, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM, int *NUMELQ, int *NUMELT, int *NUMELP, int *NUMELR, int *IS_WRITTEN, my_real *FUNC_CORNER, int *IS_CORNER_DATA, int *ISOLNOD, int *MAXNOD)
void c_h3d_update_solid_tensor (my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXS, int *NIXS, int *NUMELS, int *IPARTS, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM, int *NUMELQ, int *NUMELT, int *NUMELP, int *NUMELR, int *IS_WRITTEN, my_real *FUNC_CORNER, int *IS_CORNER_DATA, int *ISOLNOD, int *MAXNOD)

Macro Definition Documentation

◆ _FCALL [1/2]

#define _FCALL

Definition at line 50 of file c_h3d_update_solid_tensor.cpp.

◆ _FCALL [2/2]

#define _FCALL

Definition at line 50 of file c_h3d_update_solid_tensor.cpp.

Function Documentation

◆ C_H3D_UPDATE_SOLID_TENSOR()

void _FCALL C_H3D_UPDATE_SOLID_TENSOR ( my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
int * IXS,
int * NIXS,
int * NUMELS,
int * IPARTS,
my_real * FUNC,
int * ID_ELEM,
int * CPT_DATATYPE,
int * ITY_ELEM,
int * NUMELQ,
int * NUMELT,
int * NUMELP,
int * NUMELR,
int * IS_WRITTEN,
my_real * FUNC_CORNER,
int * IS_CORNER_DATA,
int * ISOLNOD,
int * MAXNOD )

Definition at line 259 of file c_h3d_update_solid_tensor.cpp.

263{c_h3d_update_solid_tensor_ (TT,IH3D,ITAB,NUMNOD,IXS,NIXS,NUMELS,IPARTS,FUNC,ID_ELEM,CPT_DATATYPE,ITY_ELEM,
264 NUMELQ,NUMELT,NUMELP,NUMELR,IS_WRITTEN,FUNC_CORNER,IS_CORNER_DATA,ISOLNOD, MAXNOD);}
void c_h3d_update_solid_tensor_(my_real *TT, int *IH3D, int *ITAB, int *NUMNOD, int *IXS, int *NIXS, int *NUMELS, int *IPARTS, my_real *FUNC, int *ID_ELEM, int *CPT_DATATYPE, int *ITY_ELEM, int *NUMELQ, int *NUMELT, int *NUMELP, int *NUMELR, int *IS_WRITTEN, my_real *FUNC_CORNER, int *IS_CORNER_DATA, int *ISOLNOD, int *MAXNOD)
#define FUNC
Definition clamov.c:8

◆ c_h3d_update_solid_tensor()

void c_h3d_update_solid_tensor ( my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
int * IXS,
int * NIXS,
int * NUMELS,
int * IPARTS,
my_real * FUNC,
int * ID_ELEM,
int * CPT_DATATYPE,
int * ITY_ELEM,
int * NUMELQ,
int * NUMELT,
int * NUMELP,
int * NUMELR,
int * IS_WRITTEN,
my_real * FUNC_CORNER,
int * IS_CORNER_DATA,
int * ISOLNOD,
int * MAXNOD )

Definition at line 273 of file c_h3d_update_solid_tensor.cpp.

277{c_h3d_update_solid_tensor_ (TT,IH3D,ITAB,NUMNOD,IXS,NIXS,NUMELS,IPARTS,FUNC,ID_ELEM,CPT_DATATYPE,ITY_ELEM,
278 NUMELQ,NUMELT,NUMELP,NUMELR,IS_WRITTEN,FUNC_CORNER,IS_CORNER_DATA,ISOLNOD,MAXNOD);}

◆ c_h3d_update_solid_tensor_()

void c_h3d_update_solid_tensor_ ( my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
int * IXS,
int * NIXS,
int * NUMELS,
int * IPARTS,
my_real * FUNC,
int * ID_ELEM,
int * CPT_DATATYPE,
int * ITY_ELEM,
int * NUMELQ,
int * NUMELT,
int * NUMELP,
int * NUMELR,
int * IS_WRITTEN,
my_real * FUNC_CORNER,
int * IS_CORNER_DATA,
int * ISOLNOD,
int * MAXNOD )

Definition at line 79 of file c_h3d_update_solid_tensor.cpp.

83{
84 int i,j,element_nb_nodes;
85 int offset;
86 unsigned int NNOD = *MAXNOD;
87 H3D_ID elem_id;
88 H3D_ID comp_id;
89//
90 // initialize
91
92 try {
93 // create Subcase (Loadcase)
94 unsigned int max_sims = 10;
95 unsigned int sub_count = 1;
96 float elem_result[6] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
97 float* elem_result1 = nullptr;
98 elem_result1 = new float[6 * NNOD];
99
100 for( i = 0; i < 6*NNOD; i++ )
101 {
102 elem_result1[i] = 0.0f;
103 }
104
105 // create Result Data sets
106 unsigned int num_corners = 0;
107 unsigned int num_modes = 0;
108 bool complex = false;
109 float value[1] ;
110
111 sim_idx = *IH3D;
112
113 if(*IS_CORNER_DATA == 1)
114 {
115 if(*NUMELS != 0)
116 {
117 rc = Hyper3DDatasetBegin(h3d_file, *NUMELS, sim_idx, subcase_id, H3D_DS_ELEM,
118 H3D_DS_TENSOR3D, NNOD , num_modes, *CPT_DATATYPE,
120 if( !rc ) throw rc;
121
122 for( i = 0; i < *NUMELS; i++ )
123 {
124 if( ITY_ELEM[i] == 1 && IS_WRITTEN[i] == 1)
125 {
126 elem_id = ID_ELEM[i];
127 element_nb_nodes = ISOLNOD[i];
128// 4 nodes & 10 nodes
129 if( ISOLNOD[i] == 4)
130 {
131 for( j = 0; j < 4; j++ )
132 {
133 elem_result1[j*6] = FUNC_CORNER[6*(NNOD*(i)+j)];
134 elem_result1[j*6+1] = FUNC_CORNER[6*(NNOD*(i)+j)+1];
135 elem_result1[j*6+2] = FUNC_CORNER[6*(NNOD*(i)+j)+2];
136 elem_result1[j*6+3] = FUNC_CORNER[6*(NNOD*(i)+j)+3];
137 elem_result1[j*6+4] = FUNC_CORNER[6*(NNOD*(i)+j)+4];
138 elem_result1[j*6+5] = FUNC_CORNER[6*(NNOD*(i)+j)+5];
139 }
140 }
141// 6 nodes
142 if( ISOLNOD[i] == 6)
143 {
144 for( j = 0; j < 6; j++ )
145 {
146 elem_result1[j*6] = FUNC_CORNER[6*(NNOD*(i)+j)];
147 elem_result1[j*6+1] = FUNC_CORNER[6*(NNOD*(i)+j)+1];
148 elem_result1[j*6+2] = FUNC_CORNER[6*(NNOD*(i)+j)+2];
149 elem_result1[j*6+3] = FUNC_CORNER[6*(NNOD*(i)+j)+3];
150 elem_result1[j*6+4] = FUNC_CORNER[6*(NNOD*(i)+j)+4];
151 elem_result1[j*6+5] = FUNC_CORNER[6*(NNOD*(i)+j)+5];
152 }
153 }
154// 8 nodes
155 if( ISOLNOD[i] == 8)
156 {
157 for( j = 0; j < 8; j++ )
158 {
159 elem_result1[j*6] = FUNC_CORNER[6*(NNOD*(i)+j)];
160 elem_result1[j*6+1] = FUNC_CORNER[6*(NNOD*(i)+j)+1];
161 elem_result1[j*6+2] = FUNC_CORNER[6*(NNOD*(i)+j)+2];
162 elem_result1[j*6+3] = FUNC_CORNER[6*(NNOD*(i)+j)+3];
163 elem_result1[j*6+4] = FUNC_CORNER[6*(NNOD*(i)+j)+4];
164 elem_result1[j*6+5] = FUNC_CORNER[6*(NNOD*(i)+j)+5];
165 }
166 }
167
168// 10 nodes
169 if( ISOLNOD[i] == 10)
170 {
171 for( j = 0; j < 10; j++ )
172 {
173 elem_result1[j*6] = FUNC_CORNER[6*(NNOD*(i)+j)];
174 elem_result1[j*6+1] = FUNC_CORNER[6*(NNOD*(i)+j)+1];
175 elem_result1[j*6+2] = FUNC_CORNER[6*(NNOD*(i)+j)+2];
176 elem_result1[j*6+3] = FUNC_CORNER[6*(NNOD*(i)+j)+3];
177 elem_result1[j*6+4] = FUNC_CORNER[6*(NNOD*(i)+j)+4];
178 elem_result1[j*6+5] = FUNC_CORNER[6*(NNOD*(i)+j)+5];
179 }
180 }
181// 16 nodes : not available for the moment
182/*
183 if( ISOLNOD[i] == 16)
184 {
185 for( j = 0; j < 16; j++ )
186 {
187 elem_result1[j*6] = FUNC_CORNER[6*(20*(i)+j)];
188 elem_result1[j*6+1] = FUNC_CORNER[6*(20*(i)+j)+1];
189 elem_result1[j*6+2] = FUNC_CORNER[6*(20*(i)+j)+2];
190 elem_result1[j*6+3] = FUNC_CORNER[6*(20*(i)+j)+3];
191 elem_result1[j*6+4] = FUNC_CORNER[6*(20*(i)+j)+4];
192 elem_result1[j*6+5] = FUNC_CORNER[6*(20*(i)+j)+5];
193 }
194
195 }
196*/
197// 20 nodes
198/*
199
200 if( ISOLNOD[i] == 20)
201 {
202 for( j = 0; j < 20; j++ )
203 {
204 elem_result1[j*6] = FUNC_CORNER[6*(20*(i)+j)];
205 elem_result1[j*6+1] = FUNC_CORNER[6*(20*(i)+j)+1];
206 elem_result1[j*6+2] = FUNC_CORNER[6*(20*(i)+j)+2];
207 elem_result1[j*6+3] = FUNC_CORNER[6*(20*(i)+j)+3];
208 elem_result1[j*6+4] = FUNC_CORNER[6*(20*(i)+j)+4];
209 elem_result1[j*6+5] = FUNC_CORNER[6*(20*(i)+j)+5];
210 }
211 }
212*/
213 rc = Hyper3DDatasetWrite(h3d_file, elem_id, &elem_result1[0]);
214 }
215 }
217 if( !rc ) throw rc;
218 }
219 }
220
221 if(*NUMELS != 0)
222 {
223 rc = Hyper3DDatasetBegin(h3d_file, *NUMELS, sim_idx, subcase_id, H3D_DS_ELEM,
224 H3D_DS_TENSOR3D, num_corners, num_modes, *CPT_DATATYPE,
226 if( !rc ) throw rc;
227
228 for( i = 0; i < *NUMELS; i++ )
229 {
230 if( ITY_ELEM[i] == 1 && IS_WRITTEN[i] == 1)
231 {
232 elem_id = ID_ELEM[i];
233 elem_result[0] = FUNC[6*i];
234 elem_result[1] = FUNC[6*i+1];
235 elem_result[2] = FUNC[6*i+2];
236 elem_result[3] = FUNC[6*i+3];
237 elem_result[4] = FUNC[6*i+4];
238 elem_result[5] = FUNC[6*i+5];
239 rc = Hyper3DDatasetWrite(h3d_file, elem_id, &elem_result[0]);
240 IS_WRITTEN[i] = 0;
241 }
242 }
244 if( !rc ) throw rc;
245 }
246
247 // When done, deallocate the memory
248 delete[] elem_result1;
249 elem_result1 = nullptr; // Optional: set pointer to nullptr after deletion
250
251 } // end of try
252
253 catch(...) {
255 }
256
257}
H3DFileInfo * h3d_file
bool rc
H3D_ID comp_id
H3D_ID solid_poolname_id
H3D_SIM_IDX sim_idx
H3D_ID subcase_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 Hyper3DExportClearError(H3DFileInfo *h3d_file)
Definition h3d_dl.c:939
bool Hyper3DDatasetEnd(H3DFileInfo *h3d_file)
Definition h3d_dl.c:1400
bool Hyper3DDatasetWrite(H3DFileInfo *h3d_file, H3D_ID id, const float *data)
Definition h3d_dl.c:1372
integer, dimension(:), allocatable offset
Definition rad2r.F:53

◆ c_h3d_update_solid_tensor__()

void c_h3d_update_solid_tensor__ ( my_real * TT,
int * IH3D,
int * ITAB,
int * NUMNOD,
int * IXS,
int * NIXS,
int * NUMELS,
int * IPARTS,
my_real * FUNC,
int * ID_ELEM,
int * CPT_DATATYPE,
int * ITY_ELEM,
int * NUMELQ,
int * NUMELT,
int * NUMELP,
int * NUMELR,
int * IS_WRITTEN,
my_real * FUNC_CORNER,
int * IS_CORNER_DATA,
int * ISOLNOD,
int * MAXNOD )

Definition at line 266 of file c_h3d_update_solid_tensor.cpp.

270{c_h3d_update_solid_tensor_ (TT,IH3D,ITAB,NUMNOD,IXS,NIXS,NUMELS,IPARTS,FUNC,ID_ELEM,CPT_DATATYPE,ITY_ELEM,
271 NUMELQ,NUMELT,NUMELP,NUMELR,IS_WRITTEN,FUNC_CORNER,IS_CORNER_DATA,ISOLNOD,MAXNOD);}