50 DoubleTab sommets_ajoutes(oldsz,
dimension);
53 for (
int i = 0; i < oldsz; i++)
55 sommets(nbs + i, j) = sommets_ajoutes(i, j);
60 dom.
typer(
"Triangle");
61 IntTab new_elems(8 * oldsz, 3);
62 IntTab fait_sommet_arete(4 * nbs, 3);
63 fait_sommet_arete = -1;
66 for (
int i = 0; i < oldsz; i++)
68 int i0 = les_elems(i, 0);
69 int i1 = les_elems(i, 1);
70 int i2 = les_elems(i, 2);
71 int i3 = les_elems(i, 3);
77 for (
int ii = 0; ii < j; ii++)
79 if (fait_sommet_arete(ii, 0) == i0 && fait_sommet_arete(ii, 1) == i1)
80 i01 = nbs + oldsz + ii;
81 if (fait_sommet_arete(ii, 0) == i0 && fait_sommet_arete(ii, 1) == i2)
82 i02 = nbs + oldsz + ii;
83 if (fait_sommet_arete(ii, 0) == i1 && fait_sommet_arete(ii, 1) == i3)
84 i13 = nbs + oldsz + ii;
85 if (fait_sommet_arete(ii, 0) == i2 && fait_sommet_arete(ii, 1) == i3)
86 i23 = nbs + oldsz + ii;
91 fait_sommet_arete(j, 0) = i0;
92 fait_sommet_arete(j, 1) = i1;
93 i01 = nbs + oldsz + j;
94 sommets(i01, 0) = 0.5 * (xs(i0, 0) + xs(i1, 0));
95 sommets(i01, 1) = 0.5 * (xs(i0, 1) + xs(i1, 1));
101 fait_sommet_arete(j, 0) = i0;
102 fait_sommet_arete(j, 1) = i2;
103 i02 = nbs + oldsz + j;
104 sommets(i02, 0) = 0.5 * (xs(i0, 0) + xs(i2, 0));
105 sommets(i02, 1) = 0.5 * (xs(i0, 1) + xs(i2, 1));
111 fait_sommet_arete(j, 0) = i1;
112 fait_sommet_arete(j, 1) = i3;
113 i13 = nbs + oldsz + j;
114 sommets(i13, 0) = 0.5 * (xs(i1, 0) + xs(i3, 0));
115 sommets(i13, 1) = 0.5 * (xs(i1, 1) + xs(i3, 1));
121 fait_sommet_arete(j, 0) = i2;
122 fait_sommet_arete(j, 1) = i3;
123 i23 = nbs + oldsz + j;
124 sommets(i23, 0) = 0.5 * (xs(i2, 0) + xs(i3, 0));
125 sommets(i23, 1) = 0.5 * (xs(i2, 1) + xs(i3, 1));
129 new_elems(i, 0) = i + nbs;
130 new_elems(i, 1) = i0;
131 new_elems(i, 2) = i01;
133 new_elems(i + oldsz, 0) = i + nbs;
134 new_elems(i + oldsz, 1) = i01;
135 new_elems(i + oldsz, 2) = i1;
138 new_elems(i + 2 * oldsz, 0) = i + nbs;
139 new_elems(i + 2 * oldsz, 1) = i1;
140 new_elems(i + 2 * oldsz, 2) = i13;
143 new_elems(i + 3 * oldsz, 0) = i + nbs;
144 new_elems(i + 3 * oldsz, 1) = i13;
145 new_elems(i + 3 * oldsz, 2) = i3;
148 new_elems(i + 4 * oldsz, 0) = i + nbs;
149 new_elems(i + 4 * oldsz, 1) = i3;
150 new_elems(i + 4 * oldsz, 2) = i23;
153 new_elems(i + 5 * oldsz, 0) = i + nbs;
154 new_elems(i + 5 * oldsz, 1) = i23;
155 new_elems(i + 5 * oldsz, 2) = i2;
158 new_elems(i + 6 * oldsz, 0) = i + nbs;
159 new_elems(i + 6 * oldsz, 1) = i2;
160 new_elems(i + 6 * oldsz, 2) = i02;
163 new_elems(i + 7 * oldsz, 0) = i + nbs;
164 new_elems(i + 7 * oldsz, 1) = i02;
165 new_elems(i + 7 * oldsz, 2) = i0;
170 if (nbs + oldsz + j > 4 * nbs)
172 Cerr <<
" Review the sizing of sommets() in Trianguler_fin " << finl;
176 les_elems.
ref(new_elems);
179 Cerr <<
"We have split the rectangles..." << finl;
181 dom.
typer(
"Triangle");
182 Cerr <<
" Reconstruction of the Octree" << finl;
184 Cerr <<
" Octree rebuilt" << finl;
186 Cerr <<
"Splitting of the boundaries" << finl;
189 Faces& les_faces = itr.faces();
190 les_faces.
typer(Type_Face::segment_2D);
192 int nb_faces = sommetsfaces.
dimension(0);
193 IntTab nouveaux(2 * nb_faces, 2);
197 for (
int i = 0; i < nb_faces; i++)
199 int i0 = sommetsfaces(i, 0);
200 int i1 = sommetsfaces(i, 1);
202 for (
int ii = 0; ii < nbs + oldsz + j; ii++)
203 if (fait_sommet_arete(ii, 0) == i0 && fait_sommet_arete(ii, 1) == i1)
204 i01 = nbs + oldsz + ii;
206 nouveaux(2 * i, 0) = i0;
207 nouveaux(2 * i, 1) = i01;
208 nouveaux(2 * i + 1, 0) = i01;
209 nouveaux(2 * i + 1, 1) = i1;
211 sommetsfaces.
ref(nouveaux);
214 Cerr <<
"Splitting of the connectors" << finl;
217 Faces& les_faces = itr->faces();
218 les_faces.
typer(Type_Face::segment_2D);
220 int nb_faces = sommetsfaces.
dimension(0);
221 IntTab nouveaux(2 * nb_faces, 2);
225 for (
int i = 0; i < nb_faces; i++)
227 int i0 = sommetsfaces(i, 0);
228 int i1 = sommetsfaces(i, 1);
230 for (
int ii = 0; ii < nbs + oldsz + j; ii++)
231 if (fait_sommet_arete(ii, 0) == i0 && fait_sommet_arete(ii, 1) == i1)
232 i01 = nbs + oldsz + ii;
234 nouveaux(2 * i, 0) = i0;
235 nouveaux(2 * i, 1) = i01;
236 nouveaux(2 * i + 1, 0) = i01;
237 nouveaux(2 * i + 1, 1) = i1;
239 sommetsfaces.
ref(nouveaux);
242 Cerr <<
"Splitting of the internal boundary faces" << finl;
245 Faces& les_faces = itr.faces();
246 les_faces.
typer(Type_Face::segment_2D);
248 int nb_faces = sommetsfaces.
dimension(0);
249 IntTab nouveaux(2 * nb_faces, 2);
253 for (
int i = 0; i < nb_faces; i++)
255 int i0 = sommetsfaces(i, 0);
256 int i1 = sommetsfaces(i, 1);
258 for (
int ii = 0; ii < nbs + oldsz + j; ii++)
259 if (fait_sommet_arete(ii, 0) == i0 && fait_sommet_arete(ii, 1) == i1)
260 i01 = nbs + oldsz + ii;
262 nouveaux(2 * i, 0) = i0;
263 nouveaux(2 * i, 1) = i01;
264 nouveaux(2 * i + 1, 0) = i01;
265 nouveaux(2 * i + 1, 1) = i1;
267 sommetsfaces.
ref(nouveaux);
270 Cerr <<
"Splitting of the group of faces" << finl;
273 Faces& les_faces = itr.faces();
274 les_faces.
typer(Type_Face::segment_2D);
276 int nb_faces = sommetsfaces.
dimension(0);
277 IntTab nouveaux(2 * nb_faces, 2);
281 for (
int i = 0; i < nb_faces; i++)
283 int i0 = sommetsfaces(i, 0);
284 int i1 = sommetsfaces(i, 1);
286 for (
int ii = 0; ii < nbs + oldsz + j; ii++)
287 if (fait_sommet_arete(ii, 0) == i0 && fait_sommet_arete(ii, 1) == i1)
288 i01 = nbs + oldsz + ii;
290 nouveaux(2 * i, 0) = i0;
291 nouveaux(2 * i, 1) = i01;
292 nouveaux(2 * i + 1, 0) = i01;
293 nouveaux(2 * i + 1, 1) = i1;
295 sommetsfaces.
ref(nouveaux);
300 Cerr <<
"We do not yet know how to Trianguler_fin the " << dom.type_elem()->
que_suis_je() <<
"s" << finl;