OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_update_rwalls.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_update_RWALLS */
76/*=================================================================*/
77void c_h3d_update_rwalls_(int *NOM_OPT, int *LNOPT1, int *I16D, int *NPRW, int *NRWALL, int *MAX_NOD_ID,
78 my_real *XWL, my_real *YWL , my_real *ZWL, my_real *V1, my_real *V2, my_real *V3,
79 my_real *VV1, my_real *VV2 , my_real *VV3 )
80{
81
82 try {
83
84
85 float node[3];
86 H3D_ID node_id;
87
88 // update Elements
89 H3D_ID elem_id ;
90 H3D_ID RigidElem ;
91 int i,j,nsn,nbelemwrite;
92
93 unsigned int elem_count = 1;
94
95 for(i=0;i<*NRWALL;i++)
96 {
97 elem_id = NOM_OPT[*I16D + i * *LNOPT1 - 1];
98 RigidElem = NOM_OPT[*I16D + i * *LNOPT1 - 1];
99
101 if( !rc ) throw rc;
102
103 node[0] = XWL[i] + V1[i];
104 node[1] = YWL[i] + V2[i];
105 node[2] = ZWL[i] + V3[i];
106 node_id = *MAX_NOD_ID+ (4 * i) + 1 ;
107
108 rc = Hyper3DPositionWrite(h3d_file, node_id, node, H3D_NULL_ID, H3D_NULL_ID);
109 if( !rc ) throw rc;
110
111 node[0] = XWL[i] + VV1[i];
112 node[1] = YWL[i] + VV2[i];
113 node[2] = ZWL[i] + VV3[i];
114 node_id = *MAX_NOD_ID+ (4 * i) + 2 ;
115
116 rc = Hyper3DPositionWrite(h3d_file, node_id, node, H3D_NULL_ID, H3D_NULL_ID);
117 if( !rc ) throw rc;
118
119 node[0] = XWL[i] - V1[i];
120 node[1] = YWL[i] - V2[i];
121 node[2] = ZWL[i] - V3[i];
122 node_id = *MAX_NOD_ID+ (4 * i) + 3 ;
123
124 rc = Hyper3DPositionWrite(h3d_file, node_id, node, H3D_NULL_ID, H3D_NULL_ID);
125 if( !rc ) throw rc;
126
127 node[0] = XWL[i] - VV1[i];
128 node[1] = YWL[i] - VV2[i];
129 node[2] = ZWL[i] - VV3[i];
130 node_id = *MAX_NOD_ID+ (4 * i) + 4 ;
131
132 rc = Hyper3DPositionWrite(h3d_file, node_id, node, H3D_NULL_ID, H3D_NULL_ID);
133 if( !rc ) throw rc;
134
136 if( !rc ) throw rc;
137
138 }
139
140
141 } // end of try
142
143 catch(...) {
145 }
146
147}
148
149void _FCALL C_H3D_UPDATE_RWALLS(int *NOM_OPT, int *LNOPT1, int *I16D, int *NPRW, int *NRWALL, int *MAX_NOD_ID,
150 my_real *XWL, my_real *YWL , my_real *ZWL, my_real *V1, my_real *V2, my_real *V3,
151 my_real *VV1, my_real *VV2 , my_real *VV3 )
152{c_h3d_update_rwalls_ (NOM_OPT, LNOPT1, I16D, NPRW, NRWALL, MAX_NOD_ID,
153 XWL, YWL, ZWL, V1, V2, V3, VV1, VV2 , VV3 );}
154
155void c_h3d_update_rwalls__ (int *NOM_OPT, int *LNOPT1, int *I16D, int *NPRW, int *NRWALL, int *MAX_NOD_ID,
156 my_real *XWL, my_real *YWL , my_real *ZWL, my_real *V1, my_real *V2, my_real *V3,
157 my_real *VV1, my_real *VV2 , my_real *VV3 )
158{c_h3d_update_rwalls_ (NOM_OPT, LNOPT1, I16D, NPRW, NRWALL, MAX_NOD_ID,
159 XWL, YWL, ZWL, V1, V2, V3, VV1, VV2 , VV3 );}
160
161void c_h3d_update_rwalls (int *NOM_OPT, int *LNOPT1, int *I16D, int *NPRW, int *NRWALL, int *MAX_NOD_ID,
162 my_real *XWL, my_real *YWL , my_real *ZWL, my_real *V1, my_real *V2, my_real *V3,
163 my_real *VV1, my_real *VV2 , my_real *VV3 )
164{c_h3d_update_rwalls_ (NOM_OPT, LNOPT1, I16D, NPRW, NRWALL, MAX_NOD_ID,
165 XWL, YWL, ZWL, V1, V2, V3, VV1, VV2 , VV3 );}
166
167}
H3DFileInfo * h3d_file
H3D_ID node_poolname_id
bool rc
void c_h3d_update_rwalls(int *NOM_OPT, int *LNOPT1, int *I16D, int *NPRW, int *NRWALL, int *MAX_NOD_ID, my_real *XWL, my_real *YWL, my_real *ZWL, my_real *V1, my_real *V2, my_real *V3, my_real *VV1, my_real *VV2, my_real *VV3)
void c_h3d_update_rwalls_(int *NOM_OPT, int *LNOPT1, int *I16D, int *NPRW, int *NRWALL, int *MAX_NOD_ID, my_real *XWL, my_real *YWL, my_real *ZWL, my_real *V1, my_real *V2, my_real *V3, my_real *VV1, my_real *VV2, my_real *VV3)
void _FCALL C_H3D_UPDATE_RWALLS(int *NOM_OPT, int *LNOPT1, int *I16D, int *NPRW, int *NRWALL, int *MAX_NOD_ID, my_real *XWL, my_real *YWL, my_real *ZWL, my_real *V1, my_real *V2, my_real *V3, my_real *VV1, my_real *VV2, my_real *VV3)
void c_h3d_update_rwalls__(int *NOM_OPT, int *LNOPT1, int *I16D, int *NPRW, int *NRWALL, int *MAX_NOD_ID, my_real *XWL, my_real *YWL, my_real *ZWL, my_real *V1, my_real *V2, my_real *V3, my_real *VV1, my_real *VV2, my_real *VV3)
#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