80{
81 unsigned int * nbelems = new unsigned int [*NUMSPH];
82 try {
83
84
85
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";
97
98 char SPHCELLPOOL[] = "SPHCELL";
101
102 char SPHPOOL[] = "Sph";
105
106 unsigned int elem_count = 1;
107
108
109
111 j = 0;
112
113 float node[3];
114 H3D_ID node_id;
115
116
117 if(*NUMSPH > 0)
118 {
119
120
121
122
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
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
162 }
163 cpt_elem++;
164
167
168
169 if (cpt_elem == nbelemwrite)
170 {
173 }
174 }
175 }
176
177
178 }
179
180
181
182
183 }
184
185 catch(...) {
187 }
188 delete [] nbelems;
189
190
191}
H3D_ID sphcell_poolname_id
bool Hyper3DAddString(H3DFileInfo *h3d_file, const char *const string, H3D_ID *const str_id)
bool Hyper3DExportClearError(H3DFileInfo *h3d_file)
bool Hyper3DElementWrite(H3DFileInfo *h3d_file, H3D_ID id, H3D_ID *connectivity)
bool Hyper3DElementEnd(H3DFileInfo *h3d_file)
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)