OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_create_results_end.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
63extern "C"
64/*=================================================================*/
65{
66/*=================================================================*/
67/* C_H3D_CREATE_RESULTS_END */
68/*=================================================================*/
69
71{
72
73 unsigned int * datatype_ids = new unsigned int [dt_count];
74 try {
75
76 // create Result defaults
77 unsigned int res_count = 1;
78 unsigned int asys_count = 1;
79
80 rc = Hyper3DResultBegin(h3d_file, res_count);
81 if( !rc ) throw rc;
82 rc = Hyper3DResultWrite(h3d_file, "Result", H3D_SM_MIDPOINT, asys_count);
83
84 if( !rc ) throw rc;
86 H3D_DS_ANALYSIS, H3D_POOL_ELEMENT);
87
88 if( !rc ) throw rc;
90 H3D_DS_GLOBAL, H3D_POOL_ELEMENT);
91
92 if( !rc ) throw rc;
94 H3D_DS_GLOBAL, H3D_POOL_ELEMENT);
95
96 if( !rc ) throw rc;
98 H3D_DS_GLOBAL, H3D_POOL_ELEMENT);
99
100 if( !rc ) throw rc;
102 H3D_DS_ANALYSIS, H3D_POOL_ELEMENT);
103
104 if( !rc ) throw rc;
106 H3D_DS_ANALYSIS, H3D_POOL_ELEMENT);
107 if( !rc ) throw rc;
108
110 H3D_DS_ANALYSIS, H3D_POOL_ELEMENT);
111 if( !rc ) throw rc;
112
114 H3D_DS_GLOBAL, H3D_POOL_ELEMENT);
115 if( !rc ) throw rc;
116
118 H3D_DS_GLOBAL, H3D_POOL_ELEMENT);
119 if( !rc ) throw rc;
120
122 H3D_DS_ANALYSIS, H3D_POOL_ELEMENT);
123 if( !rc ) throw rc;
124
126 H3D_DS_ANALYSIS, H3D_POOL_ELEMENT);
127 if( !rc ) throw rc;
128
129
130 if( !rc ) throw rc;
132 if( !rc ) throw rc;
133
134
135 // create Subcase (Loadcase)
136 for( int i=0; i < dt_count; i++ )
137 {
138 datatype_ids[i] = i + 1;
139 }
140
141 unsigned int sub_count = 1;
142 rc = Hyper3DSimSubcaseBegin(h3d_file, sub_count);
143 if( !rc ) throw rc;
144 rc = Hyper3DSimSubcaseWrite(h3d_file, "Loadcase 1", subcase_id, H3D_NONLINEAR,
145 dt_count, datatype_ids, H3D_NODAL_DISPLACEMENT);
146 if( !rc ) throw rc;
147
148 unsigned int anim_grp_count = 1;
149 unsigned int grp_datatype_ids = 1;
150 unsigned int num_dts_per_grp = 3;
151
152 datatype_ids[0] = 2;
153 datatype_ids[1] = dt_count-1;
154 datatype_ids[2] = dt_count;
155
157 &grp_datatype_ids, &num_dts_per_grp, &datatype_ids[0]);
158 if( !rc ) throw rc;
159
161 if( !rc ) throw rc;
162
163 } // end of try
164
165 catch(...) {
167 }
168 delete [] datatype_ids;
169
170 bool rc2 = Hyper3DWriteTOC(h3d_file);
171}
172
173
174
175
178
181
184}
void c_h3d_create_results_end__()
void c_h3d_create_results_end()
void c_h3d_create_results_end_()
void _FCALL C_H3D_CREATE_RESULTS_END()
H3D_ID shell_poolname_id
H3DFileInfo * h3d_file
unsigned int dt_count
H3D_ID node_poolname_id
bool rc
H3D_ID spring_poolname_id
H3D_ID sh4n_poolname_id
H3D_ID beam_poolname_id
H3D_ID sh3n_poolname_id
H3D_ID solid_poolname_id
H3D_ID subcase_id
H3D_ID sphcell_poolname_id
H3D_ID skin_poolname_id
H3D_ID truss_poolname_id
H3D_ID quad_poolname_id
bool Hyper3DResultAddSystem(H3DFileInfo *h3d_file, H3D_ID poolname_id, int system_id, H3D_ID_POOL_TYPE sysType)
Definition h3d_dl.c:1231
bool Hyper3DWriteTOC(H3DFileInfo *h3d_file)
Definition h3d_dl.c:934
bool Hyper3DResultWrite(H3DFileInfo *h3d_file, const char *label, H3D_DS_SHELL_METHOD method, unsigned int num_systems)
Definition h3d_dl.c:1224
bool Hyper3DSimSubcaseAnimationGroups(H3DFileInfo *h3d_file, H3D_ID id, unsigned int num_groups, H3D_ID *grp_datatype_ids, unsigned int *num_dts_per_grp, H3D_ID *datatype_ids)
Definition h3d_dl.c:1265
bool Hyper3DResultEnd(H3DFileInfo *h3d_file)
Definition h3d_dl.c:1239
bool Hyper3DExportClearError(H3DFileInfo *h3d_file)
Definition h3d_dl.c:939
bool Hyper3DSimSubcaseEnd(H3DFileInfo *h3d_file)
Definition h3d_dl.c:1275
bool Hyper3DSimSubcaseWrite(H3DFileInfo *h3d_file, const char *label, H3D_ID id, H3D_ANALYSIS_TYPE atype, unsigned int num_datatypes, H3D_ID *datatype_ids, H3D_NODAL_DATA_TYPE anim_type)
Definition h3d_dl.c:1255
bool Hyper3DSimSubcaseBegin(H3DFileInfo *h3d_file, unsigned int count)
Definition h3d_dl.c:1249
bool Hyper3DResultBegin(H3DFileInfo *h3d_file, unsigned int count)
Definition h3d_dl.c:1218
#define _FCALL