OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_create_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/* C_H3D_CREATE_NODES */
76/*=================================================================*/
77void c_h3d_create_nodes_(int *ITAB, int *NUMNOD, my_real *X, int *TAGNOD, my_real *D)
78{
79 try {
80
81 float node[3];
82 int i;
83 H3D_ID node_id;
84//
85
86
87
88 if( *NUMNOD != 0 )
89 {
91 if( !rc ) throw rc;
92
93 for(i=0;i<*NUMNOD;i++)
94 {
95 if( TAGNOD[i] == 1 )
96 {
97 node[0] = X[3*i ] - D[3*i ];
98 node[1] = X[3*i + 1] - D[3*i + 1];
99 node[2] = X[3*i + 2] - D[3*i + 2];
100 node_id = ITAB[i];
101
102 if (node_id != 0) rc = Hyper3DPositionWrite(h3d_file, node_id, node, H3D_NULL_ID, H3D_NULL_ID);
103 if( !rc ) throw rc;
104 }
105 }
106
108 if( !rc ) throw rc;
109 }
110
111
112 } // end of try
113
114 catch(...) {
116 }
117}
118
119void _FCALL C_H3D_CREATE_NODES(int *ITAB, int *NUMNOD, my_real *X, int *TAGNOD, my_real *D)
120{c_h3d_create_nodes_ (ITAB,NUMNOD,X,TAGNOD,D);}
121
122void c_h3d_create_nodes__ (int *ITAB, int *NUMNOD, my_real *X, int *TAGNOD, my_real *D)
123{c_h3d_create_nodes_ (ITAB,NUMNOD,X,TAGNOD,D);}
124
125void c_h3d_create_nodes (int *ITAB, int *NUMNOD, my_real *X, int *TAGNOD, my_real *D)
126{c_h3d_create_nodes_ (ITAB,NUMNOD,X,TAGNOD,D);}
127
128}
void c_h3d_create_nodes_(int *ITAB, int *NUMNOD, my_real *X, int *TAGNOD, my_real *D)
void c_h3d_create_nodes(int *ITAB, int *NUMNOD, my_real *X, int *TAGNOD, my_real *D)
void c_h3d_create_nodes__(int *ITAB, int *NUMNOD, my_real *X, int *TAGNOD, my_real *D)
void _FCALL C_H3D_CREATE_NODES(int *ITAB, int *NUMNOD, my_real *X, int *TAGNOD, my_real *D)
H3DFileInfo * h3d_file
H3D_ID node_poolname_id
bool rc
#define my_real
Definition cppsort.cpp:32
bool Hyper3DPositionBegin(H3DFileInfo *h3d_file, unsigned int count, H3D_ID poolname_id)
Definition h3d_dl.c:1113
bool Hyper3DExportClearError(H3DFileInfo *h3d_file)
Definition h3d_dl.c:939
bool Hyper3DPositionEnd(H3DFileInfo *h3d_file)
Definition h3d_dl.c:1127
bool Hyper3DPositionWrite(H3DFileInfo *h3d_file, H3D_ID id, float *coords, H3D_ID refsys_id, H3D_ID analysis_id)
Definition h3d_dl.c:1120
#define _FCALL