OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_update_fvmbag_nodes.cpp
Go to the documentation of this file.
1//Copyright> OpenRadioss
2//Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3//Copyright>
4//Copyright> This program is free software: you can redistribute it and/or modify
5//Copyright> it under the terms of the GNU Affero General Public License as published by
6//Copyright> the Free Software Foundation, either version 3 of the License, or
7//Copyright> (at your option) any later version.
8//Copyright>
9//Copyright> This program is distributed in the hope that it will be useful,
10//Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11//Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12//Copyright> GNU Affero General Public License for more details.
13//Copyright>
14//Copyright> You should have received a copy of the GNU Affero General Public License
15//Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16//Copyright>
17//Copyright>
18//Copyright> Commercial Alternative: Altair Radioss Software
19//Copyright>
20//Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21//Copyright> software under a commercial license. Contact Altair to discuss further if the
22//Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23//
24#include <stdio.h>
25#include <string.h>
26#include <stdlib.h>
27#include <math.h>
28#include <fcntl.h>
29
30
31
32#ifdef _WIN32
33/* Windows includes */
34#include <windows.h>
35#include <process.h>
36#include <io.h>
37#include <sys\types.h>
38#include <sys/stat.h>
39
40
41#elif 1
42
43/* Linux includes */
44#include <sys/resource.h>
45#include <sys/types.h>
46#include <time.h>
47#include <sys/stat.h>
48#include <unistd.h>
49#include <dlfcn.h>
50#define _FCALL
51#include <math.h>
52#include <stdbool.h>
53
54#endif
55
56#include "h3dpublic_defs.h"
57#include "h3dpublic_export.h"
58
59#define _FCALL
60
61#include "h3d_values.h"
62
63#ifdef MYREAL4
64#define my_real float
65#endif
66
67#ifdef MYREAL8
68#define my_real double
69#endif
70
71extern "C"
72/*=================================================================*/
73{
74
75
76/*=================================================================*/
77/* C_H3D_UPDATE_FVMBAG_NODES */
78/*=================================================================*/
79
80void c_h3d_update_fvmbag_nodes_(char *name, int *size, int *IH3D, int *ITAB, int *NUMNOD, my_real *D)
81{
82 int i;
83 float node[3];
84 H3D_ID node_id;
85
86 // initialize
87
88 try {
89 // create Subcase (Loadcase)
90 unsigned int max_sims = 10;
91 unsigned int sub_count = 1;
92
93 // create Result Data sets
94 unsigned int num_corners = 0;
95 unsigned int num_modes = 0;
96 bool complex = false;
97
98 H3D_ID dt_id = 2; // the displacement data type
99 sim_idx = *IH3D;
100 if( *NUMNOD != 0)
101 {
102 rc = Hyper3DDatasetBegin(h3d_file, *NUMNOD , sim_idx, subcase_id, H3D_DS_NODE,
103 H3D_DS_VECTOR, num_corners, num_modes, dt_id,
104 H3D_DS_NO_LAYER, node_poolname_id, complex);
105 if( !rc ) throw rc;
106
107 for( i = 0; i < *NUMNOD; i++ ) {
108 node[0] = D[3*i ];
109 node[1] = D[3*i + 1];
110 node[2] = D[3*i + 2];
111 node_id = ITAB[i];
112 if (node_id != 0 ) rc = Hyper3DDatasetWrite(h3d_file, node_id, node);
113 if( !rc ) throw rc;
114 }
115
117 if( !rc ) throw rc;
118
119 }
120
121 } // end of try
122
123 catch(...) {
125 }
126}
127
128void _FCALL C_H3D_UPDATE_FVMBAG_NODES(char *name, int *size, int *IH3D, int *ITAB, int *NUMNOD, my_real *D)
129{c_h3d_update_fvmbag_nodes_ (name,size,IH3D,ITAB,NUMNOD,D);}
130
131void c_h3d_update_fvmbag_nodes__ (char *name, int *size, int *IH3D, int *ITAB, int *NUMNOD, my_real *D)
132{c_h3d_update_fvmbag_nodes_ (name,size,IH3D,ITAB,NUMNOD,D);}
133
134void c_h3d_update_fvmbag_nodes (char *name, int *size, int *IH3D, int *ITAB, int *NUMNOD, my_real *D )
135{c_h3d_update_fvmbag_nodes_ (name,size,IH3D,ITAB,NUMNOD,D);}
136
137}
H3DFileInfo * h3d_file
H3D_ID node_poolname_id
bool rc
H3D_SIM_IDX sim_idx
H3D_ID subcase_id
H3D_ID dt_id
void c_h3d_update_fvmbag_nodes_(char *name, int *size, int *IH3D, int *ITAB, int *NUMNOD, my_real *D)
void c_h3d_update_fvmbag_nodes__(char *name, int *size, int *IH3D, int *ITAB, int *NUMNOD, my_real *D)
void _FCALL C_H3D_UPDATE_FVMBAG_NODES(char *name, int *size, int *IH3D, int *ITAB, int *NUMNOD, my_real *D)
void c_h3d_update_fvmbag_nodes(char *name, int *size, int *IH3D, int *ITAB, int *NUMNOD, my_real *D)
#define my_real
Definition cppsort.cpp:32
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
#define _FCALL