OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_create_beams.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#ifdef _WIN32
32/* Windows includes */
33#include <windows.h>
34#include <process.h>
35#include <io.h>
36#include <sys\types.h>
37#include <sys/stat.h>
38
39
40#elif 1
41
42/* Linux includes */
43#include <sys/resource.h>
44#include <sys/types.h>
45#include <time.h>
46#include <sys/stat.h>
47#include <unistd.h>
48#include <dlfcn.h>
49#define _FCALL
50#include <math.h>
51#include <stdbool.h>
52
53#endif
54
55#include "h3dpublic_defs.h"
56#include "h3dpublic_export.h"
57
58#define _FCALL
59
60#include "h3d_values.h"
61
62extern "C"
63/*=================================================================*/
64{
65
66
67/*=================================================================*/
68/* C_H3D_CREATE_beams */
69/*=================================================================*/
70void c_h3d_create_beams_(int *ITAB, int *NUMNOD, int *IXP, int *NIXP, int *NUMELP, int *IPARTP, int *IPART, int *LIPART1, int *H3D_PART)
71{
72 try {
73
74 // create Elements
75 unsigned int conn[2] ;
76 H3D_ID elem_id ;
77 int i;
78
79 unsigned int elem_count = 1;
80
81
82 char BEAMPOOL[] = "BEAM";
84 if( !rc ) throw rc;
85
86
87
88 for(i=0;i<*NUMELP;i++)
89 {
90 if(H3D_PART[IPARTP[i] - 1] == 1)
91 {
92 elem_id = IXP[*NIXP * i + *NIXP-1];
93 conn[0] = IXP[*NIXP * i + 1];
94 conn[1] = IXP[*NIXP * i + 2];
95 comp_id = IPART[*LIPART1 * (IPARTP[i] - 1) + 3];
96
98 H3D_ELEM_CONFIG_ROD, comp_id,
100 if( !rc ) throw rc;
101 rc = Hyper3DElementWrite(h3d_file, elem_id, conn);
102 if( !rc ) throw rc;
104 if( !rc ) throw rc;
105 }
106 }
107
108
109 } // end of try
110
111 catch(...) {
113 }
114
115}
116
117void _FCALL C_H3D_CREATE_BEAMS(int *ITAB, int *NUMNOD, int *IXP, int *NIXP, int *NUMELP, int *IPARTP, int *IPART, int *LIPART1, int *H3D_PART)
118{c_h3d_create_beams_ (ITAB,NUMNOD,IXP,NIXP,NUMELP,IPARTP,IPART,LIPART1,H3D_PART);}
119
120void c_h3d_create_beams__ (int *ITAB, int *NUMNOD, int *IXP, int *NIXP, int *NUMELP, int *IPARTP, int *IPART, int *LIPART1, int *H3D_PART)
121{c_h3d_create_beams_ (ITAB,NUMNOD,IXP,NIXP,NUMELP,IPARTP,IPART,LIPART1,H3D_PART);}
122
123void c_h3d_create_beams (int *ITAB, int *NUMNOD, int *IXP, int *NIXP, int *NUMELP, int *IPARTP, int *IPART, int *LIPART1, int *H3D_PART)
124{c_h3d_create_beams_ (ITAB,NUMNOD,IXP,NIXP,NUMELP,IPARTP,IPART,LIPART1,H3D_PART);}
125}
void c_h3d_create_beams_(int *ITAB, int *NUMNOD, int *IXP, int *NIXP, int *NUMELP, int *IPARTP, int *IPART, int *LIPART1, int *H3D_PART)
void c_h3d_create_beams(int *ITAB, int *NUMNOD, int *IXP, int *NIXP, int *NUMELP, int *IPARTP, int *IPART, int *LIPART1, int *H3D_PART)
void _FCALL C_H3D_CREATE_BEAMS(int *ITAB, int *NUMNOD, int *IXP, int *NIXP, int *NUMELP, int *IPARTP, int *IPART, int *LIPART1, int *H3D_PART)
void c_h3d_create_beams__(int *ITAB, int *NUMNOD, int *IXP, int *NIXP, int *NUMELP, int *IPARTP, int *IPART, int *LIPART1, int *H3D_PART)
H3D_ID onedelem_poolname_id
H3DFileInfo * h3d_file
H3D_ID node_poolname_id
bool rc
H3D_ID beam_poolname_id
H3D_ID comp_id
bool Hyper3DAddString(H3DFileInfo *h3d_file, const char *const string, H3D_ID *const str_id)
Definition h3d_dl.c:955
bool Hyper3DExportClearError(H3DFileInfo *h3d_file)
Definition h3d_dl.c:939
bool Hyper3DElementWrite(H3DFileInfo *h3d_file, H3D_ID id, H3D_ID *connectivity)
Definition h3d_dl.c:1147
bool Hyper3DElementEnd(H3DFileInfo *h3d_file)
Definition h3d_dl.c:1154
bool Hyper3DElementBegin(H3DFileInfo *h3d_file, unsigned int count, H3D_ID poolname_id, H3D_ElementConfig config, H3D_ID parent_id, H3D_ID parent_poolname_id, H3D_ID node_poolname_id)
Definition h3d_dl.c:1137
#define _FCALL