OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
c_h3d_create_sph.cpp File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <fcntl.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <time.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dlfcn.h>
#include <stdbool.h>
#include "h3dpublic_defs.h"
#include "h3dpublic_export.h"
#include "h3d_values.h"

Go to the source code of this file.

Macros

#define _FCALL
#define _FCALL

Functions

void c_h3d_create_sph_ (int *ITAB, int *NUMNOD, int *KXSP, int *NISP, int *NUMSPH, int *IPARTSP, int *IPART, int *LIPART1, my_real *X, int *H3D_PART)
void _FCALL C_H3D_CREATE_SPH (int *ITAB, int *NUMNOD, int *KXSP, int *NISP, int *NUMSPH, int *IPARTSP, int *IPART, int *LIPART1, my_real *X, int *H3D_PART)
void c_h3d_create_sph__ (int *ITAB, int *NUMNOD, int *KXSP, int *NISP, int *NUMSPH, int *IPARTSP, int *IPART, int *LIPART1, my_real *X, int *H3D_PART)
void c_h3d_create_sph (int *ITAB, int *NUMNOD, int *KXSP, int *NISP, int *NUMSPH, int *IPARTSP, int *IPART, int *LIPART1, my_real *X, int *H3D_PART)

Macro Definition Documentation

◆ _FCALL [1/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_sph.cpp.

◆ _FCALL [2/2]

#define _FCALL

Definition at line 50 of file c_h3d_create_sph.cpp.

Function Documentation

◆ C_H3D_CREATE_SPH()

void _FCALL C_H3D_CREATE_SPH ( int * ITAB,
int * NUMNOD,
int * KXSP,
int * NISP,
int * NUMSPH,
int * IPARTSP,
int * IPART,
int * LIPART1,
my_real * X,
int * H3D_PART )

Definition at line 193 of file c_h3d_create_sph.cpp.

195{c_h3d_create_sph_ (ITAB,NUMNOD,KXSP,NISP,NUMSPH,IPARTSP,IPART,LIPART1,X,H3D_PART);}
void c_h3d_create_sph_(int *ITAB, int *NUMNOD, int *KXSP, int *NISP, int *NUMSPH, int *IPARTSP, int *IPART, int *LIPART1, my_real *X, int *H3D_PART)

◆ c_h3d_create_sph()

void c_h3d_create_sph ( int * ITAB,
int * NUMNOD,
int * KXSP,
int * NISP,
int * NUMSPH,
int * IPARTSP,
int * IPART,
int * LIPART1,
my_real * X,
int * H3D_PART )

Definition at line 201 of file c_h3d_create_sph.cpp.

203{c_h3d_create_sph_ (ITAB,NUMNOD,KXSP,NISP,NUMSPH,IPARTSP,IPART,LIPART1,X,H3D_PART);}

◆ c_h3d_create_sph_()

void c_h3d_create_sph_ ( int * ITAB,
int * NUMNOD,
int * KXSP,
int * NISP,
int * NUMSPH,
int * IPARTSP,
int * IPART,
int * LIPART1,
my_real * X,
int * H3D_PART )

Definition at line 78 of file c_h3d_create_sph.cpp.

80{
81 unsigned int * nbelems = new unsigned int [*NUMSPH];
82 try {
83
84
85 // create Elements
86 unsigned int conn[1] ;
87 H3D_ID elem_id ;
88 int i,n1,n2,n3,n4,n5,n6,n7,n8;
89 int cpt_elem,nbelemwrite;
90 int elem_nodes = 0;
91 int elem_nodes_m1 = 0;
92 int j = 0;
93
94 char NODEPOOL[] = "Nodes";
96 if( !rc ) throw rc;
97
98 char SPHCELLPOOL[] = "SPHCELL";
100 if( !rc ) throw rc;
101
102 char SPHPOOL[] = "Sph";
104 if( !rc ) throw rc;
105
106 unsigned int elem_count = 1;
107
108
109
110 comp_id = 0;
111 j = 0;
112
113 float node[3];
114 H3D_ID node_id;
115//
116
117 if(*NUMSPH > 0)
118 {
119
120
121
122
123 comp_id = 0;
124 j = 0;
125 for(i=0;i<*NUMSPH;i++) nbelems[i] = 0;
126
127 for(i=0;i<*NUMSPH;i++)
128 {
129 if(H3D_PART[IPARTSP[i] - 1] == 1)
130 {
131 if(IPART[*LIPART1 * (IPARTSP[i] - 1) + 3] != comp_id)
132 {
133 comp_id = IPART[*LIPART1 * (IPARTSP[i] - 1) + 3];
134 j = i;
135 }
136 nbelems[j] = nbelems[j] + 1;
137 }
138 }
139
140 comp_id = 0;
141 cpt_elem = 0;
142 nbelemwrite = 0;
143
144 for(i=0;i<*NUMSPH;i++)
145 {
146 if(H3D_PART[IPARTSP[i] - 1] == 1)
147 {
148
149 conn[0] = KXSP[*NISP * i + 2] ;
150 elem_id = KXSP[*NISP * i + *NISP - 1] ;
151
152 if(nbelems[i] != 0)
153 {
154 cpt_elem = 0;
155 nbelemwrite = nbelems[i];
156 comp_id = IPART[*LIPART1 * (IPARTSP[i] - 1) + 3] ;
157
159 H3D_ELEM_CONFIG_MASS, comp_id,
161 if( !rc ) throw rc;
162 }
163 cpt_elem++;
164
165 rc = Hyper3DElementWrite(h3d_file, elem_id, conn);
166 if( !rc ) throw rc;
167
168
169 if (cpt_elem == nbelemwrite)
170 {
172 if( !rc ) throw rc;
173 }
174 }
175 }
176
177
178 }
179
180
181
182
183 } // end of try
184
185 catch(...) {
187 }
188 delete [] nbelems;
189
190//
191}
H3DFileInfo * h3d_file
H3D_ID sph_poolname_id
H3D_ID node_poolname_id
bool rc
H3D_ID comp_id
H3D_ID sphcell_poolname_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

◆ c_h3d_create_sph__()

void c_h3d_create_sph__ ( int * ITAB,
int * NUMNOD,
int * KXSP,
int * NISP,
int * NUMSPH,
int * IPARTSP,
int * IPART,
int * LIPART1,
my_real * X,
int * H3D_PART )

Definition at line 197 of file c_h3d_create_sph.cpp.

199{c_h3d_create_sph_ (ITAB,NUMNOD,KXSP,NISP,NUMSPH,IPARTSP,IPART,LIPART1,X,H3D_PART);}