26 #ifndef OOMPH_BRICK_FROM_TET_MESH_TEMPLATE_CC
27 #define OOMPH_BRICK_FROM_TET_MESH_TEMPLATE_CC
38 template<
class ELEMENT>
40 XdaTetMesh<TElement<3, 3>>* tet_mesh_pt, TimeStepper* time_stepper_pt)
43 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(3, 3);
46 bool tet_mesh_is_solid_mesh =
false;
47 if (
dynamic_cast<SolidFiniteElement*
>(tet_mesh_pt->element_pt(0)) != 0)
49 tet_mesh_is_solid_mesh =
true;
56 Vector<Vector<double>> s_face(19);
57 for (
unsigned i = 0; i < 19; i++)
133 s_face[i][0] = 1.0 / 3.0;
134 s_face[i][1] = 1.0 / 3.0;
141 s_face[i][0] = 5.0 / 24.0;
142 s_face[i][1] = 5.0 / 24.0;
146 s_face[i][0] = 5.0 / 12.0;
147 s_face[i][1] = 5.0 / 12.0;
153 s_face[i][1] = 5.0 / 24.0;
154 s_face[i][0] = 7.0 / 12.0;
158 s_face[i][1] = 5.0 / 12.0;
159 s_face[i][0] = 1.0 / 6.0;
166 s_face[i][0] = 5.0 / 24.0;
167 s_face[i][1] = 7.0 / 12.0;
171 s_face[i][0] = 5.0 / 12.0;
172 s_face[i][1] = 1.0 / 6.0;
178 unsigned nb = tet_mesh_pt->nboundary();
182 Boundary_element_pt.resize(nb);
183 Face_index_at_boundary.resize(nb);
188 std::map<Node*, Node*> tet_node_node_pt;
191 std::map<Edge, Node*> brick_edge_node_pt;
194 std::map<TFace, Node*> tet_face_node_pt;
198 Vector<DummyBrickElement*> dummy_q_el_pt(4);
199 for (
unsigned e = 0; e < 4; e++)
201 dummy_q_el_pt[e] =
new DummyBrickElement;
202 for (
unsigned j = 0; j < 8; j++)
204 dummy_q_el_pt[e]->construct_node(j);
209 unsigned n_el_tet = tet_mesh_pt->nelement();
210 for (
unsigned e_tet = 0; e_tet < n_el_tet; e_tet++)
213 TElement<3, 3>* tet_el_pt =
214 dynamic_cast<TElement<3, 3>*
>(tet_mesh_pt->element_pt(e_tet));
219 std::ostringstream error_stream;
221 <<
"BrickFromTetMesh can only built from tet mesh containing\n"
222 <<
"ten-noded tets.\n";
224 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
229 Node* centroid_node_pt = 0;
232 Node* top_mid_face_node0_pt = 0;
233 Node* right_mid_face_node0_pt = 0;
234 Node* back_mid_face_node0_pt = 0;
236 Node* top_mid_face_node1_pt = 0;
237 Node* right_mid_face_node1_pt = 0;
239 Node* top_mid_face_node2_pt = 0;
242 FiniteElement* brick_el0_pt = 0;
243 FiniteElement* brick_el1_pt = 0;
244 FiniteElement* brick_el2_pt = 0;
245 FiniteElement* brick_el3_pt = 0;
252 for (
unsigned j = 0; j < 8; j++)
254 Node* nod_pt = dummy_q_el_pt[0]->node_pt(j);
255 Vector<double> s_tet(3);
256 Vector<double> x_tet(3);
260 tet_el_pt->local_coordinate_of_node(0, s_tet);
261 nod_pt->set_value(0, s_tet[0]);
262 nod_pt->set_value(1, s_tet[1]);
263 nod_pt->set_value(2, s_tet[2]);
264 tet_el_pt->interpolated_x(s_tet, x_tet);
265 nod_pt->x(0) = x_tet[0];
266 nod_pt->x(1) = x_tet[1];
267 nod_pt->x(2) = x_tet[2];
270 tet_el_pt->local_coordinate_of_node(4, s_tet);
271 nod_pt->set_value(0, s_tet[0]);
272 nod_pt->set_value(1, s_tet[1]);
273 nod_pt->set_value(2, s_tet[2]);
274 tet_el_pt->interpolated_x(s_tet, x_tet);
275 nod_pt->x(0) = x_tet[0];
276 nod_pt->x(1) = x_tet[1];
277 nod_pt->x(2) = x_tet[2];
280 tet_el_pt->local_coordinate_of_node(6, s_tet);
281 nod_pt->set_value(0, s_tet[0]);
282 nod_pt->set_value(1, s_tet[1]);
283 nod_pt->set_value(2, s_tet[2]);
284 tet_el_pt->interpolated_x(s_tet, x_tet);
285 nod_pt->x(0) = x_tet[0];
286 nod_pt->x(1) = x_tet[1];
287 nod_pt->x(2) = x_tet[2];
292 s_tet[0] = 1.0 / 3.0;
293 s_tet[1] = 1.0 / 3.0;
295 nod_pt->set_value(0, s_tet[0]);
296 nod_pt->set_value(1, s_tet[1]);
297 nod_pt->set_value(2, s_tet[2]);
298 tet_el_pt->interpolated_x(s_tet, x_tet);
299 nod_pt->x(0) = x_tet[0];
300 nod_pt->x(1) = x_tet[1];
301 nod_pt->x(2) = x_tet[2];
304 tet_el_pt->local_coordinate_of_node(5, s_tet);
305 nod_pt->set_value(0, s_tet[0]);
306 nod_pt->set_value(1, s_tet[1]);
307 nod_pt->set_value(2, s_tet[2]);
308 tet_el_pt->interpolated_x(s_tet, x_tet);
309 nod_pt->x(0) = x_tet[0];
310 nod_pt->x(1) = x_tet[1];
311 nod_pt->x(2) = x_tet[2];
316 s_tet[0] = 1.0 / 3.0;
317 s_tet[1] = 1.0 / 3.0;
318 s_tet[2] = 1.0 / 3.0;
319 nod_pt->set_value(0, s_tet[0]);
320 nod_pt->set_value(1, s_tet[1]);
321 nod_pt->set_value(2, s_tet[2]);
322 tet_el_pt->interpolated_x(s_tet, x_tet);
323 nod_pt->x(0) = x_tet[0];
324 nod_pt->x(1) = x_tet[1];
325 nod_pt->x(2) = x_tet[2];
330 s_tet[0] = 1.0 / 3.0;
332 s_tet[2] = 1.0 / 3.0;
333 nod_pt->set_value(0, s_tet[0]);
334 nod_pt->set_value(1, s_tet[1]);
335 nod_pt->set_value(2, s_tet[2]);
336 tet_el_pt->interpolated_x(s_tet, x_tet);
337 nod_pt->x(0) = x_tet[0];
338 nod_pt->x(1) = x_tet[1];
339 nod_pt->x(2) = x_tet[2];
346 nod_pt->set_value(0, s_tet[0]);
347 nod_pt->set_value(1, s_tet[1]);
348 nod_pt->set_value(2, s_tet[2]);
349 tet_el_pt->interpolated_x(s_tet, x_tet);
350 nod_pt->x(0) = x_tet[0];
351 nod_pt->x(1) = x_tet[1];
352 nod_pt->x(2) = x_tet[2];
359 FiniteElement* el_pt =
new ELEMENT;
360 brick_el0_pt = el_pt;
361 Element_pt.push_back(el_pt);
364 tet_el_pt->node_pt(0), tet_el_pt->node_pt(1), tet_el_pt->node_pt(2));
367 tet_el_pt->node_pt(0), tet_el_pt->node_pt(2), tet_el_pt->node_pt(3));
370 tet_el_pt->node_pt(0), tet_el_pt->node_pt(1), tet_el_pt->node_pt(3));
374 Vector<Vector<unsigned>> tet_edge_node(3);
375 tet_edge_node[0].resize(2);
376 tet_edge_node[0][0] = 4;
377 tet_edge_node[0][1] = 1;
378 tet_edge_node[1].resize(2);
379 tet_edge_node[1][0] = 6;
380 tet_edge_node[1][1] = 3;
381 tet_edge_node[2].resize(2);
382 tet_edge_node[2][0] = 5;
383 tet_edge_node[2][1] = 2;
386 unsigned central_tet_vertex = 0;
388 Node* tet_node_pt = 0;
389 Node* old_node_pt = 0;
396 tet_node_pt = tet_el_pt->node_pt(central_tet_vertex);
397 old_node_pt = tet_node_node_pt[tet_node_pt];
398 if (old_node_pt == 0)
400 Node* new_node_pt = 0;
401 if (tet_node_pt->is_on_boundary())
403 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
407 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
409 tet_node_node_pt[tet_node_pt] = new_node_pt;
410 Node_pt.push_back(new_node_pt);
412 Vector<double> s_tet(3);
413 Vector<double> x_tet(3);
414 el_pt->local_coordinate_of_node(j, s);
415 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
416 tet_el_pt->interpolated_x(s_tet, x_tet);
417 new_node_pt->x(0) = x_tet[0];
418 new_node_pt->x(1) = x_tet[1];
419 new_node_pt->x(2) = x_tet[2];
424 el_pt->node_pt(j) = old_node_pt;
434 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[0][0]);
435 old_node_pt = tet_node_node_pt[tet_node_pt];
436 if (old_node_pt == 0)
438 Node* new_node_pt = 0;
439 if (tet_node_pt->is_on_boundary())
441 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
445 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
447 tet_node_node_pt[tet_node_pt] = new_node_pt;
448 Node_pt.push_back(new_node_pt);
450 Vector<double> s_tet(3);
451 Vector<double> x_tet(3);
452 el_pt->local_coordinate_of_node(j, s);
453 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
454 tet_el_pt->interpolated_x(s_tet, x_tet);
455 new_node_pt->x(0) = x_tet[0];
456 new_node_pt->x(1) = x_tet[1];
457 new_node_pt->x(2) = x_tet[2];
462 el_pt->node_pt(j) = old_node_pt;
472 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[1][0]);
473 old_node_pt = tet_node_node_pt[tet_node_pt];
474 if (old_node_pt == 0)
476 Node* new_node_pt = 0;
477 if (tet_node_pt->is_on_boundary())
479 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
483 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
485 tet_node_node_pt[tet_node_pt] = new_node_pt;
486 Node_pt.push_back(new_node_pt);
488 Vector<double> s_tet(3);
489 Vector<double> x_tet(3);
490 el_pt->local_coordinate_of_node(j, s);
491 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
492 tet_el_pt->interpolated_x(s_tet, x_tet);
493 new_node_pt->x(0) = x_tet[0];
494 new_node_pt->x(1) = x_tet[1];
495 new_node_pt->x(2) = x_tet[2];
500 el_pt->node_pt(j) = old_node_pt;
510 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[2][0]);
511 old_node_pt = tet_node_node_pt[tet_node_pt];
512 if (old_node_pt == 0)
514 Node* new_node_pt = 0;
515 if (tet_node_pt->is_on_boundary())
517 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
521 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
523 tet_node_node_pt[tet_node_pt] = new_node_pt;
524 Node_pt.push_back(new_node_pt);
526 Vector<double> s_tet(3);
527 Vector<double> x_tet(3);
528 el_pt->local_coordinate_of_node(j, s);
529 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
530 tet_el_pt->interpolated_x(s_tet, x_tet);
531 new_node_pt->x(0) = x_tet[0];
532 new_node_pt->x(1) = x_tet[1];
533 new_node_pt->x(2) = x_tet[2];
538 el_pt->node_pt(j) = old_node_pt;
549 old_node_pt = tet_face_node_pt[face0];
550 if (old_node_pt == 0)
552 Node* new_node_pt = 0;
553 if (face0.is_boundary_face())
555 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
559 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
561 tet_face_node_pt[face0] = new_node_pt;
562 Node_pt.push_back(new_node_pt);
564 Vector<double> s_tet(3);
565 Vector<double> x_tet(3);
566 el_pt->local_coordinate_of_node(j, s);
567 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
568 tet_el_pt->interpolated_x(s_tet, x_tet);
569 new_node_pt->x(0) = x_tet[0];
570 new_node_pt->x(1) = x_tet[1];
571 new_node_pt->x(2) = x_tet[2];
576 el_pt->node_pt(j) = old_node_pt;
586 old_node_pt = tet_face_node_pt[face1];
587 if (old_node_pt == 0)
589 Node* new_node_pt = 0;
590 if (face1.is_boundary_face())
592 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
596 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
598 tet_face_node_pt[face1] = new_node_pt;
599 Node_pt.push_back(new_node_pt);
601 Vector<double> s_tet(3);
602 Vector<double> x_tet(3);
603 el_pt->local_coordinate_of_node(j, s);
604 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
605 tet_el_pt->interpolated_x(s_tet, x_tet);
606 new_node_pt->x(0) = x_tet[0];
607 new_node_pt->x(1) = x_tet[1];
608 new_node_pt->x(2) = x_tet[2];
613 el_pt->node_pt(j) = old_node_pt;
623 old_node_pt = tet_face_node_pt[face2];
624 if (old_node_pt == 0)
626 Node* new_node_pt = 0;
627 if (face2.is_boundary_face())
629 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
633 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
635 tet_face_node_pt[face2] = new_node_pt;
636 Node_pt.push_back(new_node_pt);
638 Vector<double> s_tet(3);
639 Vector<double> x_tet(3);
640 el_pt->local_coordinate_of_node(j, s);
641 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
642 tet_el_pt->interpolated_x(s_tet, x_tet);
643 new_node_pt->x(0) = x_tet[0];
644 new_node_pt->x(1) = x_tet[1];
645 new_node_pt->x(2) = x_tet[2];
650 el_pt->node_pt(j) = old_node_pt;
661 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
662 centroid_node_pt = new_node_pt;
663 Node_pt.push_back(new_node_pt);
665 Vector<double> s_tet(3);
666 Vector<double> x_tet(3);
667 el_pt->local_coordinate_of_node(j, s);
668 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
669 tet_el_pt->interpolated_x(s_tet, x_tet);
670 new_node_pt->x(0) = x_tet[0];
671 new_node_pt->x(1) = x_tet[1];
672 new_node_pt->x(2) = x_tet[2];
683 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
684 Node_pt.push_back(new_node_pt);
686 Vector<double> s_tet(3);
687 Vector<double> x_tet(3);
688 el_pt->local_coordinate_of_node(j, s);
689 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
690 tet_el_pt->interpolated_x(s_tet, x_tet);
691 new_node_pt->x(0) = x_tet[0];
692 new_node_pt->x(1) = x_tet[1];
693 new_node_pt->x(2) = x_tet[2];
702 Edge edge(el_pt->node_pt(0), el_pt->node_pt(2));
703 old_node_pt = brick_edge_node_pt[edge];
704 if (old_node_pt == 0)
706 Node* new_node_pt = 0;
707 if (edge.is_boundary_edge())
709 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
713 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
715 brick_edge_node_pt[edge] = new_node_pt;
716 Node_pt.push_back(new_node_pt);
718 Vector<double> s_tet(3);
719 Vector<double> x_tet(3);
720 el_pt->local_coordinate_of_node(j, s);
721 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
722 tet_el_pt->interpolated_x(s_tet, x_tet);
723 new_node_pt->x(0) = x_tet[0];
724 new_node_pt->x(1) = x_tet[1];
725 new_node_pt->x(2) = x_tet[2];
730 el_pt->node_pt(j) = old_node_pt;
740 Edge edge(el_pt->node_pt(0), el_pt->node_pt(6));
741 old_node_pt = brick_edge_node_pt[edge];
742 if (old_node_pt == 0)
744 Node* new_node_pt = 0;
745 if (edge.is_boundary_edge())
747 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
751 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
753 brick_edge_node_pt[edge] = new_node_pt;
754 Node_pt.push_back(new_node_pt);
756 Vector<double> s_tet(3);
757 Vector<double> x_tet(3);
758 el_pt->local_coordinate_of_node(j, s);
759 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
760 tet_el_pt->interpolated_x(s_tet, x_tet);
761 new_node_pt->x(0) = x_tet[0];
762 new_node_pt->x(1) = x_tet[1];
763 new_node_pt->x(2) = x_tet[2];
768 el_pt->node_pt(j) = old_node_pt;
777 Edge edge(el_pt->node_pt(2), el_pt->node_pt(8));
778 old_node_pt = brick_edge_node_pt[edge];
779 if (old_node_pt == 0)
781 Node* new_node_pt = 0;
782 if (edge.is_boundary_edge())
784 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
788 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
790 brick_edge_node_pt[edge] = new_node_pt;
791 Node_pt.push_back(new_node_pt);
793 Vector<double> s_tet(3);
794 Vector<double> x_tet(3);
795 el_pt->local_coordinate_of_node(j, s);
796 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
797 tet_el_pt->interpolated_x(s_tet, x_tet);
798 new_node_pt->x(0) = x_tet[0];
799 new_node_pt->x(1) = x_tet[1];
800 new_node_pt->x(2) = x_tet[2];
805 el_pt->node_pt(j) = old_node_pt;
814 Edge edge(el_pt->node_pt(6), el_pt->node_pt(8));
815 old_node_pt = brick_edge_node_pt[edge];
816 if (old_node_pt == 0)
818 Node* new_node_pt = 0;
819 if (edge.is_boundary_edge())
821 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
825 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
827 brick_edge_node_pt[edge] = new_node_pt;
828 Node_pt.push_back(new_node_pt);
830 Vector<double> s_tet(3);
831 Vector<double> x_tet(3);
832 el_pt->local_coordinate_of_node(j, s);
833 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
834 tet_el_pt->interpolated_x(s_tet, x_tet);
835 new_node_pt->x(0) = x_tet[0];
836 new_node_pt->x(1) = x_tet[1];
837 new_node_pt->x(2) = x_tet[2];
842 el_pt->node_pt(j) = old_node_pt;
851 Edge edge(el_pt->node_pt(18), el_pt->node_pt(20));
852 old_node_pt = brick_edge_node_pt[edge];
853 if (old_node_pt == 0)
855 Node* new_node_pt = 0;
856 if (edge.is_boundary_edge())
858 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
862 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
864 brick_edge_node_pt[edge] = new_node_pt;
865 Node_pt.push_back(new_node_pt);
867 Vector<double> s_tet(3);
868 Vector<double> x_tet(3);
869 el_pt->local_coordinate_of_node(j, s);
870 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
871 tet_el_pt->interpolated_x(s_tet, x_tet);
872 new_node_pt->x(0) = x_tet[0];
873 new_node_pt->x(1) = x_tet[1];
874 new_node_pt->x(2) = x_tet[2];
879 el_pt->node_pt(j) = old_node_pt;
889 Edge edge(el_pt->node_pt(18), el_pt->node_pt(24));
890 old_node_pt = brick_edge_node_pt[edge];
891 if (old_node_pt == 0)
893 Node* new_node_pt = 0;
894 if (edge.is_boundary_edge())
896 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
900 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
902 brick_edge_node_pt[edge] = new_node_pt;
903 Node_pt.push_back(new_node_pt);
905 Vector<double> s_tet(3);
906 Vector<double> x_tet(3);
907 el_pt->local_coordinate_of_node(j, s);
908 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
909 tet_el_pt->interpolated_x(s_tet, x_tet);
910 new_node_pt->x(0) = x_tet[0];
911 new_node_pt->x(1) = x_tet[1];
912 new_node_pt->x(2) = x_tet[2];
917 el_pt->node_pt(j) = old_node_pt;
926 Edge edge(el_pt->node_pt(20), el_pt->node_pt(26));
927 old_node_pt = brick_edge_node_pt[edge];
928 if (old_node_pt == 0)
930 Node* new_node_pt = 0;
931 if (edge.is_boundary_edge())
933 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
937 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
939 brick_edge_node_pt[edge] = new_node_pt;
940 Node_pt.push_back(new_node_pt);
942 Vector<double> s_tet(3);
943 Vector<double> x_tet(3);
944 el_pt->local_coordinate_of_node(j, s);
945 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
946 tet_el_pt->interpolated_x(s_tet, x_tet);
947 new_node_pt->x(0) = x_tet[0];
948 new_node_pt->x(1) = x_tet[1];
949 new_node_pt->x(2) = x_tet[2];
954 el_pt->node_pt(j) = old_node_pt;
964 Edge edge(el_pt->node_pt(24), el_pt->node_pt(26));
965 old_node_pt = brick_edge_node_pt[edge];
966 if (old_node_pt == 0)
968 Node* new_node_pt = 0;
969 if (edge.is_boundary_edge())
971 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
975 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
977 brick_edge_node_pt[edge] = new_node_pt;
978 Node_pt.push_back(new_node_pt);
980 Vector<double> s_tet(3);
981 Vector<double> x_tet(3);
982 el_pt->local_coordinate_of_node(j, s);
983 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
984 tet_el_pt->interpolated_x(s_tet, x_tet);
985 new_node_pt->x(0) = x_tet[0];
986 new_node_pt->x(1) = x_tet[1];
987 new_node_pt->x(2) = x_tet[2];
992 el_pt->node_pt(j) = old_node_pt;
1001 Edge edge(el_pt->node_pt(0), el_pt->node_pt(18));
1002 old_node_pt = brick_edge_node_pt[edge];
1003 if (old_node_pt == 0)
1005 Node* new_node_pt = 0;
1006 if (edge.is_boundary_edge())
1008 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1012 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1014 brick_edge_node_pt[edge] = new_node_pt;
1015 Node_pt.push_back(new_node_pt);
1016 Vector<double> s(3);
1017 Vector<double> s_tet(3);
1018 Vector<double> x_tet(3);
1019 el_pt->local_coordinate_of_node(j, s);
1020 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
1021 tet_el_pt->interpolated_x(s_tet, x_tet);
1022 new_node_pt->x(0) = x_tet[0];
1023 new_node_pt->x(1) = x_tet[1];
1024 new_node_pt->x(2) = x_tet[2];
1029 el_pt->node_pt(j) = old_node_pt;
1039 Edge edge(el_pt->node_pt(2), el_pt->node_pt(20));
1040 old_node_pt = brick_edge_node_pt[edge];
1041 if (old_node_pt == 0)
1043 Node* new_node_pt = 0;
1044 if (edge.is_boundary_edge())
1046 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1050 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1052 brick_edge_node_pt[edge] = new_node_pt;
1053 Node_pt.push_back(new_node_pt);
1054 Vector<double> s(3);
1055 Vector<double> s_tet(3);
1056 Vector<double> x_tet(3);
1057 el_pt->local_coordinate_of_node(j, s);
1058 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
1059 tet_el_pt->interpolated_x(s_tet, x_tet);
1060 new_node_pt->x(0) = x_tet[0];
1061 new_node_pt->x(1) = x_tet[1];
1062 new_node_pt->x(2) = x_tet[2];
1067 el_pt->node_pt(j) = old_node_pt;
1077 Edge edge(el_pt->node_pt(6), el_pt->node_pt(24));
1078 old_node_pt = brick_edge_node_pt[edge];
1079 if (old_node_pt == 0)
1081 Node* new_node_pt = 0;
1082 if (edge.is_boundary_edge())
1084 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1088 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1090 brick_edge_node_pt[edge] = new_node_pt;
1091 Node_pt.push_back(new_node_pt);
1092 Vector<double> s(3);
1093 Vector<double> s_tet(3);
1094 Vector<double> x_tet(3);
1095 el_pt->local_coordinate_of_node(j, s);
1096 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
1097 tet_el_pt->interpolated_x(s_tet, x_tet);
1098 new_node_pt->x(0) = x_tet[0];
1099 new_node_pt->x(1) = x_tet[1];
1100 new_node_pt->x(2) = x_tet[2];
1105 el_pt->node_pt(j) = old_node_pt;
1115 Edge edge(el_pt->node_pt(8), el_pt->node_pt(26));
1116 old_node_pt = brick_edge_node_pt[edge];
1117 if (old_node_pt == 0)
1119 Node* new_node_pt = 0;
1120 if (edge.is_boundary_edge())
1122 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1126 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1128 brick_edge_node_pt[edge] = new_node_pt;
1129 Node_pt.push_back(new_node_pt);
1130 Vector<double> s(3);
1131 Vector<double> s_tet(3);
1132 Vector<double> x_tet(3);
1133 el_pt->local_coordinate_of_node(j, s);
1134 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
1135 tet_el_pt->interpolated_x(s_tet, x_tet);
1136 new_node_pt->x(0) = x_tet[0];
1137 new_node_pt->x(1) = x_tet[1];
1138 new_node_pt->x(2) = x_tet[2];
1143 el_pt->node_pt(j) = old_node_pt;
1154 TFace face(tet_el_pt->node_pt(central_tet_vertex),
1155 tet_el_pt->node_pt(tet_edge_node[0][0]),
1156 tet_el_pt->node_pt(tet_edge_node[2][0]));
1158 old_node_pt = tet_face_node_pt[face];
1159 if (old_node_pt == 0)
1161 Node* new_node_pt = 0;
1162 if (face.is_boundary_face())
1164 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1168 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1170 tet_face_node_pt[face] = new_node_pt;
1171 Node_pt.push_back(new_node_pt);
1172 Vector<double> s(3);
1173 Vector<double> s_tet(3);
1174 Vector<double> x_tet(3);
1175 el_pt->local_coordinate_of_node(j, s);
1176 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
1177 tet_el_pt->interpolated_x(s_tet, x_tet);
1178 new_node_pt->x(0) = x_tet[0];
1179 new_node_pt->x(1) = x_tet[1];
1180 new_node_pt->x(2) = x_tet[2];
1185 el_pt->node_pt(j) = old_node_pt;
1196 TFace face(tet_el_pt->node_pt(central_tet_vertex),
1197 tet_el_pt->node_pt(tet_edge_node[1][0]),
1198 tet_el_pt->node_pt(tet_edge_node[2][0]));
1200 old_node_pt = tet_face_node_pt[face];
1201 if (old_node_pt == 0)
1203 Node* new_node_pt = 0;
1204 if (face.is_boundary_face())
1206 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1210 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1212 tet_face_node_pt[face] = new_node_pt;
1213 Node_pt.push_back(new_node_pt);
1214 Vector<double> s(3);
1215 Vector<double> s_tet(3);
1216 Vector<double> x_tet(3);
1217 el_pt->local_coordinate_of_node(j, s);
1218 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
1219 tet_el_pt->interpolated_x(s_tet, x_tet);
1220 new_node_pt->x(0) = x_tet[0];
1221 new_node_pt->x(1) = x_tet[1];
1222 new_node_pt->x(2) = x_tet[2];
1227 el_pt->node_pt(j) = old_node_pt;
1238 TFace face(tet_el_pt->node_pt(central_tet_vertex),
1239 tet_el_pt->node_pt(tet_edge_node[0][0]),
1240 tet_el_pt->node_pt(tet_edge_node[1][0]));
1242 old_node_pt = tet_face_node_pt[face];
1243 if (old_node_pt == 0)
1245 Node* new_node_pt = 0;
1246 if (face.is_boundary_face())
1248 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1252 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1254 tet_face_node_pt[face] = new_node_pt;
1255 Node_pt.push_back(new_node_pt);
1256 Vector<double> s(3);
1257 Vector<double> s_tet(3);
1258 Vector<double> x_tet(3);
1259 el_pt->local_coordinate_of_node(j, s);
1260 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
1261 tet_el_pt->interpolated_x(s_tet, x_tet);
1262 new_node_pt->x(0) = x_tet[0];
1263 new_node_pt->x(1) = x_tet[1];
1264 new_node_pt->x(2) = x_tet[2];
1269 el_pt->node_pt(j) = old_node_pt;
1277 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1278 Node_pt.push_back(new_node_pt);
1279 Vector<double> s(3);
1280 Vector<double> s_tet(3);
1281 Vector<double> x_tet(3);
1282 el_pt->local_coordinate_of_node(j, s);
1283 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
1284 top_mid_face_node0_pt = new_node_pt;
1285 tet_el_pt->interpolated_x(s_tet, x_tet);
1286 new_node_pt->x(0) = x_tet[0];
1287 new_node_pt->x(1) = x_tet[1];
1288 new_node_pt->x(2) = x_tet[2];
1295 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1296 Node_pt.push_back(new_node_pt);
1297 Vector<double> s(3);
1298 Vector<double> s_tet(3);
1299 Vector<double> x_tet(3);
1300 el_pt->local_coordinate_of_node(j, s);
1301 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
1302 right_mid_face_node0_pt = new_node_pt;
1303 tet_el_pt->interpolated_x(s_tet, x_tet);
1304 new_node_pt->x(0) = x_tet[0];
1305 new_node_pt->x(1) = x_tet[1];
1306 new_node_pt->x(2) = x_tet[2];
1313 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1314 Node_pt.push_back(new_node_pt);
1315 Vector<double> s(3);
1316 Vector<double> s_tet(3);
1317 Vector<double> x_tet(3);
1318 el_pt->local_coordinate_of_node(j, s);
1319 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
1320 back_mid_face_node0_pt = new_node_pt;
1321 tet_el_pt->interpolated_x(s_tet, x_tet);
1322 new_node_pt->x(0) = x_tet[0];
1323 new_node_pt->x(1) = x_tet[1];
1324 new_node_pt->x(2) = x_tet[2];
1333 for (
unsigned j = 0; j < 8; j++)
1335 Node* nod_pt = dummy_q_el_pt[1]->node_pt(j);
1336 Vector<double> s_tet(3);
1337 Vector<double> x_tet(3);
1341 tet_el_pt->local_coordinate_of_node(1, s_tet);
1342 nod_pt->set_value(0, s_tet[0]);
1343 nod_pt->set_value(1, s_tet[1]);
1344 nod_pt->set_value(2, s_tet[2]);
1345 tet_el_pt->interpolated_x(s_tet, x_tet);
1346 nod_pt->x(0) = x_tet[0];
1347 nod_pt->x(1) = x_tet[1];
1348 nod_pt->x(2) = x_tet[2];
1351 tet_el_pt->local_coordinate_of_node(9, s_tet);
1352 nod_pt->set_value(0, s_tet[0]);
1353 nod_pt->set_value(1, s_tet[1]);
1354 nod_pt->set_value(2, s_tet[2]);
1355 tet_el_pt->interpolated_x(s_tet, x_tet);
1356 nod_pt->x(0) = x_tet[0];
1357 nod_pt->x(1) = x_tet[1];
1358 nod_pt->x(2) = x_tet[2];
1361 tet_el_pt->local_coordinate_of_node(4, s_tet);
1362 nod_pt->set_value(0, s_tet[0]);
1363 nod_pt->set_value(1, s_tet[1]);
1364 nod_pt->set_value(2, s_tet[2]);
1365 tet_el_pt->interpolated_x(s_tet, x_tet);
1366 nod_pt->x(0) = x_tet[0];
1367 nod_pt->x(1) = x_tet[1];
1368 nod_pt->x(2) = x_tet[2];
1373 s_tet[0] = 1.0 / 3.0;
1374 s_tet[1] = 1.0 / 3.0;
1376 nod_pt->set_value(0, s_tet[0]);
1377 nod_pt->set_value(1, s_tet[1]);
1378 nod_pt->set_value(2, s_tet[2]);
1379 tet_el_pt->interpolated_x(s_tet, x_tet);
1380 nod_pt->x(0) = x_tet[0];
1381 nod_pt->x(1) = x_tet[1];
1382 nod_pt->x(2) = x_tet[2];
1385 tet_el_pt->local_coordinate_of_node(7, s_tet);
1386 nod_pt->set_value(0, s_tet[0]);
1387 nod_pt->set_value(1, s_tet[1]);
1388 nod_pt->set_value(2, s_tet[2]);
1389 tet_el_pt->interpolated_x(s_tet, x_tet);
1390 nod_pt->x(0) = x_tet[0];
1391 nod_pt->x(1) = x_tet[1];
1392 nod_pt->x(2) = x_tet[2];
1398 s_tet[1] = 1.0 / 3.0;
1399 s_tet[2] = 1.0 / 3.0;
1400 nod_pt->set_value(0, s_tet[0]);
1401 nod_pt->set_value(1, s_tet[1]);
1402 nod_pt->set_value(2, s_tet[2]);
1403 tet_el_pt->interpolated_x(s_tet, x_tet);
1404 nod_pt->x(0) = x_tet[0];
1405 nod_pt->x(1) = x_tet[1];
1406 nod_pt->x(2) = x_tet[2];
1411 s_tet[0] = 1.0 / 3.0;
1412 s_tet[1] = 1.0 / 3.0;
1413 s_tet[2] = 1.0 / 3.0;
1414 nod_pt->set_value(0, s_tet[0]);
1415 nod_pt->set_value(1, s_tet[1]);
1416 nod_pt->set_value(2, s_tet[2]);
1417 tet_el_pt->interpolated_x(s_tet, x_tet);
1418 nod_pt->x(0) = x_tet[0];
1419 nod_pt->x(1) = x_tet[1];
1420 nod_pt->x(2) = x_tet[2];
1427 nod_pt->set_value(0, s_tet[0]);
1428 nod_pt->set_value(1, s_tet[1]);
1429 nod_pt->set_value(2, s_tet[2]);
1430 tet_el_pt->interpolated_x(s_tet, x_tet);
1431 nod_pt->x(0) = x_tet[0];
1432 nod_pt->x(1) = x_tet[1];
1433 nod_pt->x(2) = x_tet[2];
1440 FiniteElement* el_pt =
new ELEMENT;
1441 brick_el1_pt = el_pt;
1442 Element_pt.push_back(el_pt);
1445 tet_el_pt->node_pt(1), tet_el_pt->node_pt(3), tet_el_pt->node_pt(2));
1448 tet_el_pt->node_pt(1), tet_el_pt->node_pt(0), tet_el_pt->node_pt(2));
1451 tet_el_pt->node_pt(1), tet_el_pt->node_pt(0), tet_el_pt->node_pt(3));
1454 Vector<Vector<unsigned>> tet_edge_node(3);
1455 tet_edge_node[0].resize(2);
1456 tet_edge_node[0][0] = 9;
1457 tet_edge_node[0][1] = 3;
1458 tet_edge_node[1].resize(2);
1459 tet_edge_node[1][0] = 4;
1460 tet_edge_node[1][1] = 0;
1461 tet_edge_node[2].resize(2);
1462 tet_edge_node[2][0] = 7;
1463 tet_edge_node[2][1] = 2;
1466 unsigned central_tet_vertex = 1;
1468 Node* tet_node_pt = 0;
1469 Node* old_node_pt = 0;
1476 tet_node_pt = tet_el_pt->node_pt(central_tet_vertex);
1477 old_node_pt = tet_node_node_pt[tet_node_pt];
1478 if (old_node_pt == 0)
1480 Node* new_node_pt = 0;
1481 if (tet_node_pt->is_on_boundary())
1483 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1487 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1489 tet_node_node_pt[tet_node_pt] = new_node_pt;
1490 Node_pt.push_back(new_node_pt);
1491 Vector<double> s(3);
1492 Vector<double> s_tet(3);
1493 Vector<double> x_tet(3);
1494 el_pt->local_coordinate_of_node(j, s);
1495 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
1496 tet_el_pt->interpolated_x(s_tet, x_tet);
1497 new_node_pt->x(0) = x_tet[0];
1498 new_node_pt->x(1) = x_tet[1];
1499 new_node_pt->x(2) = x_tet[2];
1504 el_pt->node_pt(j) = old_node_pt;
1514 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[0][0]);
1515 old_node_pt = tet_node_node_pt[tet_node_pt];
1516 if (old_node_pt == 0)
1518 Node* new_node_pt = 0;
1519 if (tet_node_pt->is_on_boundary())
1521 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1525 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1527 tet_node_node_pt[tet_node_pt] = new_node_pt;
1528 Node_pt.push_back(new_node_pt);
1529 Vector<double> s(3);
1530 Vector<double> s_tet(3);
1531 Vector<double> x_tet(3);
1532 el_pt->local_coordinate_of_node(j, s);
1533 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
1534 tet_el_pt->interpolated_x(s_tet, x_tet);
1535 new_node_pt->x(0) = x_tet[0];
1536 new_node_pt->x(1) = x_tet[1];
1537 new_node_pt->x(2) = x_tet[2];
1542 el_pt->node_pt(j) = old_node_pt;
1552 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[1][0]);
1553 old_node_pt = tet_node_node_pt[tet_node_pt];
1554 if (old_node_pt == 0)
1556 Node* new_node_pt = 0;
1557 if (tet_node_pt->is_on_boundary())
1559 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1563 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1565 tet_node_node_pt[tet_node_pt] = new_node_pt;
1566 Node_pt.push_back(new_node_pt);
1567 Vector<double> s(3);
1568 Vector<double> s_tet(3);
1569 Vector<double> x_tet(3);
1570 el_pt->local_coordinate_of_node(j, s);
1571 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
1572 tet_el_pt->interpolated_x(s_tet, x_tet);
1573 new_node_pt->x(0) = x_tet[0];
1574 new_node_pt->x(1) = x_tet[1];
1575 new_node_pt->x(2) = x_tet[2];
1580 el_pt->node_pt(j) = old_node_pt;
1590 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[2][0]);
1591 old_node_pt = tet_node_node_pt[tet_node_pt];
1592 if (old_node_pt == 0)
1594 Node* new_node_pt = 0;
1595 if (tet_node_pt->is_on_boundary())
1597 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1601 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1603 tet_node_node_pt[tet_node_pt] = new_node_pt;
1604 Node_pt.push_back(new_node_pt);
1605 Vector<double> s(3);
1606 Vector<double> s_tet(3);
1607 Vector<double> x_tet(3);
1608 el_pt->local_coordinate_of_node(j, s);
1609 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
1610 tet_el_pt->interpolated_x(s_tet, x_tet);
1611 new_node_pt->x(0) = x_tet[0];
1612 new_node_pt->x(1) = x_tet[1];
1613 new_node_pt->x(2) = x_tet[2];
1618 el_pt->node_pt(j) = old_node_pt;
1628 old_node_pt = tet_face_node_pt[face0];
1629 if (old_node_pt == 0)
1631 Node* new_node_pt = 0;
1632 if (face0.is_boundary_face())
1634 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1638 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1640 tet_face_node_pt[face0] = new_node_pt;
1641 Node_pt.push_back(new_node_pt);
1642 Vector<double> s(3);
1643 Vector<double> s_tet(3);
1644 Vector<double> x_tet(3);
1645 el_pt->local_coordinate_of_node(j, s);
1646 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
1647 tet_el_pt->interpolated_x(s_tet, x_tet);
1648 new_node_pt->x(0) = x_tet[0];
1649 new_node_pt->x(1) = x_tet[1];
1650 new_node_pt->x(2) = x_tet[2];
1655 el_pt->node_pt(j) = old_node_pt;
1664 old_node_pt = tet_face_node_pt[face1];
1665 if (old_node_pt == 0)
1667 Node* new_node_pt = 0;
1668 if (face1.is_boundary_face())
1670 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1674 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1676 tet_face_node_pt[face1] = new_node_pt;
1677 Node_pt.push_back(new_node_pt);
1678 Vector<double> s(3);
1679 Vector<double> s_tet(3);
1680 Vector<double> x_tet(3);
1681 el_pt->local_coordinate_of_node(j, s);
1682 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
1683 tet_el_pt->interpolated_x(s_tet, x_tet);
1684 new_node_pt->x(0) = x_tet[0];
1685 new_node_pt->x(1) = x_tet[1];
1686 new_node_pt->x(2) = x_tet[2];
1691 el_pt->node_pt(j) = old_node_pt;
1700 old_node_pt = tet_face_node_pt[face2];
1701 if (old_node_pt == 0)
1703 Node* new_node_pt = 0;
1704 if (face2.is_boundary_face())
1706 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1710 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1712 tet_face_node_pt[face2] = new_node_pt;
1713 Node_pt.push_back(new_node_pt);
1714 Vector<double> s(3);
1715 Vector<double> s_tet(3);
1716 Vector<double> x_tet(3);
1717 el_pt->local_coordinate_of_node(j, s);
1718 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
1719 tet_el_pt->interpolated_x(s_tet, x_tet);
1720 new_node_pt->x(0) = x_tet[0];
1721 new_node_pt->x(1) = x_tet[1];
1722 new_node_pt->x(2) = x_tet[2];
1727 el_pt->node_pt(j) = old_node_pt;
1738 el_pt->node_pt(j) = centroid_node_pt;
1748 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1749 Node_pt.push_back(new_node_pt);
1750 Vector<double> s(3);
1751 Vector<double> s_tet(3);
1752 Vector<double> x_tet(3);
1753 el_pt->local_coordinate_of_node(j, s);
1754 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
1755 tet_el_pt->interpolated_x(s_tet, x_tet);
1756 new_node_pt->x(0) = x_tet[0];
1757 new_node_pt->x(1) = x_tet[1];
1758 new_node_pt->x(2) = x_tet[2];
1768 Edge edge(el_pt->node_pt(0), el_pt->node_pt(2));
1769 old_node_pt = brick_edge_node_pt[edge];
1770 if (old_node_pt == 0)
1772 Node* new_node_pt = 0;
1773 if (edge.is_boundary_edge())
1775 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1779 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1781 brick_edge_node_pt[edge] = new_node_pt;
1782 Node_pt.push_back(new_node_pt);
1783 Vector<double> s(3);
1784 Vector<double> s_tet(3);
1785 Vector<double> x_tet(3);
1786 el_pt->local_coordinate_of_node(j, s);
1787 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
1788 tet_el_pt->interpolated_x(s_tet, x_tet);
1789 new_node_pt->x(0) = x_tet[0];
1790 new_node_pt->x(1) = x_tet[1];
1791 new_node_pt->x(2) = x_tet[2];
1796 el_pt->node_pt(j) = old_node_pt;
1806 Edge edge(el_pt->node_pt(0), el_pt->node_pt(6));
1807 old_node_pt = brick_edge_node_pt[edge];
1808 if (old_node_pt == 0)
1810 Node* new_node_pt = 0;
1811 if (edge.is_boundary_edge())
1813 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1817 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1819 brick_edge_node_pt[edge] = new_node_pt;
1820 Node_pt.push_back(new_node_pt);
1821 Vector<double> s(3);
1822 Vector<double> s_tet(3);
1823 Vector<double> x_tet(3);
1824 el_pt->local_coordinate_of_node(j, s);
1825 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
1826 tet_el_pt->interpolated_x(s_tet, x_tet);
1827 new_node_pt->x(0) = x_tet[0];
1828 new_node_pt->x(1) = x_tet[1];
1829 new_node_pt->x(2) = x_tet[2];
1834 el_pt->node_pt(j) = old_node_pt;
1844 Edge edge(el_pt->node_pt(2), el_pt->node_pt(8));
1845 old_node_pt = brick_edge_node_pt[edge];
1846 if (old_node_pt == 0)
1848 Node* new_node_pt = 0;
1849 if (edge.is_boundary_edge())
1851 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1855 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1857 brick_edge_node_pt[edge] = new_node_pt;
1858 Node_pt.push_back(new_node_pt);
1859 Vector<double> s(3);
1860 Vector<double> s_tet(3);
1861 Vector<double> x_tet(3);
1862 el_pt->local_coordinate_of_node(j, s);
1863 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
1864 tet_el_pt->interpolated_x(s_tet, x_tet);
1865 new_node_pt->x(0) = x_tet[0];
1866 new_node_pt->x(1) = x_tet[1];
1867 new_node_pt->x(2) = x_tet[2];
1872 el_pt->node_pt(j) = old_node_pt;
1881 Edge edge(el_pt->node_pt(6), el_pt->node_pt(8));
1882 old_node_pt = brick_edge_node_pt[edge];
1883 if (old_node_pt == 0)
1885 Node* new_node_pt = 0;
1886 if (edge.is_boundary_edge())
1888 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1892 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1894 brick_edge_node_pt[edge] = new_node_pt;
1895 Node_pt.push_back(new_node_pt);
1896 Vector<double> s(3);
1897 Vector<double> s_tet(3);
1898 Vector<double> x_tet(3);
1899 el_pt->local_coordinate_of_node(j, s);
1900 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
1901 tet_el_pt->interpolated_x(s_tet, x_tet);
1902 new_node_pt->x(0) = x_tet[0];
1903 new_node_pt->x(1) = x_tet[1];
1904 new_node_pt->x(2) = x_tet[2];
1909 el_pt->node_pt(j) = old_node_pt;
1918 Edge edge(el_pt->node_pt(18), el_pt->node_pt(20));
1919 old_node_pt = brick_edge_node_pt[edge];
1920 if (old_node_pt == 0)
1922 Node* new_node_pt = 0;
1923 if (edge.is_boundary_edge())
1925 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1929 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1931 brick_edge_node_pt[edge] = new_node_pt;
1932 Node_pt.push_back(new_node_pt);
1933 Vector<double> s(3);
1934 Vector<double> s_tet(3);
1935 Vector<double> x_tet(3);
1936 el_pt->local_coordinate_of_node(j, s);
1937 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
1938 tet_el_pt->interpolated_x(s_tet, x_tet);
1939 new_node_pt->x(0) = x_tet[0];
1940 new_node_pt->x(1) = x_tet[1];
1941 new_node_pt->x(2) = x_tet[2];
1946 el_pt->node_pt(j) = old_node_pt;
1956 Edge edge(el_pt->node_pt(18), el_pt->node_pt(24));
1957 old_node_pt = brick_edge_node_pt[edge];
1958 if (old_node_pt == 0)
1960 Node* new_node_pt = 0;
1961 if (edge.is_boundary_edge())
1963 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
1967 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
1969 brick_edge_node_pt[edge] = new_node_pt;
1970 Node_pt.push_back(new_node_pt);
1971 Vector<double> s(3);
1972 Vector<double> s_tet(3);
1973 Vector<double> x_tet(3);
1974 el_pt->local_coordinate_of_node(j, s);
1975 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
1976 tet_el_pt->interpolated_x(s_tet, x_tet);
1977 new_node_pt->x(0) = x_tet[0];
1978 new_node_pt->x(1) = x_tet[1];
1979 new_node_pt->x(2) = x_tet[2];
1984 el_pt->node_pt(j) = old_node_pt;
1993 Edge edge(el_pt->node_pt(20), el_pt->node_pt(26));
1994 old_node_pt = brick_edge_node_pt[edge];
1995 if (old_node_pt == 0)
1997 Node* new_node_pt = 0;
1998 if (edge.is_boundary_edge())
2000 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2004 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2006 brick_edge_node_pt[edge] = new_node_pt;
2007 Node_pt.push_back(new_node_pt);
2008 Vector<double> s(3);
2009 Vector<double> s_tet(3);
2010 Vector<double> x_tet(3);
2011 el_pt->local_coordinate_of_node(j, s);
2012 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
2013 tet_el_pt->interpolated_x(s_tet, x_tet);
2014 new_node_pt->x(0) = x_tet[0];
2015 new_node_pt->x(1) = x_tet[1];
2016 new_node_pt->x(2) = x_tet[2];
2021 el_pt->node_pt(j) = old_node_pt;
2031 Edge edge(el_pt->node_pt(24), el_pt->node_pt(26));
2032 old_node_pt = brick_edge_node_pt[edge];
2033 if (old_node_pt == 0)
2035 Node* new_node_pt = 0;
2036 if (edge.is_boundary_edge())
2038 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2042 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2044 brick_edge_node_pt[edge] = new_node_pt;
2045 Node_pt.push_back(new_node_pt);
2046 Vector<double> s(3);
2047 Vector<double> s_tet(3);
2048 Vector<double> x_tet(3);
2049 el_pt->local_coordinate_of_node(j, s);
2050 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
2051 tet_el_pt->interpolated_x(s_tet, x_tet);
2052 new_node_pt->x(0) = x_tet[0];
2053 new_node_pt->x(1) = x_tet[1];
2054 new_node_pt->x(2) = x_tet[2];
2059 el_pt->node_pt(j) = old_node_pt;
2068 Edge edge(el_pt->node_pt(0), el_pt->node_pt(18));
2069 old_node_pt = brick_edge_node_pt[edge];
2070 if (old_node_pt == 0)
2072 Node* new_node_pt = 0;
2073 if (edge.is_boundary_edge())
2075 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2079 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2081 brick_edge_node_pt[edge] = new_node_pt;
2082 Node_pt.push_back(new_node_pt);
2083 Vector<double> s(3);
2084 Vector<double> s_tet(3);
2085 Vector<double> x_tet(3);
2086 el_pt->local_coordinate_of_node(j, s);
2087 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
2088 tet_el_pt->interpolated_x(s_tet, x_tet);
2089 new_node_pt->x(0) = x_tet[0];
2090 new_node_pt->x(1) = x_tet[1];
2091 new_node_pt->x(2) = x_tet[2];
2096 el_pt->node_pt(j) = old_node_pt;
2106 Edge edge(el_pt->node_pt(2), el_pt->node_pt(20));
2107 old_node_pt = brick_edge_node_pt[edge];
2108 if (old_node_pt == 0)
2110 Node* new_node_pt = 0;
2111 if (edge.is_boundary_edge())
2113 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2117 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2119 brick_edge_node_pt[edge] = new_node_pt;
2120 Node_pt.push_back(new_node_pt);
2121 Vector<double> s(3);
2122 Vector<double> s_tet(3);
2123 Vector<double> x_tet(3);
2124 el_pt->local_coordinate_of_node(j, s);
2125 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
2126 tet_el_pt->interpolated_x(s_tet, x_tet);
2127 new_node_pt->x(0) = x_tet[0];
2128 new_node_pt->x(1) = x_tet[1];
2129 new_node_pt->x(2) = x_tet[2];
2134 el_pt->node_pt(j) = old_node_pt;
2144 Edge edge(el_pt->node_pt(6), el_pt->node_pt(24));
2145 old_node_pt = brick_edge_node_pt[edge];
2146 if (old_node_pt == 0)
2148 Node* new_node_pt = 0;
2149 if (edge.is_boundary_edge())
2151 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2155 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2157 brick_edge_node_pt[edge] = new_node_pt;
2158 Node_pt.push_back(new_node_pt);
2159 Vector<double> s(3);
2160 Vector<double> s_tet(3);
2161 Vector<double> x_tet(3);
2162 el_pt->local_coordinate_of_node(j, s);
2163 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
2164 tet_el_pt->interpolated_x(s_tet, x_tet);
2165 new_node_pt->x(0) = x_tet[0];
2166 new_node_pt->x(1) = x_tet[1];
2167 new_node_pt->x(2) = x_tet[2];
2172 el_pt->node_pt(j) = old_node_pt;
2182 Edge edge(el_pt->node_pt(8), el_pt->node_pt(26));
2183 old_node_pt = brick_edge_node_pt[edge];
2184 if (old_node_pt == 0)
2186 Node* new_node_pt = 0;
2187 if (edge.is_boundary_edge())
2189 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2193 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2195 brick_edge_node_pt[edge] = new_node_pt;
2196 Node_pt.push_back(new_node_pt);
2197 Vector<double> s(3);
2198 Vector<double> s_tet(3);
2199 Vector<double> x_tet(3);
2200 el_pt->local_coordinate_of_node(j, s);
2201 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
2202 tet_el_pt->interpolated_x(s_tet, x_tet);
2203 new_node_pt->x(0) = x_tet[0];
2204 new_node_pt->x(1) = x_tet[1];
2205 new_node_pt->x(2) = x_tet[2];
2210 el_pt->node_pt(j) = old_node_pt;
2221 TFace face(tet_el_pt->node_pt(central_tet_vertex),
2222 tet_el_pt->node_pt(tet_edge_node[0][0]),
2223 tet_el_pt->node_pt(tet_edge_node[2][0]));
2225 old_node_pt = tet_face_node_pt[face];
2226 if (old_node_pt == 0)
2228 Node* new_node_pt = 0;
2229 if (face.is_boundary_face())
2231 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2235 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2237 tet_face_node_pt[face] = new_node_pt;
2238 Node_pt.push_back(new_node_pt);
2239 Vector<double> s(3);
2240 Vector<double> s_tet(3);
2241 Vector<double> x_tet(3);
2242 el_pt->local_coordinate_of_node(j, s);
2243 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
2244 tet_el_pt->interpolated_x(s_tet, x_tet);
2245 new_node_pt->x(0) = x_tet[0];
2246 new_node_pt->x(1) = x_tet[1];
2247 new_node_pt->x(2) = x_tet[2];
2252 el_pt->node_pt(j) = old_node_pt;
2263 TFace face(tet_el_pt->node_pt(central_tet_vertex),
2264 tet_el_pt->node_pt(tet_edge_node[1][0]),
2265 tet_el_pt->node_pt(tet_edge_node[2][0]));
2267 old_node_pt = tet_face_node_pt[face];
2268 if (old_node_pt == 0)
2270 Node* new_node_pt = 0;
2271 if (face.is_boundary_face())
2273 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2277 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2279 tet_face_node_pt[face] = new_node_pt;
2280 Node_pt.push_back(new_node_pt);
2281 Vector<double> s(3);
2282 Vector<double> s_tet(3);
2283 Vector<double> x_tet(3);
2284 el_pt->local_coordinate_of_node(j, s);
2285 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
2286 tet_el_pt->interpolated_x(s_tet, x_tet);
2287 new_node_pt->x(0) = x_tet[0];
2288 new_node_pt->x(1) = x_tet[1];
2289 new_node_pt->x(2) = x_tet[2];
2294 el_pt->node_pt(j) = old_node_pt;
2305 TFace face(tet_el_pt->node_pt(central_tet_vertex),
2306 tet_el_pt->node_pt(tet_edge_node[0][0]),
2307 tet_el_pt->node_pt(tet_edge_node[1][0]));
2309 old_node_pt = tet_face_node_pt[face];
2310 if (old_node_pt == 0)
2312 Node* new_node_pt = 0;
2313 if (face.is_boundary_face())
2315 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2319 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2321 tet_face_node_pt[face] = new_node_pt;
2322 Node_pt.push_back(new_node_pt);
2323 Vector<double> s(3);
2324 Vector<double> s_tet(3);
2325 Vector<double> x_tet(3);
2326 el_pt->local_coordinate_of_node(j, s);
2327 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
2328 tet_el_pt->interpolated_x(s_tet, x_tet);
2329 new_node_pt->x(0) = x_tet[0];
2330 new_node_pt->x(1) = x_tet[1];
2331 new_node_pt->x(2) = x_tet[2];
2336 el_pt->node_pt(j) = old_node_pt;
2344 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2345 Node_pt.push_back(new_node_pt);
2346 Vector<double> s(3);
2347 Vector<double> s_tet(3);
2348 Vector<double> x_tet(3);
2349 el_pt->local_coordinate_of_node(j, s);
2350 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
2351 top_mid_face_node1_pt = new_node_pt;
2352 tet_el_pt->interpolated_x(s_tet, x_tet);
2353 new_node_pt->x(0) = x_tet[0];
2354 new_node_pt->x(1) = x_tet[1];
2355 new_node_pt->x(2) = x_tet[2];
2362 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2363 Node_pt.push_back(new_node_pt);
2364 Vector<double> s(3);
2365 Vector<double> s_tet(3);
2366 Vector<double> x_tet(3);
2367 el_pt->local_coordinate_of_node(j, s);
2368 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
2369 right_mid_face_node1_pt = new_node_pt;
2370 tet_el_pt->interpolated_x(s_tet, x_tet);
2371 new_node_pt->x(0) = x_tet[0];
2372 new_node_pt->x(1) = x_tet[1];
2373 new_node_pt->x(2) = x_tet[2];
2382 el_pt->node_pt(j) = right_mid_face_node0_pt;
2391 for (
unsigned j = 0; j < 8; j++)
2393 Node* nod_pt = dummy_q_el_pt[2]->node_pt(j);
2394 Vector<double> s_tet(3);
2395 Vector<double> x_tet(3);
2399 tet_el_pt->local_coordinate_of_node(3, s_tet);
2400 nod_pt->set_value(0, s_tet[0]);
2401 nod_pt->set_value(1, s_tet[1]);
2402 nod_pt->set_value(2, s_tet[2]);
2403 tet_el_pt->interpolated_x(s_tet, x_tet);
2404 nod_pt->x(0) = x_tet[0];
2405 nod_pt->x(1) = x_tet[1];
2406 nod_pt->x(2) = x_tet[2];
2409 tet_el_pt->local_coordinate_of_node(6, s_tet);
2410 nod_pt->set_value(0, s_tet[0]);
2411 nod_pt->set_value(1, s_tet[1]);
2412 nod_pt->set_value(2, s_tet[2]);
2413 tet_el_pt->interpolated_x(s_tet, x_tet);
2414 nod_pt->x(0) = x_tet[0];
2415 nod_pt->x(1) = x_tet[1];
2416 nod_pt->x(2) = x_tet[2];
2419 tet_el_pt->local_coordinate_of_node(9, s_tet);
2420 nod_pt->set_value(0, s_tet[0]);
2421 nod_pt->set_value(1, s_tet[1]);
2422 nod_pt->set_value(2, s_tet[2]);
2423 tet_el_pt->interpolated_x(s_tet, x_tet);
2424 nod_pt->x(0) = x_tet[0];
2425 nod_pt->x(1) = x_tet[1];
2426 nod_pt->x(2) = x_tet[2];
2431 s_tet[0] = 1.0 / 3.0;
2432 s_tet[1] = 1.0 / 3.0;
2434 nod_pt->set_value(0, s_tet[0]);
2435 nod_pt->set_value(1, s_tet[1]);
2436 nod_pt->set_value(2, s_tet[2]);
2437 tet_el_pt->interpolated_x(s_tet, x_tet);
2438 nod_pt->x(0) = x_tet[0];
2439 nod_pt->x(1) = x_tet[1];
2440 nod_pt->x(2) = x_tet[2];
2443 tet_el_pt->local_coordinate_of_node(8, s_tet);
2444 nod_pt->set_value(0, s_tet[0]);
2445 nod_pt->set_value(1, s_tet[1]);
2446 nod_pt->set_value(2, s_tet[2]);
2447 tet_el_pt->interpolated_x(s_tet, x_tet);
2448 nod_pt->x(0) = x_tet[0];
2449 nod_pt->x(1) = x_tet[1];
2450 nod_pt->x(2) = x_tet[2];
2455 s_tet[0] = 1.0 / 3.0;
2457 s_tet[2] = 1.0 / 3.0;
2458 nod_pt->set_value(0, s_tet[0]);
2459 nod_pt->set_value(1, s_tet[1]);
2460 nod_pt->set_value(2, s_tet[2]);
2461 tet_el_pt->interpolated_x(s_tet, x_tet);
2462 nod_pt->x(0) = x_tet[0];
2463 nod_pt->x(1) = x_tet[1];
2464 nod_pt->x(2) = x_tet[2];
2470 s_tet[1] = 1.0 / 3.0;
2471 s_tet[2] = 1.0 / 3.0;
2472 nod_pt->set_value(0, s_tet[0]);
2473 nod_pt->set_value(1, s_tet[1]);
2474 nod_pt->set_value(2, s_tet[2]);
2475 tet_el_pt->interpolated_x(s_tet, x_tet);
2476 nod_pt->x(0) = x_tet[0];
2477 nod_pt->x(1) = x_tet[1];
2478 nod_pt->x(2) = x_tet[2];
2485 nod_pt->set_value(0, s_tet[0]);
2486 nod_pt->set_value(1, s_tet[1]);
2487 nod_pt->set_value(2, s_tet[2]);
2488 tet_el_pt->interpolated_x(s_tet, x_tet);
2489 nod_pt->x(0) = x_tet[0];
2490 nod_pt->x(1) = x_tet[1];
2491 nod_pt->x(2) = x_tet[2];
2498 FiniteElement* el_pt =
new ELEMENT;
2499 brick_el2_pt = el_pt;
2500 Element_pt.push_back(el_pt);
2503 tet_el_pt->node_pt(3), tet_el_pt->node_pt(0), tet_el_pt->node_pt(2));
2506 tet_el_pt->node_pt(3), tet_el_pt->node_pt(1), tet_el_pt->node_pt(2));
2509 tet_el_pt->node_pt(3), tet_el_pt->node_pt(1), tet_el_pt->node_pt(0));
2512 Vector<Vector<unsigned>> tet_edge_node(3);
2513 tet_edge_node[0].resize(2);
2514 tet_edge_node[0][0] = 6;
2515 tet_edge_node[0][1] = 0;
2516 tet_edge_node[1].resize(2);
2517 tet_edge_node[1][0] = 9;
2518 tet_edge_node[1][1] = 1;
2519 tet_edge_node[2].resize(2);
2520 tet_edge_node[2][0] = 8;
2521 tet_edge_node[2][1] = 2;
2524 unsigned central_tet_vertex = 3;
2526 Node* tet_node_pt = 0;
2527 Node* old_node_pt = 0;
2534 tet_node_pt = tet_el_pt->node_pt(central_tet_vertex);
2535 old_node_pt = tet_node_node_pt[tet_node_pt];
2536 if (old_node_pt == 0)
2538 Node* new_node_pt = 0;
2539 if (tet_node_pt->is_on_boundary())
2541 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2545 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2547 tet_node_node_pt[tet_node_pt] = new_node_pt;
2548 Node_pt.push_back(new_node_pt);
2549 Vector<double> s(3);
2550 Vector<double> s_tet(3);
2551 Vector<double> x_tet(3);
2552 el_pt->local_coordinate_of_node(j, s);
2553 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
2554 tet_el_pt->interpolated_x(s_tet, x_tet);
2555 new_node_pt->x(0) = x_tet[0];
2556 new_node_pt->x(1) = x_tet[1];
2557 new_node_pt->x(2) = x_tet[2];
2562 el_pt->node_pt(j) = old_node_pt;
2572 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[0][0]);
2573 old_node_pt = tet_node_node_pt[tet_node_pt];
2574 if (old_node_pt == 0)
2576 Node* new_node_pt = 0;
2577 if (tet_node_pt->is_on_boundary())
2579 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2583 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2585 tet_node_node_pt[tet_node_pt] = new_node_pt;
2586 Node_pt.push_back(new_node_pt);
2587 Vector<double> s(3);
2588 Vector<double> s_tet(3);
2589 Vector<double> x_tet(3);
2590 el_pt->local_coordinate_of_node(j, s);
2591 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
2592 tet_el_pt->interpolated_x(s_tet, x_tet);
2593 new_node_pt->x(0) = x_tet[0];
2594 new_node_pt->x(1) = x_tet[1];
2595 new_node_pt->x(2) = x_tet[2];
2600 el_pt->node_pt(j) = old_node_pt;
2610 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[1][0]);
2611 old_node_pt = tet_node_node_pt[tet_node_pt];
2612 if (old_node_pt == 0)
2614 Node* new_node_pt = 0;
2615 if (tet_node_pt->is_on_boundary())
2617 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2621 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2623 tet_node_node_pt[tet_node_pt] = new_node_pt;
2624 Node_pt.push_back(new_node_pt);
2625 Vector<double> s(3);
2626 Vector<double> s_tet(3);
2627 Vector<double> x_tet(3);
2628 el_pt->local_coordinate_of_node(j, s);
2629 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
2630 tet_el_pt->interpolated_x(s_tet, x_tet);
2631 new_node_pt->x(0) = x_tet[0];
2632 new_node_pt->x(1) = x_tet[1];
2633 new_node_pt->x(2) = x_tet[2];
2638 el_pt->node_pt(j) = old_node_pt;
2648 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[2][0]);
2649 old_node_pt = tet_node_node_pt[tet_node_pt];
2650 if (old_node_pt == 0)
2652 Node* new_node_pt = 0;
2653 if (tet_node_pt->is_on_boundary())
2655 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2659 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2661 tet_node_node_pt[tet_node_pt] = new_node_pt;
2662 Node_pt.push_back(new_node_pt);
2663 Vector<double> s(3);
2664 Vector<double> s_tet(3);
2665 Vector<double> x_tet(3);
2666 el_pt->local_coordinate_of_node(j, s);
2667 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
2668 tet_el_pt->interpolated_x(s_tet, x_tet);
2669 new_node_pt->x(0) = x_tet[0];
2670 new_node_pt->x(1) = x_tet[1];
2671 new_node_pt->x(2) = x_tet[2];
2676 el_pt->node_pt(j) = old_node_pt;
2686 old_node_pt = tet_face_node_pt[face0];
2687 if (old_node_pt == 0)
2689 Node* new_node_pt = 0;
2690 if (face0.is_boundary_face())
2692 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2696 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2698 tet_face_node_pt[face0] = new_node_pt;
2699 Node_pt.push_back(new_node_pt);
2700 Vector<double> s(3);
2701 Vector<double> s_tet(3);
2702 Vector<double> x_tet(3);
2703 el_pt->local_coordinate_of_node(j, s);
2704 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
2705 tet_el_pt->interpolated_x(s_tet, x_tet);
2706 new_node_pt->x(0) = x_tet[0];
2707 new_node_pt->x(1) = x_tet[1];
2708 new_node_pt->x(2) = x_tet[2];
2713 el_pt->node_pt(j) = old_node_pt;
2722 old_node_pt = tet_face_node_pt[face1];
2723 if (old_node_pt == 0)
2725 Node* new_node_pt = 0;
2726 if (face1.is_boundary_face())
2728 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2732 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2734 tet_face_node_pt[face1] = new_node_pt;
2735 Node_pt.push_back(new_node_pt);
2736 Vector<double> s(3);
2737 Vector<double> s_tet(3);
2738 Vector<double> x_tet(3);
2739 el_pt->local_coordinate_of_node(j, s);
2740 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
2741 tet_el_pt->interpolated_x(s_tet, x_tet);
2742 new_node_pt->x(0) = x_tet[0];
2743 new_node_pt->x(1) = x_tet[1];
2744 new_node_pt->x(2) = x_tet[2];
2749 el_pt->node_pt(j) = old_node_pt;
2758 old_node_pt = tet_face_node_pt[face2];
2759 if (old_node_pt == 0)
2761 Node* new_node_pt = 0;
2762 if (face2.is_boundary_face())
2764 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2768 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2770 tet_face_node_pt[face2] = new_node_pt;
2771 Node_pt.push_back(new_node_pt);
2772 Vector<double> s(3);
2773 Vector<double> s_tet(3);
2774 Vector<double> x_tet(3);
2775 el_pt->local_coordinate_of_node(j, s);
2776 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
2777 tet_el_pt->interpolated_x(s_tet, x_tet);
2778 new_node_pt->x(0) = x_tet[0];
2779 new_node_pt->x(1) = x_tet[1];
2780 new_node_pt->x(2) = x_tet[2];
2785 el_pt->node_pt(j) = old_node_pt;
2796 el_pt->node_pt(j) = centroid_node_pt;
2806 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2807 Node_pt.push_back(new_node_pt);
2808 Vector<double> s(3);
2809 Vector<double> s_tet(3);
2810 Vector<double> x_tet(3);
2811 el_pt->local_coordinate_of_node(j, s);
2812 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
2813 tet_el_pt->interpolated_x(s_tet, x_tet);
2814 new_node_pt->x(0) = x_tet[0];
2815 new_node_pt->x(1) = x_tet[1];
2816 new_node_pt->x(2) = x_tet[2];
2825 Edge edge(el_pt->node_pt(0), el_pt->node_pt(2));
2826 old_node_pt = brick_edge_node_pt[edge];
2827 if (old_node_pt == 0)
2829 Node* new_node_pt = 0;
2830 if (edge.is_boundary_edge())
2832 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2836 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2838 brick_edge_node_pt[edge] = new_node_pt;
2839 Node_pt.push_back(new_node_pt);
2840 Vector<double> s(3);
2841 Vector<double> s_tet(3);
2842 Vector<double> x_tet(3);
2843 el_pt->local_coordinate_of_node(j, s);
2844 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
2845 tet_el_pt->interpolated_x(s_tet, x_tet);
2846 new_node_pt->x(0) = x_tet[0];
2847 new_node_pt->x(1) = x_tet[1];
2848 new_node_pt->x(2) = x_tet[2];
2853 el_pt->node_pt(j) = old_node_pt;
2863 Edge edge(el_pt->node_pt(0), el_pt->node_pt(6));
2864 old_node_pt = brick_edge_node_pt[edge];
2865 if (old_node_pt == 0)
2867 Node* new_node_pt = 0;
2868 if (edge.is_boundary_edge())
2870 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2874 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2876 brick_edge_node_pt[edge] = new_node_pt;
2877 Node_pt.push_back(new_node_pt);
2878 Vector<double> s(3);
2879 Vector<double> s_tet(3);
2880 Vector<double> x_tet(3);
2881 el_pt->local_coordinate_of_node(j, s);
2882 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
2883 tet_el_pt->interpolated_x(s_tet, x_tet);
2884 new_node_pt->x(0) = x_tet[0];
2885 new_node_pt->x(1) = x_tet[1];
2886 new_node_pt->x(2) = x_tet[2];
2891 el_pt->node_pt(j) = old_node_pt;
2900 Edge edge(el_pt->node_pt(2), el_pt->node_pt(8));
2901 old_node_pt = brick_edge_node_pt[edge];
2902 if (old_node_pt == 0)
2904 Node* new_node_pt = 0;
2905 if (edge.is_boundary_edge())
2907 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2911 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2913 brick_edge_node_pt[edge] = new_node_pt;
2914 Node_pt.push_back(new_node_pt);
2915 Vector<double> s(3);
2916 Vector<double> s_tet(3);
2917 Vector<double> x_tet(3);
2918 el_pt->local_coordinate_of_node(j, s);
2919 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
2920 tet_el_pt->interpolated_x(s_tet, x_tet);
2921 new_node_pt->x(0) = x_tet[0];
2922 new_node_pt->x(1) = x_tet[1];
2923 new_node_pt->x(2) = x_tet[2];
2928 el_pt->node_pt(j) = old_node_pt;
2937 Edge edge(el_pt->node_pt(6), el_pt->node_pt(8));
2938 old_node_pt = brick_edge_node_pt[edge];
2939 if (old_node_pt == 0)
2941 Node* new_node_pt = 0;
2942 if (edge.is_boundary_edge())
2944 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2948 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2950 brick_edge_node_pt[edge] = new_node_pt;
2951 Node_pt.push_back(new_node_pt);
2952 Vector<double> s(3);
2953 Vector<double> s_tet(3);
2954 Vector<double> x_tet(3);
2955 el_pt->local_coordinate_of_node(j, s);
2956 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
2957 tet_el_pt->interpolated_x(s_tet, x_tet);
2958 new_node_pt->x(0) = x_tet[0];
2959 new_node_pt->x(1) = x_tet[1];
2960 new_node_pt->x(2) = x_tet[2];
2965 el_pt->node_pt(j) = old_node_pt;
2974 Edge edge(el_pt->node_pt(18), el_pt->node_pt(20));
2975 old_node_pt = brick_edge_node_pt[edge];
2976 if (old_node_pt == 0)
2978 Node* new_node_pt = 0;
2979 if (edge.is_boundary_edge())
2981 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
2985 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
2987 brick_edge_node_pt[edge] = new_node_pt;
2988 Node_pt.push_back(new_node_pt);
2989 Vector<double> s(3);
2990 Vector<double> s_tet(3);
2991 Vector<double> x_tet(3);
2992 el_pt->local_coordinate_of_node(j, s);
2993 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
2994 tet_el_pt->interpolated_x(s_tet, x_tet);
2995 new_node_pt->x(0) = x_tet[0];
2996 new_node_pt->x(1) = x_tet[1];
2997 new_node_pt->x(2) = x_tet[2];
3002 el_pt->node_pt(j) = old_node_pt;
3012 Edge edge(el_pt->node_pt(18), el_pt->node_pt(24));
3013 old_node_pt = brick_edge_node_pt[edge];
3014 if (old_node_pt == 0)
3016 Node* new_node_pt = 0;
3017 if (edge.is_boundary_edge())
3019 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3023 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3025 brick_edge_node_pt[edge] = new_node_pt;
3026 Node_pt.push_back(new_node_pt);
3027 Vector<double> s(3);
3028 Vector<double> s_tet(3);
3029 Vector<double> x_tet(3);
3030 el_pt->local_coordinate_of_node(j, s);
3031 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
3032 tet_el_pt->interpolated_x(s_tet, x_tet);
3033 new_node_pt->x(0) = x_tet[0];
3034 new_node_pt->x(1) = x_tet[1];
3035 new_node_pt->x(2) = x_tet[2];
3040 el_pt->node_pt(j) = old_node_pt;
3049 Edge edge(el_pt->node_pt(20), el_pt->node_pt(26));
3050 old_node_pt = brick_edge_node_pt[edge];
3051 if (old_node_pt == 0)
3053 Node* new_node_pt = 0;
3054 if (edge.is_boundary_edge())
3056 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3060 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3062 brick_edge_node_pt[edge] = new_node_pt;
3063 Node_pt.push_back(new_node_pt);
3064 Vector<double> s(3);
3065 Vector<double> s_tet(3);
3066 Vector<double> x_tet(3);
3067 el_pt->local_coordinate_of_node(j, s);
3068 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
3069 tet_el_pt->interpolated_x(s_tet, x_tet);
3070 new_node_pt->x(0) = x_tet[0];
3071 new_node_pt->x(1) = x_tet[1];
3072 new_node_pt->x(2) = x_tet[2];
3077 el_pt->node_pt(j) = old_node_pt;
3087 Edge edge(el_pt->node_pt(24), el_pt->node_pt(26));
3088 old_node_pt = brick_edge_node_pt[edge];
3089 if (old_node_pt == 0)
3091 Node* new_node_pt = 0;
3092 if (edge.is_boundary_edge())
3094 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3098 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3100 brick_edge_node_pt[edge] = new_node_pt;
3101 Node_pt.push_back(new_node_pt);
3102 Vector<double> s(3);
3103 Vector<double> s_tet(3);
3104 Vector<double> x_tet(3);
3105 el_pt->local_coordinate_of_node(j, s);
3106 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
3107 tet_el_pt->interpolated_x(s_tet, x_tet);
3108 new_node_pt->x(0) = x_tet[0];
3109 new_node_pt->x(1) = x_tet[1];
3110 new_node_pt->x(2) = x_tet[2];
3115 el_pt->node_pt(j) = old_node_pt;
3124 Edge edge(el_pt->node_pt(0), el_pt->node_pt(18));
3125 old_node_pt = brick_edge_node_pt[edge];
3126 if (old_node_pt == 0)
3128 Node* new_node_pt = 0;
3129 if (edge.is_boundary_edge())
3131 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3135 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3137 brick_edge_node_pt[edge] = new_node_pt;
3138 Node_pt.push_back(new_node_pt);
3139 Vector<double> s(3);
3140 Vector<double> s_tet(3);
3141 Vector<double> x_tet(3);
3142 el_pt->local_coordinate_of_node(j, s);
3143 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
3144 tet_el_pt->interpolated_x(s_tet, x_tet);
3145 new_node_pt->x(0) = x_tet[0];
3146 new_node_pt->x(1) = x_tet[1];
3147 new_node_pt->x(2) = x_tet[2];
3152 el_pt->node_pt(j) = old_node_pt;
3162 Edge edge(el_pt->node_pt(2), el_pt->node_pt(20));
3163 old_node_pt = brick_edge_node_pt[edge];
3164 if (old_node_pt == 0)
3166 Node* new_node_pt = 0;
3167 if (edge.is_boundary_edge())
3169 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3173 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3175 brick_edge_node_pt[edge] = new_node_pt;
3176 Node_pt.push_back(new_node_pt);
3177 Vector<double> s(3);
3178 Vector<double> s_tet(3);
3179 Vector<double> x_tet(3);
3180 el_pt->local_coordinate_of_node(j, s);
3181 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
3182 tet_el_pt->interpolated_x(s_tet, x_tet);
3183 new_node_pt->x(0) = x_tet[0];
3184 new_node_pt->x(1) = x_tet[1];
3185 new_node_pt->x(2) = x_tet[2];
3190 el_pt->node_pt(j) = old_node_pt;
3200 Edge edge(el_pt->node_pt(6), el_pt->node_pt(24));
3201 old_node_pt = brick_edge_node_pt[edge];
3202 if (old_node_pt == 0)
3204 Node* new_node_pt = 0;
3205 if (edge.is_boundary_edge())
3207 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3211 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3213 brick_edge_node_pt[edge] = new_node_pt;
3214 Node_pt.push_back(new_node_pt);
3215 Vector<double> s(3);
3216 Vector<double> s_tet(3);
3217 Vector<double> x_tet(3);
3218 el_pt->local_coordinate_of_node(j, s);
3219 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
3220 tet_el_pt->interpolated_x(s_tet, x_tet);
3221 new_node_pt->x(0) = x_tet[0];
3222 new_node_pt->x(1) = x_tet[1];
3223 new_node_pt->x(2) = x_tet[2];
3228 el_pt->node_pt(j) = old_node_pt;
3238 Edge edge(el_pt->node_pt(8), el_pt->node_pt(26));
3239 old_node_pt = brick_edge_node_pt[edge];
3240 if (old_node_pt == 0)
3242 Node* new_node_pt = 0;
3243 if (edge.is_boundary_edge())
3245 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3249 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3251 brick_edge_node_pt[edge] = new_node_pt;
3252 Node_pt.push_back(new_node_pt);
3253 Vector<double> s(3);
3254 Vector<double> s_tet(3);
3255 Vector<double> x_tet(3);
3256 el_pt->local_coordinate_of_node(j, s);
3257 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
3258 tet_el_pt->interpolated_x(s_tet, x_tet);
3259 new_node_pt->x(0) = x_tet[0];
3260 new_node_pt->x(1) = x_tet[1];
3261 new_node_pt->x(2) = x_tet[2];
3266 el_pt->node_pt(j) = old_node_pt;
3277 TFace face(tet_el_pt->node_pt(central_tet_vertex),
3278 tet_el_pt->node_pt(tet_edge_node[0][0]),
3279 tet_el_pt->node_pt(tet_edge_node[2][0]));
3281 old_node_pt = tet_face_node_pt[face];
3282 if (old_node_pt == 0)
3284 Node* new_node_pt = 0;
3285 if (face.is_boundary_face())
3287 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3291 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3293 tet_face_node_pt[face] = new_node_pt;
3294 Node_pt.push_back(new_node_pt);
3295 Vector<double> s(3);
3296 Vector<double> s_tet(3);
3297 Vector<double> x_tet(3);
3298 el_pt->local_coordinate_of_node(j, s);
3299 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
3300 tet_el_pt->interpolated_x(s_tet, x_tet);
3301 new_node_pt->x(0) = x_tet[0];
3302 new_node_pt->x(1) = x_tet[1];
3303 new_node_pt->x(2) = x_tet[2];
3308 el_pt->node_pt(j) = old_node_pt;
3319 TFace face(tet_el_pt->node_pt(central_tet_vertex),
3320 tet_el_pt->node_pt(tet_edge_node[1][0]),
3321 tet_el_pt->node_pt(tet_edge_node[2][0]));
3322 old_node_pt = tet_face_node_pt[face];
3323 if (old_node_pt == 0)
3325 Node* new_node_pt = 0;
3326 if (face.is_boundary_face())
3328 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3332 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3334 tet_face_node_pt[face] = new_node_pt;
3335 Node_pt.push_back(new_node_pt);
3336 Vector<double> s(3);
3337 Vector<double> s_tet(3);
3338 Vector<double> x_tet(3);
3339 el_pt->local_coordinate_of_node(j, s);
3340 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
3341 tet_el_pt->interpolated_x(s_tet, x_tet);
3342 new_node_pt->x(0) = x_tet[0];
3343 new_node_pt->x(1) = x_tet[1];
3344 new_node_pt->x(2) = x_tet[2];
3349 el_pt->node_pt(j) = old_node_pt;
3360 TFace face(tet_el_pt->node_pt(central_tet_vertex),
3361 tet_el_pt->node_pt(tet_edge_node[0][0]),
3362 tet_el_pt->node_pt(tet_edge_node[1][0]));
3364 old_node_pt = tet_face_node_pt[face];
3365 if (old_node_pt == 0)
3367 Node* new_node_pt = 0;
3368 if (face.is_boundary_face())
3370 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3374 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3376 tet_face_node_pt[face] = new_node_pt;
3377 Node_pt.push_back(new_node_pt);
3378 Vector<double> s(3);
3379 Vector<double> s_tet(3);
3380 Vector<double> x_tet(3);
3381 el_pt->local_coordinate_of_node(j, s);
3382 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
3383 tet_el_pt->interpolated_x(s_tet, x_tet);
3384 new_node_pt->x(0) = x_tet[0];
3385 new_node_pt->x(1) = x_tet[1];
3386 new_node_pt->x(2) = x_tet[2];
3391 el_pt->node_pt(j) = old_node_pt;
3399 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3400 Node_pt.push_back(new_node_pt);
3401 Vector<double> s(3);
3402 Vector<double> s_tet(3);
3403 Vector<double> x_tet(3);
3404 el_pt->local_coordinate_of_node(j, s);
3405 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
3406 top_mid_face_node2_pt = new_node_pt;
3407 tet_el_pt->interpolated_x(s_tet, x_tet);
3408 new_node_pt->x(0) = x_tet[0];
3409 new_node_pt->x(1) = x_tet[1];
3410 new_node_pt->x(2) = x_tet[2];
3419 el_pt->node_pt(j) = back_mid_face_node0_pt;
3428 el_pt->node_pt(j) = right_mid_face_node1_pt;
3437 for (
unsigned j = 0; j < 8; j++)
3439 Node* nod_pt = dummy_q_el_pt[3]->node_pt(j);
3440 Vector<double> s_tet(3);
3441 Vector<double> x_tet(3);
3445 tet_el_pt->local_coordinate_of_node(2, s_tet);
3446 nod_pt->set_value(0, s_tet[0]);
3447 nod_pt->set_value(1, s_tet[1]);
3448 nod_pt->set_value(2, s_tet[2]);
3449 tet_el_pt->interpolated_x(s_tet, x_tet);
3450 nod_pt->x(0) = x_tet[0];
3451 nod_pt->x(1) = x_tet[1];
3452 nod_pt->x(2) = x_tet[2];
3455 tet_el_pt->local_coordinate_of_node(7, s_tet);
3456 nod_pt->set_value(0, s_tet[0]);
3457 nod_pt->set_value(1, s_tet[1]);
3458 nod_pt->set_value(2, s_tet[2]);
3459 tet_el_pt->interpolated_x(s_tet, x_tet);
3460 nod_pt->x(0) = x_tet[0];
3461 nod_pt->x(1) = x_tet[1];
3462 nod_pt->x(2) = x_tet[2];
3465 tet_el_pt->local_coordinate_of_node(5, s_tet);
3466 nod_pt->set_value(0, s_tet[0]);
3467 nod_pt->set_value(1, s_tet[1]);
3468 nod_pt->set_value(2, s_tet[2]);
3469 tet_el_pt->interpolated_x(s_tet, x_tet);
3470 nod_pt->x(0) = x_tet[0];
3471 nod_pt->x(1) = x_tet[1];
3472 nod_pt->x(2) = x_tet[2];
3477 s_tet[0] = 1.0 / 3.0;
3478 s_tet[1] = 1.0 / 3.0;
3479 s_tet[2] = 1.0 / 3.0;
3480 nod_pt->set_value(0, s_tet[0]);
3481 nod_pt->set_value(1, s_tet[1]);
3482 nod_pt->set_value(2, s_tet[2]);
3483 tet_el_pt->interpolated_x(s_tet, x_tet);
3484 nod_pt->x(0) = x_tet[0];
3485 nod_pt->x(1) = x_tet[1];
3486 nod_pt->x(2) = x_tet[2];
3489 tet_el_pt->local_coordinate_of_node(8, s_tet);
3490 nod_pt->set_value(0, s_tet[0]);
3491 nod_pt->set_value(1, s_tet[1]);
3492 nod_pt->set_value(2, s_tet[2]);
3493 tet_el_pt->interpolated_x(s_tet, x_tet);
3494 nod_pt->x(0) = x_tet[0];
3495 nod_pt->x(1) = x_tet[1];
3496 nod_pt->x(2) = x_tet[2];
3502 s_tet[1] = 1.0 / 3.0;
3503 s_tet[2] = 1.0 / 3.0;
3504 nod_pt->set_value(0, s_tet[0]);
3505 nod_pt->set_value(1, s_tet[1]);
3506 nod_pt->set_value(2, s_tet[2]);
3507 tet_el_pt->interpolated_x(s_tet, x_tet);
3508 nod_pt->x(0) = x_tet[0];
3509 nod_pt->x(1) = x_tet[1];
3510 nod_pt->x(2) = x_tet[2];
3515 s_tet[0] = 1.0 / 3.0;
3517 s_tet[2] = 1.0 / 3.0;
3518 nod_pt->set_value(0, s_tet[0]);
3519 nod_pt->set_value(1, s_tet[1]);
3520 nod_pt->set_value(2, s_tet[2]);
3521 tet_el_pt->interpolated_x(s_tet, x_tet);
3522 nod_pt->x(0) = x_tet[0];
3523 nod_pt->x(1) = x_tet[1];
3524 nod_pt->x(2) = x_tet[2];
3531 nod_pt->set_value(0, s_tet[0]);
3532 nod_pt->set_value(1, s_tet[1]);
3533 nod_pt->set_value(2, s_tet[2]);
3534 tet_el_pt->interpolated_x(s_tet, x_tet);
3535 nod_pt->x(0) = x_tet[0];
3536 nod_pt->x(1) = x_tet[1];
3537 nod_pt->x(2) = x_tet[2];
3544 FiniteElement* el_pt =
new ELEMENT;
3545 brick_el3_pt = el_pt;
3546 Element_pt.push_back(el_pt);
3549 tet_el_pt->node_pt(1), tet_el_pt->node_pt(2), tet_el_pt->node_pt(3));
3552 tet_el_pt->node_pt(0), tet_el_pt->node_pt(2), tet_el_pt->node_pt(3));
3555 tet_el_pt->node_pt(0), tet_el_pt->node_pt(1), tet_el_pt->node_pt(2));
3558 Vector<Vector<unsigned>> tet_edge_node(3);
3559 tet_edge_node[0].resize(2);
3560 tet_edge_node[0][0] = 7;
3561 tet_edge_node[0][1] = 1;
3562 tet_edge_node[1].resize(2);
3563 tet_edge_node[1][0] = 5;
3564 tet_edge_node[1][1] = 0;
3565 tet_edge_node[2].resize(2);
3566 tet_edge_node[2][0] = 8;
3567 tet_edge_node[2][1] = 3;
3570 unsigned central_tet_vertex = 2;
3572 Node* tet_node_pt = 0;
3573 Node* old_node_pt = 0;
3580 tet_node_pt = tet_el_pt->node_pt(central_tet_vertex);
3581 old_node_pt = tet_node_node_pt[tet_node_pt];
3582 if (old_node_pt == 0)
3584 Node* new_node_pt = 0;
3585 if (tet_node_pt->is_on_boundary())
3587 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3591 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3593 tet_node_node_pt[tet_node_pt] = new_node_pt;
3594 Node_pt.push_back(new_node_pt);
3595 Vector<double> s(3);
3596 Vector<double> s_tet(3);
3597 Vector<double> x_tet(3);
3598 el_pt->local_coordinate_of_node(j, s);
3599 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
3600 tet_el_pt->interpolated_x(s_tet, x_tet);
3601 new_node_pt->x(0) = x_tet[0];
3602 new_node_pt->x(1) = x_tet[1];
3603 new_node_pt->x(2) = x_tet[2];
3608 el_pt->node_pt(j) = old_node_pt;
3618 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[0][0]);
3619 old_node_pt = tet_node_node_pt[tet_node_pt];
3620 if (old_node_pt == 0)
3622 Node* new_node_pt = 0;
3623 if (tet_node_pt->is_on_boundary())
3625 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3629 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3631 tet_node_node_pt[tet_node_pt] = new_node_pt;
3632 Node_pt.push_back(new_node_pt);
3633 Vector<double> s(3);
3634 Vector<double> s_tet(3);
3635 Vector<double> x_tet(3);
3636 el_pt->local_coordinate_of_node(j, s);
3637 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
3638 tet_el_pt->interpolated_x(s_tet, x_tet);
3639 new_node_pt->x(0) = x_tet[0];
3640 new_node_pt->x(1) = x_tet[1];
3641 new_node_pt->x(2) = x_tet[2];
3646 el_pt->node_pt(j) = old_node_pt;
3656 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[1][0]);
3657 old_node_pt = tet_node_node_pt[tet_node_pt];
3658 if (old_node_pt == 0)
3660 Node* new_node_pt = 0;
3661 if (tet_node_pt->is_on_boundary())
3663 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3667 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3669 tet_node_node_pt[tet_node_pt] = new_node_pt;
3670 Node_pt.push_back(new_node_pt);
3671 Vector<double> s(3);
3672 Vector<double> s_tet(3);
3673 Vector<double> x_tet(3);
3674 el_pt->local_coordinate_of_node(j, s);
3675 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
3676 tet_el_pt->interpolated_x(s_tet, x_tet);
3677 new_node_pt->x(0) = x_tet[0];
3678 new_node_pt->x(1) = x_tet[1];
3679 new_node_pt->x(2) = x_tet[2];
3684 el_pt->node_pt(j) = old_node_pt;
3694 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[2][0]);
3695 old_node_pt = tet_node_node_pt[tet_node_pt];
3696 if (old_node_pt == 0)
3698 Node* new_node_pt = 0;
3699 if (tet_node_pt->is_on_boundary())
3701 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3705 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3707 tet_node_node_pt[tet_node_pt] = new_node_pt;
3708 Node_pt.push_back(new_node_pt);
3709 Vector<double> s(3);
3710 Vector<double> s_tet(3);
3711 Vector<double> x_tet(3);
3712 el_pt->local_coordinate_of_node(j, s);
3713 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
3714 tet_el_pt->interpolated_x(s_tet, x_tet);
3715 new_node_pt->x(0) = x_tet[0];
3716 new_node_pt->x(1) = x_tet[1];
3717 new_node_pt->x(2) = x_tet[2];
3722 el_pt->node_pt(j) = old_node_pt;
3732 old_node_pt = tet_face_node_pt[face0];
3733 if (old_node_pt == 0)
3735 Node* new_node_pt = 0;
3736 if (face0.is_boundary_face())
3738 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3742 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3744 tet_face_node_pt[face0] = new_node_pt;
3745 Node_pt.push_back(new_node_pt);
3746 Vector<double> s(3);
3747 Vector<double> s_tet(3);
3748 Vector<double> x_tet(3);
3749 el_pt->local_coordinate_of_node(j, s);
3750 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
3751 tet_el_pt->interpolated_x(s_tet, x_tet);
3752 new_node_pt->x(0) = x_tet[0];
3753 new_node_pt->x(1) = x_tet[1];
3754 new_node_pt->x(2) = x_tet[2];
3759 el_pt->node_pt(j) = old_node_pt;
3768 old_node_pt = tet_face_node_pt[face1];
3769 if (old_node_pt == 0)
3771 Node* new_node_pt = 0;
3772 if (face1.is_boundary_face())
3774 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3778 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3780 tet_face_node_pt[face1] = new_node_pt;
3781 Node_pt.push_back(new_node_pt);
3782 Vector<double> s(3);
3783 Vector<double> s_tet(3);
3784 Vector<double> x_tet(3);
3785 el_pt->local_coordinate_of_node(j, s);
3786 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
3787 tet_el_pt->interpolated_x(s_tet, x_tet);
3788 new_node_pt->x(0) = x_tet[0];
3789 new_node_pt->x(1) = x_tet[1];
3790 new_node_pt->x(2) = x_tet[2];
3795 el_pt->node_pt(j) = old_node_pt;
3804 old_node_pt = tet_face_node_pt[face2];
3805 if (old_node_pt == 0)
3807 Node* new_node_pt = 0;
3808 if (face2.is_boundary_face())
3810 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3814 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3816 tet_face_node_pt[face2] = new_node_pt;
3817 Node_pt.push_back(new_node_pt);
3818 Vector<double> s(3);
3819 Vector<double> s_tet(3);
3820 Vector<double> x_tet(3);
3821 el_pt->local_coordinate_of_node(j, s);
3822 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
3823 tet_el_pt->interpolated_x(s_tet, x_tet);
3824 new_node_pt->x(0) = x_tet[0];
3825 new_node_pt->x(1) = x_tet[1];
3826 new_node_pt->x(2) = x_tet[2];
3831 el_pt->node_pt(j) = old_node_pt;
3842 el_pt->node_pt(j) = centroid_node_pt;
3852 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3853 Node_pt.push_back(new_node_pt);
3854 Vector<double> s(3);
3855 Vector<double> s_tet(3);
3856 Vector<double> x_tet(3);
3857 el_pt->local_coordinate_of_node(j, s);
3858 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
3859 tet_el_pt->interpolated_x(s_tet, x_tet);
3860 new_node_pt->x(0) = x_tet[0];
3861 new_node_pt->x(1) = x_tet[1];
3862 new_node_pt->x(2) = x_tet[2];
3871 Edge edge(el_pt->node_pt(0), el_pt->node_pt(2));
3872 old_node_pt = brick_edge_node_pt[edge];
3873 if (old_node_pt == 0)
3875 Node* new_node_pt = 0;
3876 if (edge.is_boundary_edge())
3878 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3882 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3884 brick_edge_node_pt[edge] = new_node_pt;
3885 Node_pt.push_back(new_node_pt);
3886 Vector<double> s(3);
3887 Vector<double> s_tet(3);
3888 Vector<double> x_tet(3);
3889 el_pt->local_coordinate_of_node(j, s);
3890 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
3891 tet_el_pt->interpolated_x(s_tet, x_tet);
3892 new_node_pt->x(0) = x_tet[0];
3893 new_node_pt->x(1) = x_tet[1];
3894 new_node_pt->x(2) = x_tet[2];
3899 el_pt->node_pt(j) = old_node_pt;
3909 Edge edge(el_pt->node_pt(0), el_pt->node_pt(6));
3910 old_node_pt = brick_edge_node_pt[edge];
3911 if (old_node_pt == 0)
3913 Node* new_node_pt = 0;
3914 if (edge.is_boundary_edge())
3916 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3920 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3922 brick_edge_node_pt[edge] = new_node_pt;
3923 Node_pt.push_back(new_node_pt);
3924 Vector<double> s(3);
3925 Vector<double> s_tet(3);
3926 Vector<double> x_tet(3);
3927 el_pt->local_coordinate_of_node(j, s);
3928 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
3929 tet_el_pt->interpolated_x(s_tet, x_tet);
3930 new_node_pt->x(0) = x_tet[0];
3931 new_node_pt->x(1) = x_tet[1];
3932 new_node_pt->x(2) = x_tet[2];
3937 el_pt->node_pt(j) = old_node_pt;
3946 Edge edge(el_pt->node_pt(2), el_pt->node_pt(8));
3947 old_node_pt = brick_edge_node_pt[edge];
3948 if (old_node_pt == 0)
3950 Node* new_node_pt = 0;
3951 if (edge.is_boundary_edge())
3953 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3957 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3959 brick_edge_node_pt[edge] = new_node_pt;
3960 Node_pt.push_back(new_node_pt);
3961 Vector<double> s(3);
3962 Vector<double> s_tet(3);
3963 Vector<double> x_tet(3);
3964 el_pt->local_coordinate_of_node(j, s);
3965 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
3966 tet_el_pt->interpolated_x(s_tet, x_tet);
3967 new_node_pt->x(0) = x_tet[0];
3968 new_node_pt->x(1) = x_tet[1];
3969 new_node_pt->x(2) = x_tet[2];
3974 el_pt->node_pt(j) = old_node_pt;
3983 Edge edge(el_pt->node_pt(6), el_pt->node_pt(8));
3984 old_node_pt = brick_edge_node_pt[edge];
3985 if (old_node_pt == 0)
3987 Node* new_node_pt = 0;
3988 if (edge.is_boundary_edge())
3990 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
3994 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
3996 brick_edge_node_pt[edge] = new_node_pt;
3997 Node_pt.push_back(new_node_pt);
3998 Vector<double> s(3);
3999 Vector<double> s_tet(3);
4000 Vector<double> x_tet(3);
4001 el_pt->local_coordinate_of_node(j, s);
4002 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
4003 tet_el_pt->interpolated_x(s_tet, x_tet);
4004 new_node_pt->x(0) = x_tet[0];
4005 new_node_pt->x(1) = x_tet[1];
4006 new_node_pt->x(2) = x_tet[2];
4011 el_pt->node_pt(j) = old_node_pt;
4020 Edge edge(el_pt->node_pt(18), el_pt->node_pt(20));
4021 old_node_pt = brick_edge_node_pt[edge];
4022 if (old_node_pt == 0)
4024 Node* new_node_pt = 0;
4025 if (edge.is_boundary_edge())
4027 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
4031 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
4033 brick_edge_node_pt[edge] = new_node_pt;
4034 Node_pt.push_back(new_node_pt);
4035 Vector<double> s(3);
4036 Vector<double> s_tet(3);
4037 Vector<double> x_tet(3);
4038 el_pt->local_coordinate_of_node(j, s);
4039 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
4040 tet_el_pt->interpolated_x(s_tet, x_tet);
4041 new_node_pt->x(0) = x_tet[0];
4042 new_node_pt->x(1) = x_tet[1];
4043 new_node_pt->x(2) = x_tet[2];
4048 el_pt->node_pt(j) = old_node_pt;
4058 Edge edge(el_pt->node_pt(18), el_pt->node_pt(24));
4059 old_node_pt = brick_edge_node_pt[edge];
4060 if (old_node_pt == 0)
4062 Node* new_node_pt = 0;
4063 if (edge.is_boundary_edge())
4065 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
4069 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
4071 brick_edge_node_pt[edge] = new_node_pt;
4072 Node_pt.push_back(new_node_pt);
4073 Vector<double> s(3);
4074 Vector<double> s_tet(3);
4075 Vector<double> x_tet(3);
4076 el_pt->local_coordinate_of_node(j, s);
4077 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
4078 tet_el_pt->interpolated_x(s_tet, x_tet);
4079 new_node_pt->x(0) = x_tet[0];
4080 new_node_pt->x(1) = x_tet[1];
4081 new_node_pt->x(2) = x_tet[2];
4086 el_pt->node_pt(j) = old_node_pt;
4095 Edge edge(el_pt->node_pt(20), el_pt->node_pt(26));
4096 old_node_pt = brick_edge_node_pt[edge];
4097 if (old_node_pt == 0)
4099 Node* new_node_pt = 0;
4100 if (edge.is_boundary_edge())
4102 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
4106 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
4108 brick_edge_node_pt[edge] = new_node_pt;
4109 Node_pt.push_back(new_node_pt);
4110 Vector<double> s(3);
4111 Vector<double> s_tet(3);
4112 Vector<double> x_tet(3);
4113 el_pt->local_coordinate_of_node(j, s);
4114 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
4115 tet_el_pt->interpolated_x(s_tet, x_tet);
4116 new_node_pt->x(0) = x_tet[0];
4117 new_node_pt->x(1) = x_tet[1];
4118 new_node_pt->x(2) = x_tet[2];
4123 el_pt->node_pt(j) = old_node_pt;
4133 Edge edge(el_pt->node_pt(24), el_pt->node_pt(26));
4134 old_node_pt = brick_edge_node_pt[edge];
4135 if (old_node_pt == 0)
4137 Node* new_node_pt = 0;
4138 if (edge.is_boundary_edge())
4140 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
4144 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
4146 brick_edge_node_pt[edge] = new_node_pt;
4147 Node_pt.push_back(new_node_pt);
4148 Vector<double> s(3);
4149 Vector<double> s_tet(3);
4150 Vector<double> x_tet(3);
4151 el_pt->local_coordinate_of_node(j, s);
4152 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
4153 tet_el_pt->interpolated_x(s_tet, x_tet);
4154 new_node_pt->x(0) = x_tet[0];
4155 new_node_pt->x(1) = x_tet[1];
4156 new_node_pt->x(2) = x_tet[2];
4161 el_pt->node_pt(j) = old_node_pt;
4170 Edge edge(el_pt->node_pt(0), el_pt->node_pt(18));
4171 old_node_pt = brick_edge_node_pt[edge];
4172 if (old_node_pt == 0)
4174 Node* new_node_pt = 0;
4175 if (edge.is_boundary_edge())
4177 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
4181 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
4183 brick_edge_node_pt[edge] = new_node_pt;
4184 Node_pt.push_back(new_node_pt);
4185 Vector<double> s(3);
4186 Vector<double> s_tet(3);
4187 Vector<double> x_tet(3);
4188 el_pt->local_coordinate_of_node(j, s);
4189 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
4190 tet_el_pt->interpolated_x(s_tet, x_tet);
4191 new_node_pt->x(0) = x_tet[0];
4192 new_node_pt->x(1) = x_tet[1];
4193 new_node_pt->x(2) = x_tet[2];
4198 el_pt->node_pt(j) = old_node_pt;
4208 Edge edge(el_pt->node_pt(2), el_pt->node_pt(20));
4209 old_node_pt = brick_edge_node_pt[edge];
4210 if (old_node_pt == 0)
4212 Node* new_node_pt = 0;
4213 if (edge.is_boundary_edge())
4215 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
4219 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
4221 brick_edge_node_pt[edge] = new_node_pt;
4222 Node_pt.push_back(new_node_pt);
4223 Vector<double> s(3);
4224 Vector<double> s_tet(3);
4225 Vector<double> x_tet(3);
4226 el_pt->local_coordinate_of_node(j, s);
4227 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
4228 tet_el_pt->interpolated_x(s_tet, x_tet);
4229 new_node_pt->x(0) = x_tet[0];
4230 new_node_pt->x(1) = x_tet[1];
4231 new_node_pt->x(2) = x_tet[2];
4236 el_pt->node_pt(j) = old_node_pt;
4246 Edge edge(el_pt->node_pt(6), el_pt->node_pt(24));
4247 old_node_pt = brick_edge_node_pt[edge];
4248 if (old_node_pt == 0)
4250 Node* new_node_pt = 0;
4251 if (edge.is_boundary_edge())
4253 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
4257 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
4259 brick_edge_node_pt[edge] = new_node_pt;
4260 Node_pt.push_back(new_node_pt);
4261 Vector<double> s(3);
4262 Vector<double> s_tet(3);
4263 Vector<double> x_tet(3);
4264 el_pt->local_coordinate_of_node(j, s);
4265 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
4266 tet_el_pt->interpolated_x(s_tet, x_tet);
4267 new_node_pt->x(0) = x_tet[0];
4268 new_node_pt->x(1) = x_tet[1];
4269 new_node_pt->x(2) = x_tet[2];
4274 el_pt->node_pt(j) = old_node_pt;
4284 Edge edge(el_pt->node_pt(8), el_pt->node_pt(26));
4285 old_node_pt = brick_edge_node_pt[edge];
4286 if (old_node_pt == 0)
4288 Node* new_node_pt = 0;
4289 if (edge.is_boundary_edge())
4291 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
4295 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
4297 brick_edge_node_pt[edge] = new_node_pt;
4298 Node_pt.push_back(new_node_pt);
4299 Vector<double> s(3);
4300 Vector<double> s_tet(3);
4301 Vector<double> x_tet(3);
4302 el_pt->local_coordinate_of_node(j, s);
4303 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
4304 tet_el_pt->interpolated_x(s_tet, x_tet);
4305 new_node_pt->x(0) = x_tet[0];
4306 new_node_pt->x(1) = x_tet[1];
4307 new_node_pt->x(2) = x_tet[2];
4312 el_pt->node_pt(j) = old_node_pt;
4323 TFace face(tet_el_pt->node_pt(central_tet_vertex),
4324 tet_el_pt->node_pt(tet_edge_node[0][0]),
4325 tet_el_pt->node_pt(tet_edge_node[2][0]));
4327 old_node_pt = tet_face_node_pt[face];
4328 if (old_node_pt == 0)
4330 Node* new_node_pt = 0;
4331 if (face.is_boundary_face())
4333 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
4337 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
4339 tet_face_node_pt[face] = new_node_pt;
4340 Node_pt.push_back(new_node_pt);
4341 Vector<double> s(3);
4342 Vector<double> s_tet(3);
4343 Vector<double> x_tet(3);
4344 el_pt->local_coordinate_of_node(j, s);
4345 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
4346 tet_el_pt->interpolated_x(s_tet, x_tet);
4347 new_node_pt->x(0) = x_tet[0];
4348 new_node_pt->x(1) = x_tet[1];
4349 new_node_pt->x(2) = x_tet[2];
4354 el_pt->node_pt(j) = old_node_pt;
4365 TFace face(tet_el_pt->node_pt(central_tet_vertex),
4366 tet_el_pt->node_pt(tet_edge_node[1][0]),
4367 tet_el_pt->node_pt(tet_edge_node[2][0]));
4369 old_node_pt = tet_face_node_pt[face];
4370 if (old_node_pt == 0)
4372 Node* new_node_pt = 0;
4373 if (face.is_boundary_face())
4375 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
4379 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
4381 tet_face_node_pt[face] = new_node_pt;
4382 Node_pt.push_back(new_node_pt);
4383 Vector<double> s(3);
4384 Vector<double> s_tet(3);
4385 Vector<double> x_tet(3);
4386 el_pt->local_coordinate_of_node(j, s);
4387 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
4388 tet_el_pt->interpolated_x(s_tet, x_tet);
4389 new_node_pt->x(0) = x_tet[0];
4390 new_node_pt->x(1) = x_tet[1];
4391 new_node_pt->x(2) = x_tet[2];
4396 el_pt->node_pt(j) = old_node_pt;
4407 TFace face(tet_el_pt->node_pt(central_tet_vertex),
4408 tet_el_pt->node_pt(tet_edge_node[0][0]),
4409 tet_el_pt->node_pt(tet_edge_node[1][0]));
4411 old_node_pt = tet_face_node_pt[face];
4412 if (old_node_pt == 0)
4414 Node* new_node_pt = 0;
4415 if (face.is_boundary_face())
4417 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
4421 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
4423 tet_face_node_pt[face] = new_node_pt;
4424 Node_pt.push_back(new_node_pt);
4425 Vector<double> s(3);
4426 Vector<double> s_tet(3);
4427 Vector<double> x_tet(3);
4428 el_pt->local_coordinate_of_node(j, s);
4429 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
4430 tet_el_pt->interpolated_x(s_tet, x_tet);
4431 new_node_pt->x(0) = x_tet[0];
4432 new_node_pt->x(1) = x_tet[1];
4433 new_node_pt->x(2) = x_tet[2];
4438 el_pt->node_pt(j) = old_node_pt;
4448 el_pt->node_pt(j) = top_mid_face_node2_pt;
4457 el_pt->node_pt(j) = top_mid_face_node1_pt;
4466 el_pt->node_pt(j) = top_mid_face_node0_pt;
4476 for (
int face_index = 0; face_index < 4; face_index++)
4484 face_pt =
new TFace(tet_el_pt->node_pt(1),
4485 tet_el_pt->node_pt(2),
4486 tet_el_pt->node_pt(3));
4491 face_pt =
new TFace(tet_el_pt->node_pt(0),
4492 tet_el_pt->node_pt(2),
4493 tet_el_pt->node_pt(3));
4500 face_pt =
new TFace(tet_el_pt->node_pt(0),
4501 tet_el_pt->node_pt(1),
4502 tet_el_pt->node_pt(3));
4508 face_pt =
new TFace(tet_el_pt->node_pt(0),
4509 tet_el_pt->node_pt(1),
4510 tet_el_pt->node_pt(2));
4515 if (face_pt->is_boundary_face())
4517 std::set<unsigned> bnd;
4518 std::set<unsigned>* bnd_pt = &bnd;
4519 face_pt->get_boundaries_pt(bnd_pt);
4522 if ((*bnd_pt).size() > 1)
4524 std::ostringstream error_stream;
4525 error_stream <<
"TFace should only be on one boundary.\n";
4526 throw OomphLibError(error_stream.str(),
4527 OOMPH_CURRENT_FUNCTION,
4528 OOMPH_EXCEPTION_LOCATION);
4532 if ((*bnd_pt).size() == 1)
4535 FaceElement* face_el_pt = 0;
4536 if (tet_mesh_is_solid_mesh)
4539 if (
dynamic_cast<SolidTElement<3, 3>*
>(tet_el_pt) == 0)
4541 std::ostringstream error_stream;
4543 <<
"Tet-element cannot be cast to SolidTElement<3,3>.\n"
4544 <<
"BrickFromTetMesh can only be built from\n"
4545 <<
"mesh containing quadratic tets.\n"
4547 throw OomphLibError(error_stream.str(),
4548 OOMPH_CURRENT_FUNCTION,
4549 OOMPH_EXCEPTION_LOCATION);
4553 face_el_pt =
new DummyFaceElement<SolidTElement<3, 3>>(
4554 tet_el_pt, face_index);
4559 if (
dynamic_cast<TElement<3, 3>*
>(tet_el_pt) == 0)
4561 std::ostringstream error_stream;
4562 error_stream <<
"Tet-element cannot be cast to TElement<3,3>.\n"
4563 <<
"BrickFromTetMesh can only be built from\n"
4564 <<
"mesh containing quadratic tets.\n"
4566 throw OomphLibError(error_stream.str(),
4567 OOMPH_CURRENT_FUNCTION,
4568 OOMPH_EXCEPTION_LOCATION);
4574 new DummyFaceElement<TElement<3, 3>>(tet_el_pt, face_index);
4580 unsigned b = (*(*bnd_pt).begin());
4581 Boundary_coordinate_exists[b] =
true;
4582 face_el_pt->set_boundary_number_in_bulk_mesh(b);
4586 Vector<Node*> brick_face_node_pt(19);
4591 brick_face_node_pt[0] = brick_el1_pt->node_pt(0);
4592 brick_face_node_pt[1] = brick_el3_pt->node_pt(0);
4593 brick_face_node_pt[2] = brick_el2_pt->node_pt(0);
4595 brick_face_node_pt[3] = brick_el1_pt->node_pt(18);
4596 brick_face_node_pt[4] = brick_el2_pt->node_pt(18);
4597 brick_face_node_pt[5] = brick_el1_pt->node_pt(2);
4599 brick_face_node_pt[6] = brick_el1_pt->node_pt(9);
4600 brick_face_node_pt[7] = brick_el3_pt->node_pt(1);
4601 brick_face_node_pt[8] = brick_el3_pt->node_pt(9);
4603 brick_face_node_pt[9] = brick_el2_pt->node_pt(9);
4604 brick_face_node_pt[10] = brick_el2_pt->node_pt(3);
4605 brick_face_node_pt[11] = brick_el1_pt->node_pt(1);
4607 brick_face_node_pt[12] = brick_el1_pt->node_pt(20);
4609 brick_face_node_pt[13] = brick_el2_pt->node_pt(12);
4610 brick_face_node_pt[14] = brick_el1_pt->node_pt(19);
4612 brick_face_node_pt[15] = brick_el1_pt->node_pt(10);
4613 brick_face_node_pt[16] = brick_el2_pt->node_pt(21);
4615 brick_face_node_pt[17] = brick_el3_pt->node_pt(10);
4616 brick_face_node_pt[18] = brick_el1_pt->node_pt(11);
4620 brick_face_node_pt[0] = brick_el0_pt->node_pt(0);
4621 brick_face_node_pt[1] = brick_el3_pt->node_pt(0);
4622 brick_face_node_pt[2] = brick_el2_pt->node_pt(0);
4624 brick_face_node_pt[3] = brick_el0_pt->node_pt(18);
4625 brick_face_node_pt[4] = brick_el2_pt->node_pt(18);
4626 brick_face_node_pt[5] = brick_el0_pt->node_pt(6);
4628 brick_face_node_pt[6] = brick_el0_pt->node_pt(9);
4629 brick_face_node_pt[7] = brick_el3_pt->node_pt(3);
4630 brick_face_node_pt[8] = brick_el3_pt->node_pt(9);
4632 brick_face_node_pt[9] = brick_el2_pt->node_pt(9);
4633 brick_face_node_pt[10] = brick_el2_pt->node_pt(1);
4634 brick_face_node_pt[11] = brick_el0_pt->node_pt(3);
4636 brick_face_node_pt[12] = brick_el0_pt->node_pt(24);
4638 brick_face_node_pt[13] = brick_el2_pt->node_pt(10);
4639 brick_face_node_pt[14] = brick_el0_pt->node_pt(21);
4641 brick_face_node_pt[15] = brick_el0_pt->node_pt(12);
4642 brick_face_node_pt[16] = brick_el3_pt->node_pt(21);
4644 brick_face_node_pt[17] = brick_el3_pt->node_pt(12);
4645 brick_face_node_pt[18] = brick_el0_pt->node_pt(15);
4649 brick_face_node_pt[0] = brick_el0_pt->node_pt(0);
4650 brick_face_node_pt[1] = brick_el1_pt->node_pt(0);
4651 brick_face_node_pt[2] = brick_el2_pt->node_pt(0);
4653 brick_face_node_pt[3] = brick_el0_pt->node_pt(2);
4654 brick_face_node_pt[4] = brick_el1_pt->node_pt(2);
4655 brick_face_node_pt[5] = brick_el0_pt->node_pt(6);
4657 brick_face_node_pt[6] = brick_el0_pt->node_pt(1);
4658 brick_face_node_pt[7] = brick_el1_pt->node_pt(3);
4659 brick_face_node_pt[8] = brick_el1_pt->node_pt(1);
4661 brick_face_node_pt[9] = brick_el2_pt->node_pt(3);
4662 brick_face_node_pt[10] = brick_el2_pt->node_pt(1);
4663 brick_face_node_pt[11] = brick_el0_pt->node_pt(3);
4665 brick_face_node_pt[12] = brick_el0_pt->node_pt(8);
4667 brick_face_node_pt[13] = brick_el2_pt->node_pt(4);
4668 brick_face_node_pt[14] = brick_el0_pt->node_pt(5);
4670 brick_face_node_pt[15] = brick_el0_pt->node_pt(4);
4671 brick_face_node_pt[16] = brick_el1_pt->node_pt(5);
4673 brick_face_node_pt[17] = brick_el1_pt->node_pt(4);
4674 brick_face_node_pt[18] = brick_el0_pt->node_pt(7);
4678 brick_face_node_pt[0] = brick_el1_pt->node_pt(0);
4679 brick_face_node_pt[1] = brick_el3_pt->node_pt(0);
4680 brick_face_node_pt[2] = brick_el0_pt->node_pt(0);
4682 brick_face_node_pt[3] = brick_el1_pt->node_pt(18);
4683 brick_face_node_pt[4] = brick_el3_pt->node_pt(6);
4684 brick_face_node_pt[5] = brick_el1_pt->node_pt(6);
4686 brick_face_node_pt[6] = brick_el1_pt->node_pt(9);
4687 brick_face_node_pt[7] = brick_el3_pt->node_pt(1);
4688 brick_face_node_pt[8] = brick_el3_pt->node_pt(3);
4690 brick_face_node_pt[9] = brick_el0_pt->node_pt(9);
4691 brick_face_node_pt[10] = brick_el0_pt->node_pt(1);
4692 brick_face_node_pt[11] = brick_el1_pt->node_pt(3);
4694 brick_face_node_pt[12] = brick_el1_pt->node_pt(24);
4696 brick_face_node_pt[13] = brick_el0_pt->node_pt(10);
4697 brick_face_node_pt[14] = brick_el1_pt->node_pt(21);
4699 brick_face_node_pt[15] = brick_el1_pt->node_pt(12);
4700 brick_face_node_pt[16] = brick_el3_pt->node_pt(7);
4702 brick_face_node_pt[17] = brick_el3_pt->node_pt(4);
4703 brick_face_node_pt[18] = brick_el1_pt->node_pt(15);
4709 Vector<unsigned> translate(19);
4712 for (
unsigned i = 0; i < 19; i++)
4718 for (
unsigned j = 0; j < 19; j++)
4721 Node* brick_node_pt = brick_face_node_pt[translate[j]];
4724 Vector<double> s = s_face[j];
4725 Vector<double> zeta(2);
4726 Vector<double> x(3);
4727 face_el_pt->interpolated_zeta(s, zeta);
4728 face_el_pt->interpolated_x(s, x);
4732 double dist = sqrt(pow(brick_node_pt->x(0) - x[0], 2) +
4733 pow(brick_node_pt->x(1) - x[1], 2) +
4734 pow(brick_node_pt->x(2) - x[2], 2));
4735 if (dist > BrickFromTetMeshHelper::Face_position_tolerance)
4737 std::ofstream brick0;
4738 std::ofstream brick1;
4739 std::ofstream brick2;
4740 std::ofstream brick3;
4741 brick0.open(
"full_brick0.dat");
4742 brick1.open(
"full_brick1.dat");
4743 brick2.open(
"full_brick2.dat");
4744 brick3.open(
"full_brick3.dat");
4745 for (
unsigned j = 0; j < 27; j++)
4747 brick0 << brick_el0_pt->node_pt(j)->x(0) <<
" "
4748 << brick_el0_pt->node_pt(j)->x(1) <<
" "
4749 << brick_el0_pt->node_pt(j)->x(2) <<
"\n";
4751 brick1 << brick_el1_pt->node_pt(j)->x(0) <<
" "
4752 << brick_el1_pt->node_pt(j)->x(1) <<
" "
4753 << brick_el1_pt->node_pt(j)->x(2) <<
"\n";
4755 brick2 << brick_el2_pt->node_pt(j)->x(0) <<
" "
4756 << brick_el2_pt->node_pt(j)->x(1) <<
" "
4757 << brick_el2_pt->node_pt(j)->x(2) <<
"\n";
4759 brick3 << brick_el3_pt->node_pt(j)->x(0) <<
" "
4760 << brick_el3_pt->node_pt(j)->x(1) <<
" "
4761 << brick_el3_pt->node_pt(j)->x(2) <<
"\n";
4768 std::ofstream full_face;
4769 full_face.open(
"full_face.dat");
4770 for (
unsigned j = 0; j < 6; j++)
4772 full_face << face_el_pt->node_pt(j)->x(0) <<
" "
4773 << face_el_pt->node_pt(j)->x(1) <<
" "
4774 << face_el_pt->node_pt(j)->x(2) <<
"\n";
4779 int normal_sign = face_el_pt->normal_sign();
4781 std::ostringstream error_stream;
4783 <<
"During assignment of boundary cordinates, the distance\n"
4784 <<
"between brick node and reference point in \n"
4785 <<
"triangular FaceElement is " << dist <<
" which \n"
4786 <<
"is bigger than the tolerance defined in \n"
4787 <<
"BrickFromTetMeshHelper::Face_position_tolerance="
4788 << BrickFromTetMeshHelper::Face_position_tolerance <<
".\n"
4789 <<
"If this is tolerable, increase the tolerance \n"
4790 <<
"(it's defined in a namespace and therefore publically\n"
4791 <<
"accessible). If not, the Face may be inverted in which \n"
4792 <<
"case you should re-implement the translation scheme,\n"
4793 <<
"following the pattern used in the "
4794 "ThinLayerBrickOnTetMesh."
4795 <<
"\nThe required code fragements are already here but \n"
4796 <<
"the translation is the unit map.\n"
4797 <<
"To aid the diagnostics, the files full_brick[0-3].dat\n"
4798 <<
"contain the coordinates of the 27 nodes in the four\n"
4799 <<
"bricks associated with the current tet and "
4801 <<
"contains the coordinates of the 6 nodes in the "
4803 <<
"\nfrom which the boundary coordinates are extracted.\n"
4804 <<
"FYI: The normal_sign of the face is: " << normal_sign
4806 throw OomphLibError(error_stream.str(),
4807 OOMPH_CURRENT_FUNCTION,
4808 OOMPH_EXCEPTION_LOCATION);
4813 add_boundary_node(b, brick_node_pt);
4814 brick_node_pt->set_coordinates_on_boundary(b, zeta);
4821 Boundary_element_pt[b].push_back(brick_el1_pt);
4822 Face_index_at_boundary[b].push_back(-2);
4823 Boundary_element_pt[b].push_back(brick_el2_pt);
4824 Face_index_at_boundary[b].push_back(-1);
4825 Boundary_element_pt[b].push_back(brick_el3_pt);
4826 Face_index_at_boundary[b].push_back(-2);
4830 Boundary_element_pt[b].push_back(brick_el0_pt);
4831 Face_index_at_boundary[b].push_back(-1);
4832 Boundary_element_pt[b].push_back(brick_el2_pt);
4833 Face_index_at_boundary[b].push_back(-2);
4834 Boundary_element_pt[b].push_back(brick_el3_pt);
4835 Face_index_at_boundary[b].push_back(-1);
4839 Boundary_element_pt[b].push_back(brick_el0_pt);
4840 Face_index_at_boundary[b].push_back(-3);
4841 Boundary_element_pt[b].push_back(brick_el1_pt);
4842 Face_index_at_boundary[b].push_back(-3);
4843 Boundary_element_pt[b].push_back(brick_el2_pt);
4844 Face_index_at_boundary[b].push_back(-3);
4848 Boundary_element_pt[b].push_back(brick_el0_pt);
4849 Face_index_at_boundary[b].push_back(-2);
4850 Boundary_element_pt[b].push_back(brick_el1_pt);
4851 Face_index_at_boundary[b].push_back(-1);
4852 Boundary_element_pt[b].push_back(brick_el3_pt);
4853 Face_index_at_boundary[b].push_back(-3);
4866 Lookup_for_elements_next_boundary_is_setup =
true;
4870 unsigned n_xda_boundaries = tet_mesh_pt->nxda_boundary();
4873 Boundary_id.resize(n_xda_boundaries);
4874 for (
unsigned xda_b = 0; xda_b < n_xda_boundaries; xda_b++)
4876 Boundary_id[xda_b] = tet_mesh_pt->oomph_lib_boundary_ids(xda_b);
4881 for (
unsigned e = 0; e < 4; e++)
4883 for (
unsigned j = 0; j < 8; j++)
4885 delete dummy_q_el_pt[e]->node_pt(j);
4887 delete dummy_q_el_pt[e];
4895 template<
class ELEMENT>
4897 TetgenMesh<TElement<3, 3>>* tet_mesh_pt, TimeStepper* time_stepper_pt)
4900 MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(3, 3);
4903 bool tet_mesh_is_solid_mesh =
false;
4904 if (
dynamic_cast<SolidFiniteElement*
>(tet_mesh_pt->element_pt(0)) != 0)
4906 tet_mesh_is_solid_mesh =
true;
4913 Vector<Vector<double>> s_face(19);
4914 for (
unsigned i = 0; i < 19; i++)
4916 s_face[i].resize(2);
4958 s_face[i][0] = 0.75;
4959 s_face[i][1] = 0.25;
4963 s_face[i][0] = 0.25;
4964 s_face[i][1] = 0.75;
4969 s_face[i][1] = 0.75;
4974 s_face[i][1] = 0.25;
4978 s_face[i][0] = 0.25;
4983 s_face[i][0] = 0.75;
4990 s_face[i][0] = 1.0 / 3.0;
4991 s_face[i][1] = 1.0 / 3.0;
4998 s_face[i][0] = 5.0 / 24.0;
4999 s_face[i][1] = 5.0 / 24.0;
5003 s_face[i][0] = 5.0 / 12.0;
5004 s_face[i][1] = 5.0 / 12.0;
5010 s_face[i][1] = 5.0 / 24.0;
5011 s_face[i][0] = 7.0 / 12.0;
5015 s_face[i][1] = 5.0 / 12.0;
5016 s_face[i][0] = 1.0 / 6.0;
5023 s_face[i][0] = 5.0 / 24.0;
5024 s_face[i][1] = 7.0 / 12.0;
5028 s_face[i][0] = 5.0 / 12.0;
5029 s_face[i][1] = 1.0 / 6.0;
5035 unsigned nb = tet_mesh_pt->nboundary();
5039 Boundary_element_pt.resize(nb);
5040 Face_index_at_boundary.resize(nb);
5045 std::map<Node*, Node*> tet_node_node_pt;
5048 std::map<Edge, Node*> brick_edge_node_pt;
5051 std::map<TFace, Node*> tet_face_node_pt;
5055 Vector<DummyBrickElement*> dummy_q_el_pt(4);
5056 for (
unsigned e = 0; e < 4; e++)
5058 dummy_q_el_pt[e] =
new DummyBrickElement;
5059 for (
unsigned j = 0; j < 8; j++)
5061 dummy_q_el_pt[e]->construct_node(j);
5066 unsigned n_el_tet = tet_mesh_pt->nelement();
5067 for (
unsigned e_tet = 0; e_tet < n_el_tet; e_tet++)
5070 TElement<3, 3>* tet_el_pt =
5071 dynamic_cast<TElement<3, 3>*
>(tet_mesh_pt->element_pt(e_tet));
5076 std::ostringstream error_stream;
5078 <<
"BrickFromTetMesh can only built from tet mesh containing\n"
5079 <<
"ten-noded tets.\n";
5080 throw OomphLibError(
5081 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
5086 Node* centroid_node_pt = 0;
5089 Node* top_mid_face_node0_pt = 0;
5090 Node* right_mid_face_node0_pt = 0;
5091 Node* back_mid_face_node0_pt = 0;
5093 Node* top_mid_face_node1_pt = 0;
5094 Node* right_mid_face_node1_pt = 0;
5096 Node* top_mid_face_node2_pt = 0;
5099 FiniteElement* brick_el0_pt = 0;
5100 FiniteElement* brick_el1_pt = 0;
5101 FiniteElement* brick_el2_pt = 0;
5102 FiniteElement* brick_el3_pt = 0;
5109 for (
unsigned j = 0; j < 8; j++)
5111 Node* nod_pt = dummy_q_el_pt[0]->node_pt(j);
5112 Vector<double> s_tet(3);
5113 Vector<double> x_tet(3);
5117 tet_el_pt->local_coordinate_of_node(0, s_tet);
5118 nod_pt->set_value(0, s_tet[0]);
5119 nod_pt->set_value(1, s_tet[1]);
5120 nod_pt->set_value(2, s_tet[2]);
5121 tet_el_pt->interpolated_x(s_tet, x_tet);
5122 nod_pt->x(0) = x_tet[0];
5123 nod_pt->x(1) = x_tet[1];
5124 nod_pt->x(2) = x_tet[2];
5127 tet_el_pt->local_coordinate_of_node(4, s_tet);
5128 nod_pt->set_value(0, s_tet[0]);
5129 nod_pt->set_value(1, s_tet[1]);
5130 nod_pt->set_value(2, s_tet[2]);
5131 tet_el_pt->interpolated_x(s_tet, x_tet);
5132 nod_pt->x(0) = x_tet[0];
5133 nod_pt->x(1) = x_tet[1];
5134 nod_pt->x(2) = x_tet[2];
5137 tet_el_pt->local_coordinate_of_node(6, s_tet);
5138 nod_pt->set_value(0, s_tet[0]);
5139 nod_pt->set_value(1, s_tet[1]);
5140 nod_pt->set_value(2, s_tet[2]);
5141 tet_el_pt->interpolated_x(s_tet, x_tet);
5142 nod_pt->x(0) = x_tet[0];
5143 nod_pt->x(1) = x_tet[1];
5144 nod_pt->x(2) = x_tet[2];
5149 s_tet[0] = 1.0 / 3.0;
5150 s_tet[1] = 1.0 / 3.0;
5152 nod_pt->set_value(0, s_tet[0]);
5153 nod_pt->set_value(1, s_tet[1]);
5154 nod_pt->set_value(2, s_tet[2]);
5155 tet_el_pt->interpolated_x(s_tet, x_tet);
5156 nod_pt->x(0) = x_tet[0];
5157 nod_pt->x(1) = x_tet[1];
5158 nod_pt->x(2) = x_tet[2];
5161 tet_el_pt->local_coordinate_of_node(5, s_tet);
5162 nod_pt->set_value(0, s_tet[0]);
5163 nod_pt->set_value(1, s_tet[1]);
5164 nod_pt->set_value(2, s_tet[2]);
5165 tet_el_pt->interpolated_x(s_tet, x_tet);
5166 nod_pt->x(0) = x_tet[0];
5167 nod_pt->x(1) = x_tet[1];
5168 nod_pt->x(2) = x_tet[2];
5173 s_tet[0] = 1.0 / 3.0;
5174 s_tet[1] = 1.0 / 3.0;
5175 s_tet[2] = 1.0 / 3.0;
5176 nod_pt->set_value(0, s_tet[0]);
5177 nod_pt->set_value(1, s_tet[1]);
5178 nod_pt->set_value(2, s_tet[2]);
5179 tet_el_pt->interpolated_x(s_tet, x_tet);
5180 nod_pt->x(0) = x_tet[0];
5181 nod_pt->x(1) = x_tet[1];
5182 nod_pt->x(2) = x_tet[2];
5187 s_tet[0] = 1.0 / 3.0;
5189 s_tet[2] = 1.0 / 3.0;
5190 nod_pt->set_value(0, s_tet[0]);
5191 nod_pt->set_value(1, s_tet[1]);
5192 nod_pt->set_value(2, s_tet[2]);
5193 tet_el_pt->interpolated_x(s_tet, x_tet);
5194 nod_pt->x(0) = x_tet[0];
5195 nod_pt->x(1) = x_tet[1];
5196 nod_pt->x(2) = x_tet[2];
5203 nod_pt->set_value(0, s_tet[0]);
5204 nod_pt->set_value(1, s_tet[1]);
5205 nod_pt->set_value(2, s_tet[2]);
5206 tet_el_pt->interpolated_x(s_tet, x_tet);
5207 nod_pt->x(0) = x_tet[0];
5208 nod_pt->x(1) = x_tet[1];
5209 nod_pt->x(2) = x_tet[2];
5216 FiniteElement* el_pt =
new ELEMENT;
5217 brick_el0_pt = el_pt;
5218 Element_pt.push_back(el_pt);
5221 tet_el_pt->node_pt(0), tet_el_pt->node_pt(1), tet_el_pt->node_pt(2));
5224 tet_el_pt->node_pt(0), tet_el_pt->node_pt(2), tet_el_pt->node_pt(3));
5227 tet_el_pt->node_pt(0), tet_el_pt->node_pt(1), tet_el_pt->node_pt(3));
5231 Vector<Vector<unsigned>> tet_edge_node(3);
5232 tet_edge_node[0].resize(2);
5233 tet_edge_node[0][0] = 4;
5234 tet_edge_node[0][1] = 1;
5235 tet_edge_node[1].resize(2);
5236 tet_edge_node[1][0] = 6;
5237 tet_edge_node[1][1] = 3;
5238 tet_edge_node[2].resize(2);
5239 tet_edge_node[2][0] = 5;
5240 tet_edge_node[2][1] = 2;
5243 unsigned central_tet_vertex = 0;
5245 Node* tet_node_pt = 0;
5246 Node* old_node_pt = 0;
5253 tet_node_pt = tet_el_pt->node_pt(central_tet_vertex);
5254 old_node_pt = tet_node_node_pt[tet_node_pt];
5255 if (old_node_pt == 0)
5257 Node* new_node_pt = 0;
5258 if (tet_node_pt->is_on_boundary())
5260 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5264 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5266 tet_node_node_pt[tet_node_pt] = new_node_pt;
5267 Node_pt.push_back(new_node_pt);
5268 Vector<double> s(3);
5269 Vector<double> s_tet(3);
5270 Vector<double> x_tet(3);
5271 el_pt->local_coordinate_of_node(j, s);
5272 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5273 tet_el_pt->interpolated_x(s_tet, x_tet);
5274 new_node_pt->x(0) = x_tet[0];
5275 new_node_pt->x(1) = x_tet[1];
5276 new_node_pt->x(2) = x_tet[2];
5281 el_pt->node_pt(j) = old_node_pt;
5291 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[0][0]);
5292 old_node_pt = tet_node_node_pt[tet_node_pt];
5293 if (old_node_pt == 0)
5295 Node* new_node_pt = 0;
5296 if (tet_node_pt->is_on_boundary())
5298 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5302 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5304 tet_node_node_pt[tet_node_pt] = new_node_pt;
5305 Node_pt.push_back(new_node_pt);
5306 Vector<double> s(3);
5307 Vector<double> s_tet(3);
5308 Vector<double> x_tet(3);
5309 el_pt->local_coordinate_of_node(j, s);
5310 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5311 tet_el_pt->interpolated_x(s_tet, x_tet);
5312 new_node_pt->x(0) = x_tet[0];
5313 new_node_pt->x(1) = x_tet[1];
5314 new_node_pt->x(2) = x_tet[2];
5319 el_pt->node_pt(j) = old_node_pt;
5329 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[1][0]);
5330 old_node_pt = tet_node_node_pt[tet_node_pt];
5331 if (old_node_pt == 0)
5333 Node* new_node_pt = 0;
5334 if (tet_node_pt->is_on_boundary())
5336 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5340 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5342 tet_node_node_pt[tet_node_pt] = new_node_pt;
5343 Node_pt.push_back(new_node_pt);
5344 Vector<double> s(3);
5345 Vector<double> s_tet(3);
5346 Vector<double> x_tet(3);
5347 el_pt->local_coordinate_of_node(j, s);
5348 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5349 tet_el_pt->interpolated_x(s_tet, x_tet);
5350 new_node_pt->x(0) = x_tet[0];
5351 new_node_pt->x(1) = x_tet[1];
5352 new_node_pt->x(2) = x_tet[2];
5357 el_pt->node_pt(j) = old_node_pt;
5367 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[2][0]);
5368 old_node_pt = tet_node_node_pt[tet_node_pt];
5369 if (old_node_pt == 0)
5371 Node* new_node_pt = 0;
5372 if (tet_node_pt->is_on_boundary())
5374 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5378 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5380 tet_node_node_pt[tet_node_pt] = new_node_pt;
5381 Node_pt.push_back(new_node_pt);
5382 Vector<double> s(3);
5383 Vector<double> s_tet(3);
5384 Vector<double> x_tet(3);
5385 el_pt->local_coordinate_of_node(j, s);
5386 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5387 tet_el_pt->interpolated_x(s_tet, x_tet);
5388 new_node_pt->x(0) = x_tet[0];
5389 new_node_pt->x(1) = x_tet[1];
5390 new_node_pt->x(2) = x_tet[2];
5395 el_pt->node_pt(j) = old_node_pt;
5406 old_node_pt = tet_face_node_pt[face0];
5407 if (old_node_pt == 0)
5409 Node* new_node_pt = 0;
5410 if (face0.is_boundary_face())
5412 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5416 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5418 tet_face_node_pt[face0] = new_node_pt;
5419 Node_pt.push_back(new_node_pt);
5420 Vector<double> s(3);
5421 Vector<double> s_tet(3);
5422 Vector<double> x_tet(3);
5423 el_pt->local_coordinate_of_node(j, s);
5424 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5425 tet_el_pt->interpolated_x(s_tet, x_tet);
5426 new_node_pt->x(0) = x_tet[0];
5427 new_node_pt->x(1) = x_tet[1];
5428 new_node_pt->x(2) = x_tet[2];
5433 el_pt->node_pt(j) = old_node_pt;
5443 old_node_pt = tet_face_node_pt[face1];
5444 if (old_node_pt == 0)
5446 Node* new_node_pt = 0;
5447 if (face1.is_boundary_face())
5449 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5453 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5455 tet_face_node_pt[face1] = new_node_pt;
5456 Node_pt.push_back(new_node_pt);
5457 Vector<double> s(3);
5458 Vector<double> s_tet(3);
5459 Vector<double> x_tet(3);
5460 el_pt->local_coordinate_of_node(j, s);
5461 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5462 tet_el_pt->interpolated_x(s_tet, x_tet);
5463 new_node_pt->x(0) = x_tet[0];
5464 new_node_pt->x(1) = x_tet[1];
5465 new_node_pt->x(2) = x_tet[2];
5470 el_pt->node_pt(j) = old_node_pt;
5480 old_node_pt = tet_face_node_pt[face2];
5481 if (old_node_pt == 0)
5483 Node* new_node_pt = 0;
5484 if (face2.is_boundary_face())
5486 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5490 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5492 tet_face_node_pt[face2] = new_node_pt;
5493 Node_pt.push_back(new_node_pt);
5494 Vector<double> s(3);
5495 Vector<double> s_tet(3);
5496 Vector<double> x_tet(3);
5497 el_pt->local_coordinate_of_node(j, s);
5498 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5499 tet_el_pt->interpolated_x(s_tet, x_tet);
5500 new_node_pt->x(0) = x_tet[0];
5501 new_node_pt->x(1) = x_tet[1];
5502 new_node_pt->x(2) = x_tet[2];
5507 el_pt->node_pt(j) = old_node_pt;
5518 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5519 centroid_node_pt = new_node_pt;
5520 Node_pt.push_back(new_node_pt);
5521 Vector<double> s(3);
5522 Vector<double> s_tet(3);
5523 Vector<double> x_tet(3);
5524 el_pt->local_coordinate_of_node(j, s);
5525 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5526 tet_el_pt->interpolated_x(s_tet, x_tet);
5527 new_node_pt->x(0) = x_tet[0];
5528 new_node_pt->x(1) = x_tet[1];
5529 new_node_pt->x(2) = x_tet[2];
5540 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5541 Node_pt.push_back(new_node_pt);
5542 Vector<double> s(3);
5543 Vector<double> s_tet(3);
5544 Vector<double> x_tet(3);
5545 el_pt->local_coordinate_of_node(j, s);
5546 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5547 tet_el_pt->interpolated_x(s_tet, x_tet);
5548 new_node_pt->x(0) = x_tet[0];
5549 new_node_pt->x(1) = x_tet[1];
5550 new_node_pt->x(2) = x_tet[2];
5559 Edge edge(el_pt->node_pt(0), el_pt->node_pt(2));
5560 old_node_pt = brick_edge_node_pt[edge];
5561 if (old_node_pt == 0)
5563 Node* new_node_pt = 0;
5564 if (edge.is_boundary_edge())
5566 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5570 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5572 brick_edge_node_pt[edge] = new_node_pt;
5573 Node_pt.push_back(new_node_pt);
5574 Vector<double> s(3);
5575 Vector<double> s_tet(3);
5576 Vector<double> x_tet(3);
5577 el_pt->local_coordinate_of_node(j, s);
5578 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5579 tet_el_pt->interpolated_x(s_tet, x_tet);
5580 new_node_pt->x(0) = x_tet[0];
5581 new_node_pt->x(1) = x_tet[1];
5582 new_node_pt->x(2) = x_tet[2];
5587 el_pt->node_pt(j) = old_node_pt;
5597 Edge edge(el_pt->node_pt(0), el_pt->node_pt(6));
5598 old_node_pt = brick_edge_node_pt[edge];
5599 if (old_node_pt == 0)
5601 Node* new_node_pt = 0;
5602 if (edge.is_boundary_edge())
5604 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5608 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5610 brick_edge_node_pt[edge] = new_node_pt;
5611 Node_pt.push_back(new_node_pt);
5612 Vector<double> s(3);
5613 Vector<double> s_tet(3);
5614 Vector<double> x_tet(3);
5615 el_pt->local_coordinate_of_node(j, s);
5616 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5617 tet_el_pt->interpolated_x(s_tet, x_tet);
5618 new_node_pt->x(0) = x_tet[0];
5619 new_node_pt->x(1) = x_tet[1];
5620 new_node_pt->x(2) = x_tet[2];
5625 el_pt->node_pt(j) = old_node_pt;
5634 Edge edge(el_pt->node_pt(2), el_pt->node_pt(8));
5635 old_node_pt = brick_edge_node_pt[edge];
5636 if (old_node_pt == 0)
5638 Node* new_node_pt = 0;
5639 if (edge.is_boundary_edge())
5641 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5645 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5647 brick_edge_node_pt[edge] = new_node_pt;
5648 Node_pt.push_back(new_node_pt);
5649 Vector<double> s(3);
5650 Vector<double> s_tet(3);
5651 Vector<double> x_tet(3);
5652 el_pt->local_coordinate_of_node(j, s);
5653 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5654 tet_el_pt->interpolated_x(s_tet, x_tet);
5655 new_node_pt->x(0) = x_tet[0];
5656 new_node_pt->x(1) = x_tet[1];
5657 new_node_pt->x(2) = x_tet[2];
5662 el_pt->node_pt(j) = old_node_pt;
5671 Edge edge(el_pt->node_pt(6), el_pt->node_pt(8));
5672 old_node_pt = brick_edge_node_pt[edge];
5673 if (old_node_pt == 0)
5675 Node* new_node_pt = 0;
5676 if (edge.is_boundary_edge())
5678 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5682 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5684 brick_edge_node_pt[edge] = new_node_pt;
5685 Node_pt.push_back(new_node_pt);
5686 Vector<double> s(3);
5687 Vector<double> s_tet(3);
5688 Vector<double> x_tet(3);
5689 el_pt->local_coordinate_of_node(j, s);
5690 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5691 tet_el_pt->interpolated_x(s_tet, x_tet);
5692 new_node_pt->x(0) = x_tet[0];
5693 new_node_pt->x(1) = x_tet[1];
5694 new_node_pt->x(2) = x_tet[2];
5699 el_pt->node_pt(j) = old_node_pt;
5708 Edge edge(el_pt->node_pt(18), el_pt->node_pt(20));
5709 old_node_pt = brick_edge_node_pt[edge];
5710 if (old_node_pt == 0)
5712 Node* new_node_pt = 0;
5713 if (edge.is_boundary_edge())
5715 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5719 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5721 brick_edge_node_pt[edge] = new_node_pt;
5722 Node_pt.push_back(new_node_pt);
5723 Vector<double> s(3);
5724 Vector<double> s_tet(3);
5725 Vector<double> x_tet(3);
5726 el_pt->local_coordinate_of_node(j, s);
5727 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5728 tet_el_pt->interpolated_x(s_tet, x_tet);
5729 new_node_pt->x(0) = x_tet[0];
5730 new_node_pt->x(1) = x_tet[1];
5731 new_node_pt->x(2) = x_tet[2];
5736 el_pt->node_pt(j) = old_node_pt;
5746 Edge edge(el_pt->node_pt(18), el_pt->node_pt(24));
5747 old_node_pt = brick_edge_node_pt[edge];
5748 if (old_node_pt == 0)
5750 Node* new_node_pt = 0;
5751 if (edge.is_boundary_edge())
5753 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5757 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5759 brick_edge_node_pt[edge] = new_node_pt;
5760 Node_pt.push_back(new_node_pt);
5761 Vector<double> s(3);
5762 Vector<double> s_tet(3);
5763 Vector<double> x_tet(3);
5764 el_pt->local_coordinate_of_node(j, s);
5765 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5766 tet_el_pt->interpolated_x(s_tet, x_tet);
5767 new_node_pt->x(0) = x_tet[0];
5768 new_node_pt->x(1) = x_tet[1];
5769 new_node_pt->x(2) = x_tet[2];
5774 el_pt->node_pt(j) = old_node_pt;
5783 Edge edge(el_pt->node_pt(20), el_pt->node_pt(26));
5784 old_node_pt = brick_edge_node_pt[edge];
5785 if (old_node_pt == 0)
5787 Node* new_node_pt = 0;
5788 if (edge.is_boundary_edge())
5790 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5794 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5796 brick_edge_node_pt[edge] = new_node_pt;
5797 Node_pt.push_back(new_node_pt);
5798 Vector<double> s(3);
5799 Vector<double> s_tet(3);
5800 Vector<double> x_tet(3);
5801 el_pt->local_coordinate_of_node(j, s);
5802 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5803 tet_el_pt->interpolated_x(s_tet, x_tet);
5804 new_node_pt->x(0) = x_tet[0];
5805 new_node_pt->x(1) = x_tet[1];
5806 new_node_pt->x(2) = x_tet[2];
5811 el_pt->node_pt(j) = old_node_pt;
5821 Edge edge(el_pt->node_pt(24), el_pt->node_pt(26));
5822 old_node_pt = brick_edge_node_pt[edge];
5823 if (old_node_pt == 0)
5825 Node* new_node_pt = 0;
5826 if (edge.is_boundary_edge())
5828 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5832 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5834 brick_edge_node_pt[edge] = new_node_pt;
5835 Node_pt.push_back(new_node_pt);
5836 Vector<double> s(3);
5837 Vector<double> s_tet(3);
5838 Vector<double> x_tet(3);
5839 el_pt->local_coordinate_of_node(j, s);
5840 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5841 tet_el_pt->interpolated_x(s_tet, x_tet);
5842 new_node_pt->x(0) = x_tet[0];
5843 new_node_pt->x(1) = x_tet[1];
5844 new_node_pt->x(2) = x_tet[2];
5849 el_pt->node_pt(j) = old_node_pt;
5858 Edge edge(el_pt->node_pt(0), el_pt->node_pt(18));
5859 old_node_pt = brick_edge_node_pt[edge];
5860 if (old_node_pt == 0)
5862 Node* new_node_pt = 0;
5863 if (edge.is_boundary_edge())
5865 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5869 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5871 brick_edge_node_pt[edge] = new_node_pt;
5872 Node_pt.push_back(new_node_pt);
5873 Vector<double> s(3);
5874 Vector<double> s_tet(3);
5875 Vector<double> x_tet(3);
5876 el_pt->local_coordinate_of_node(j, s);
5877 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5878 tet_el_pt->interpolated_x(s_tet, x_tet);
5879 new_node_pt->x(0) = x_tet[0];
5880 new_node_pt->x(1) = x_tet[1];
5881 new_node_pt->x(2) = x_tet[2];
5886 el_pt->node_pt(j) = old_node_pt;
5896 Edge edge(el_pt->node_pt(2), el_pt->node_pt(20));
5897 old_node_pt = brick_edge_node_pt[edge];
5898 if (old_node_pt == 0)
5900 Node* new_node_pt = 0;
5901 if (edge.is_boundary_edge())
5903 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5907 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5909 brick_edge_node_pt[edge] = new_node_pt;
5910 Node_pt.push_back(new_node_pt);
5911 Vector<double> s(3);
5912 Vector<double> s_tet(3);
5913 Vector<double> x_tet(3);
5914 el_pt->local_coordinate_of_node(j, s);
5915 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5916 tet_el_pt->interpolated_x(s_tet, x_tet);
5917 new_node_pt->x(0) = x_tet[0];
5918 new_node_pt->x(1) = x_tet[1];
5919 new_node_pt->x(2) = x_tet[2];
5924 el_pt->node_pt(j) = old_node_pt;
5934 Edge edge(el_pt->node_pt(6), el_pt->node_pt(24));
5935 old_node_pt = brick_edge_node_pt[edge];
5936 if (old_node_pt == 0)
5938 Node* new_node_pt = 0;
5939 if (edge.is_boundary_edge())
5941 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5945 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5947 brick_edge_node_pt[edge] = new_node_pt;
5948 Node_pt.push_back(new_node_pt);
5949 Vector<double> s(3);
5950 Vector<double> s_tet(3);
5951 Vector<double> x_tet(3);
5952 el_pt->local_coordinate_of_node(j, s);
5953 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5954 tet_el_pt->interpolated_x(s_tet, x_tet);
5955 new_node_pt->x(0) = x_tet[0];
5956 new_node_pt->x(1) = x_tet[1];
5957 new_node_pt->x(2) = x_tet[2];
5962 el_pt->node_pt(j) = old_node_pt;
5972 Edge edge(el_pt->node_pt(8), el_pt->node_pt(26));
5973 old_node_pt = brick_edge_node_pt[edge];
5974 if (old_node_pt == 0)
5976 Node* new_node_pt = 0;
5977 if (edge.is_boundary_edge())
5979 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
5983 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
5985 brick_edge_node_pt[edge] = new_node_pt;
5986 Node_pt.push_back(new_node_pt);
5987 Vector<double> s(3);
5988 Vector<double> s_tet(3);
5989 Vector<double> x_tet(3);
5990 el_pt->local_coordinate_of_node(j, s);
5991 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
5992 tet_el_pt->interpolated_x(s_tet, x_tet);
5993 new_node_pt->x(0) = x_tet[0];
5994 new_node_pt->x(1) = x_tet[1];
5995 new_node_pt->x(2) = x_tet[2];
6000 el_pt->node_pt(j) = old_node_pt;
6011 TFace face(tet_el_pt->node_pt(central_tet_vertex),
6012 tet_el_pt->node_pt(tet_edge_node[0][0]),
6013 tet_el_pt->node_pt(tet_edge_node[2][0]));
6015 old_node_pt = tet_face_node_pt[face];
6016 if (old_node_pt == 0)
6018 Node* new_node_pt = 0;
6019 if (face.is_boundary_face())
6021 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6025 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6027 tet_face_node_pt[face] = new_node_pt;
6028 Node_pt.push_back(new_node_pt);
6029 Vector<double> s(3);
6030 Vector<double> s_tet(3);
6031 Vector<double> x_tet(3);
6032 el_pt->local_coordinate_of_node(j, s);
6033 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
6034 tet_el_pt->interpolated_x(s_tet, x_tet);
6035 new_node_pt->x(0) = x_tet[0];
6036 new_node_pt->x(1) = x_tet[1];
6037 new_node_pt->x(2) = x_tet[2];
6042 el_pt->node_pt(j) = old_node_pt;
6053 TFace face(tet_el_pt->node_pt(central_tet_vertex),
6054 tet_el_pt->node_pt(tet_edge_node[1][0]),
6055 tet_el_pt->node_pt(tet_edge_node[2][0]));
6057 old_node_pt = tet_face_node_pt[face];
6058 if (old_node_pt == 0)
6060 Node* new_node_pt = 0;
6061 if (face.is_boundary_face())
6063 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6067 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6069 tet_face_node_pt[face] = new_node_pt;
6070 Node_pt.push_back(new_node_pt);
6071 Vector<double> s(3);
6072 Vector<double> s_tet(3);
6073 Vector<double> x_tet(3);
6074 el_pt->local_coordinate_of_node(j, s);
6075 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
6076 tet_el_pt->interpolated_x(s_tet, x_tet);
6077 new_node_pt->x(0) = x_tet[0];
6078 new_node_pt->x(1) = x_tet[1];
6079 new_node_pt->x(2) = x_tet[2];
6084 el_pt->node_pt(j) = old_node_pt;
6095 TFace face(tet_el_pt->node_pt(central_tet_vertex),
6096 tet_el_pt->node_pt(tet_edge_node[0][0]),
6097 tet_el_pt->node_pt(tet_edge_node[1][0]));
6099 old_node_pt = tet_face_node_pt[face];
6100 if (old_node_pt == 0)
6102 Node* new_node_pt = 0;
6103 if (face.is_boundary_face())
6105 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6109 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6111 tet_face_node_pt[face] = new_node_pt;
6112 Node_pt.push_back(new_node_pt);
6113 Vector<double> s(3);
6114 Vector<double> s_tet(3);
6115 Vector<double> x_tet(3);
6116 el_pt->local_coordinate_of_node(j, s);
6117 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
6118 tet_el_pt->interpolated_x(s_tet, x_tet);
6119 new_node_pt->x(0) = x_tet[0];
6120 new_node_pt->x(1) = x_tet[1];
6121 new_node_pt->x(2) = x_tet[2];
6126 el_pt->node_pt(j) = old_node_pt;
6134 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6135 Node_pt.push_back(new_node_pt);
6136 Vector<double> s(3);
6137 Vector<double> s_tet(3);
6138 Vector<double> x_tet(3);
6139 el_pt->local_coordinate_of_node(j, s);
6140 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
6141 top_mid_face_node0_pt = new_node_pt;
6142 tet_el_pt->interpolated_x(s_tet, x_tet);
6143 new_node_pt->x(0) = x_tet[0];
6144 new_node_pt->x(1) = x_tet[1];
6145 new_node_pt->x(2) = x_tet[2];
6152 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6153 Node_pt.push_back(new_node_pt);
6154 Vector<double> s(3);
6155 Vector<double> s_tet(3);
6156 Vector<double> x_tet(3);
6157 el_pt->local_coordinate_of_node(j, s);
6158 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
6159 right_mid_face_node0_pt = new_node_pt;
6160 tet_el_pt->interpolated_x(s_tet, x_tet);
6161 new_node_pt->x(0) = x_tet[0];
6162 new_node_pt->x(1) = x_tet[1];
6163 new_node_pt->x(2) = x_tet[2];
6170 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6171 Node_pt.push_back(new_node_pt);
6172 Vector<double> s(3);
6173 Vector<double> s_tet(3);
6174 Vector<double> x_tet(3);
6175 el_pt->local_coordinate_of_node(j, s);
6176 dummy_q_el_pt[0]->interpolated_s_tet(s, s_tet);
6177 back_mid_face_node0_pt = new_node_pt;
6178 tet_el_pt->interpolated_x(s_tet, x_tet);
6179 new_node_pt->x(0) = x_tet[0];
6180 new_node_pt->x(1) = x_tet[1];
6181 new_node_pt->x(2) = x_tet[2];
6190 for (
unsigned j = 0; j < 8; j++)
6192 Node* nod_pt = dummy_q_el_pt[1]->node_pt(j);
6193 Vector<double> s_tet(3);
6194 Vector<double> x_tet(3);
6198 tet_el_pt->local_coordinate_of_node(1, s_tet);
6199 nod_pt->set_value(0, s_tet[0]);
6200 nod_pt->set_value(1, s_tet[1]);
6201 nod_pt->set_value(2, s_tet[2]);
6202 tet_el_pt->interpolated_x(s_tet, x_tet);
6203 nod_pt->x(0) = x_tet[0];
6204 nod_pt->x(1) = x_tet[1];
6205 nod_pt->x(2) = x_tet[2];
6208 tet_el_pt->local_coordinate_of_node(9, s_tet);
6209 nod_pt->set_value(0, s_tet[0]);
6210 nod_pt->set_value(1, s_tet[1]);
6211 nod_pt->set_value(2, s_tet[2]);
6212 tet_el_pt->interpolated_x(s_tet, x_tet);
6213 nod_pt->x(0) = x_tet[0];
6214 nod_pt->x(1) = x_tet[1];
6215 nod_pt->x(2) = x_tet[2];
6218 tet_el_pt->local_coordinate_of_node(4, s_tet);
6219 nod_pt->set_value(0, s_tet[0]);
6220 nod_pt->set_value(1, s_tet[1]);
6221 nod_pt->set_value(2, s_tet[2]);
6222 tet_el_pt->interpolated_x(s_tet, x_tet);
6223 nod_pt->x(0) = x_tet[0];
6224 nod_pt->x(1) = x_tet[1];
6225 nod_pt->x(2) = x_tet[2];
6230 s_tet[0] = 1.0 / 3.0;
6231 s_tet[1] = 1.0 / 3.0;
6233 nod_pt->set_value(0, s_tet[0]);
6234 nod_pt->set_value(1, s_tet[1]);
6235 nod_pt->set_value(2, s_tet[2]);
6236 tet_el_pt->interpolated_x(s_tet, x_tet);
6237 nod_pt->x(0) = x_tet[0];
6238 nod_pt->x(1) = x_tet[1];
6239 nod_pt->x(2) = x_tet[2];
6242 tet_el_pt->local_coordinate_of_node(7, s_tet);
6243 nod_pt->set_value(0, s_tet[0]);
6244 nod_pt->set_value(1, s_tet[1]);
6245 nod_pt->set_value(2, s_tet[2]);
6246 tet_el_pt->interpolated_x(s_tet, x_tet);
6247 nod_pt->x(0) = x_tet[0];
6248 nod_pt->x(1) = x_tet[1];
6249 nod_pt->x(2) = x_tet[2];
6255 s_tet[1] = 1.0 / 3.0;
6256 s_tet[2] = 1.0 / 3.0;
6257 nod_pt->set_value(0, s_tet[0]);
6258 nod_pt->set_value(1, s_tet[1]);
6259 nod_pt->set_value(2, s_tet[2]);
6260 tet_el_pt->interpolated_x(s_tet, x_tet);
6261 nod_pt->x(0) = x_tet[0];
6262 nod_pt->x(1) = x_tet[1];
6263 nod_pt->x(2) = x_tet[2];
6268 s_tet[0] = 1.0 / 3.0;
6269 s_tet[1] = 1.0 / 3.0;
6270 s_tet[2] = 1.0 / 3.0;
6271 nod_pt->set_value(0, s_tet[0]);
6272 nod_pt->set_value(1, s_tet[1]);
6273 nod_pt->set_value(2, s_tet[2]);
6274 tet_el_pt->interpolated_x(s_tet, x_tet);
6275 nod_pt->x(0) = x_tet[0];
6276 nod_pt->x(1) = x_tet[1];
6277 nod_pt->x(2) = x_tet[2];
6284 nod_pt->set_value(0, s_tet[0]);
6285 nod_pt->set_value(1, s_tet[1]);
6286 nod_pt->set_value(2, s_tet[2]);
6287 tet_el_pt->interpolated_x(s_tet, x_tet);
6288 nod_pt->x(0) = x_tet[0];
6289 nod_pt->x(1) = x_tet[1];
6290 nod_pt->x(2) = x_tet[2];
6297 FiniteElement* el_pt =
new ELEMENT;
6298 brick_el1_pt = el_pt;
6299 Element_pt.push_back(el_pt);
6302 tet_el_pt->node_pt(1), tet_el_pt->node_pt(3), tet_el_pt->node_pt(2));
6305 tet_el_pt->node_pt(1), tet_el_pt->node_pt(0), tet_el_pt->node_pt(2));
6308 tet_el_pt->node_pt(1), tet_el_pt->node_pt(0), tet_el_pt->node_pt(3));
6311 Vector<Vector<unsigned>> tet_edge_node(3);
6312 tet_edge_node[0].resize(2);
6313 tet_edge_node[0][0] = 9;
6314 tet_edge_node[0][1] = 3;
6315 tet_edge_node[1].resize(2);
6316 tet_edge_node[1][0] = 4;
6317 tet_edge_node[1][1] = 0;
6318 tet_edge_node[2].resize(2);
6319 tet_edge_node[2][0] = 7;
6320 tet_edge_node[2][1] = 2;
6323 unsigned central_tet_vertex = 1;
6325 Node* tet_node_pt = 0;
6326 Node* old_node_pt = 0;
6333 tet_node_pt = tet_el_pt->node_pt(central_tet_vertex);
6334 old_node_pt = tet_node_node_pt[tet_node_pt];
6335 if (old_node_pt == 0)
6337 Node* new_node_pt = 0;
6338 if (tet_node_pt->is_on_boundary())
6340 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6344 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6346 tet_node_node_pt[tet_node_pt] = new_node_pt;
6347 Node_pt.push_back(new_node_pt);
6348 Vector<double> s(3);
6349 Vector<double> s_tet(3);
6350 Vector<double> x_tet(3);
6351 el_pt->local_coordinate_of_node(j, s);
6352 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6353 tet_el_pt->interpolated_x(s_tet, x_tet);
6354 new_node_pt->x(0) = x_tet[0];
6355 new_node_pt->x(1) = x_tet[1];
6356 new_node_pt->x(2) = x_tet[2];
6361 el_pt->node_pt(j) = old_node_pt;
6371 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[0][0]);
6372 old_node_pt = tet_node_node_pt[tet_node_pt];
6373 if (old_node_pt == 0)
6375 Node* new_node_pt = 0;
6376 if (tet_node_pt->is_on_boundary())
6378 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6382 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6384 tet_node_node_pt[tet_node_pt] = new_node_pt;
6385 Node_pt.push_back(new_node_pt);
6386 Vector<double> s(3);
6387 Vector<double> s_tet(3);
6388 Vector<double> x_tet(3);
6389 el_pt->local_coordinate_of_node(j, s);
6390 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6391 tet_el_pt->interpolated_x(s_tet, x_tet);
6392 new_node_pt->x(0) = x_tet[0];
6393 new_node_pt->x(1) = x_tet[1];
6394 new_node_pt->x(2) = x_tet[2];
6399 el_pt->node_pt(j) = old_node_pt;
6409 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[1][0]);
6410 old_node_pt = tet_node_node_pt[tet_node_pt];
6411 if (old_node_pt == 0)
6413 Node* new_node_pt = 0;
6414 if (tet_node_pt->is_on_boundary())
6416 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6420 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6422 tet_node_node_pt[tet_node_pt] = new_node_pt;
6423 Node_pt.push_back(new_node_pt);
6424 Vector<double> s(3);
6425 Vector<double> s_tet(3);
6426 Vector<double> x_tet(3);
6427 el_pt->local_coordinate_of_node(j, s);
6428 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6429 tet_el_pt->interpolated_x(s_tet, x_tet);
6430 new_node_pt->x(0) = x_tet[0];
6431 new_node_pt->x(1) = x_tet[1];
6432 new_node_pt->x(2) = x_tet[2];
6437 el_pt->node_pt(j) = old_node_pt;
6447 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[2][0]);
6448 old_node_pt = tet_node_node_pt[tet_node_pt];
6449 if (old_node_pt == 0)
6451 Node* new_node_pt = 0;
6452 if (tet_node_pt->is_on_boundary())
6454 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6458 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6460 tet_node_node_pt[tet_node_pt] = new_node_pt;
6461 Node_pt.push_back(new_node_pt);
6462 Vector<double> s(3);
6463 Vector<double> s_tet(3);
6464 Vector<double> x_tet(3);
6465 el_pt->local_coordinate_of_node(j, s);
6466 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6467 tet_el_pt->interpolated_x(s_tet, x_tet);
6468 new_node_pt->x(0) = x_tet[0];
6469 new_node_pt->x(1) = x_tet[1];
6470 new_node_pt->x(2) = x_tet[2];
6475 el_pt->node_pt(j) = old_node_pt;
6485 old_node_pt = tet_face_node_pt[face0];
6486 if (old_node_pt == 0)
6488 Node* new_node_pt = 0;
6489 if (face0.is_boundary_face())
6491 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6495 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6497 tet_face_node_pt[face0] = new_node_pt;
6498 Node_pt.push_back(new_node_pt);
6499 Vector<double> s(3);
6500 Vector<double> s_tet(3);
6501 Vector<double> x_tet(3);
6502 el_pt->local_coordinate_of_node(j, s);
6503 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6504 tet_el_pt->interpolated_x(s_tet, x_tet);
6505 new_node_pt->x(0) = x_tet[0];
6506 new_node_pt->x(1) = x_tet[1];
6507 new_node_pt->x(2) = x_tet[2];
6512 el_pt->node_pt(j) = old_node_pt;
6521 old_node_pt = tet_face_node_pt[face1];
6522 if (old_node_pt == 0)
6524 Node* new_node_pt = 0;
6525 if (face1.is_boundary_face())
6527 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6531 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6533 tet_face_node_pt[face1] = new_node_pt;
6534 Node_pt.push_back(new_node_pt);
6535 Vector<double> s(3);
6536 Vector<double> s_tet(3);
6537 Vector<double> x_tet(3);
6538 el_pt->local_coordinate_of_node(j, s);
6539 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6540 tet_el_pt->interpolated_x(s_tet, x_tet);
6541 new_node_pt->x(0) = x_tet[0];
6542 new_node_pt->x(1) = x_tet[1];
6543 new_node_pt->x(2) = x_tet[2];
6548 el_pt->node_pt(j) = old_node_pt;
6557 old_node_pt = tet_face_node_pt[face2];
6558 if (old_node_pt == 0)
6560 Node* new_node_pt = 0;
6561 if (face2.is_boundary_face())
6563 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6567 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6569 tet_face_node_pt[face2] = new_node_pt;
6570 Node_pt.push_back(new_node_pt);
6571 Vector<double> s(3);
6572 Vector<double> s_tet(3);
6573 Vector<double> x_tet(3);
6574 el_pt->local_coordinate_of_node(j, s);
6575 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6576 tet_el_pt->interpolated_x(s_tet, x_tet);
6577 new_node_pt->x(0) = x_tet[0];
6578 new_node_pt->x(1) = x_tet[1];
6579 new_node_pt->x(2) = x_tet[2];
6584 el_pt->node_pt(j) = old_node_pt;
6595 el_pt->node_pt(j) = centroid_node_pt;
6605 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6606 Node_pt.push_back(new_node_pt);
6607 Vector<double> s(3);
6608 Vector<double> s_tet(3);
6609 Vector<double> x_tet(3);
6610 el_pt->local_coordinate_of_node(j, s);
6611 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6612 tet_el_pt->interpolated_x(s_tet, x_tet);
6613 new_node_pt->x(0) = x_tet[0];
6614 new_node_pt->x(1) = x_tet[1];
6615 new_node_pt->x(2) = x_tet[2];
6625 Edge edge(el_pt->node_pt(0), el_pt->node_pt(2));
6626 old_node_pt = brick_edge_node_pt[edge];
6627 if (old_node_pt == 0)
6629 Node* new_node_pt = 0;
6630 if (edge.is_boundary_edge())
6632 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6636 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6638 brick_edge_node_pt[edge] = new_node_pt;
6639 Node_pt.push_back(new_node_pt);
6640 Vector<double> s(3);
6641 Vector<double> s_tet(3);
6642 Vector<double> x_tet(3);
6643 el_pt->local_coordinate_of_node(j, s);
6644 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6645 tet_el_pt->interpolated_x(s_tet, x_tet);
6646 new_node_pt->x(0) = x_tet[0];
6647 new_node_pt->x(1) = x_tet[1];
6648 new_node_pt->x(2) = x_tet[2];
6653 el_pt->node_pt(j) = old_node_pt;
6663 Edge edge(el_pt->node_pt(0), el_pt->node_pt(6));
6664 old_node_pt = brick_edge_node_pt[edge];
6665 if (old_node_pt == 0)
6667 Node* new_node_pt = 0;
6668 if (edge.is_boundary_edge())
6670 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6674 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6676 brick_edge_node_pt[edge] = new_node_pt;
6677 Node_pt.push_back(new_node_pt);
6678 Vector<double> s(3);
6679 Vector<double> s_tet(3);
6680 Vector<double> x_tet(3);
6681 el_pt->local_coordinate_of_node(j, s);
6682 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6683 tet_el_pt->interpolated_x(s_tet, x_tet);
6684 new_node_pt->x(0) = x_tet[0];
6685 new_node_pt->x(1) = x_tet[1];
6686 new_node_pt->x(2) = x_tet[2];
6691 el_pt->node_pt(j) = old_node_pt;
6701 Edge edge(el_pt->node_pt(2), el_pt->node_pt(8));
6702 old_node_pt = brick_edge_node_pt[edge];
6703 if (old_node_pt == 0)
6705 Node* new_node_pt = 0;
6706 if (edge.is_boundary_edge())
6708 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6712 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6714 brick_edge_node_pt[edge] = new_node_pt;
6715 Node_pt.push_back(new_node_pt);
6716 Vector<double> s(3);
6717 Vector<double> s_tet(3);
6718 Vector<double> x_tet(3);
6719 el_pt->local_coordinate_of_node(j, s);
6720 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6721 tet_el_pt->interpolated_x(s_tet, x_tet);
6722 new_node_pt->x(0) = x_tet[0];
6723 new_node_pt->x(1) = x_tet[1];
6724 new_node_pt->x(2) = x_tet[2];
6729 el_pt->node_pt(j) = old_node_pt;
6738 Edge edge(el_pt->node_pt(6), el_pt->node_pt(8));
6739 old_node_pt = brick_edge_node_pt[edge];
6740 if (old_node_pt == 0)
6742 Node* new_node_pt = 0;
6743 if (edge.is_boundary_edge())
6745 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6749 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6751 brick_edge_node_pt[edge] = new_node_pt;
6752 Node_pt.push_back(new_node_pt);
6753 Vector<double> s(3);
6754 Vector<double> s_tet(3);
6755 Vector<double> x_tet(3);
6756 el_pt->local_coordinate_of_node(j, s);
6757 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6758 tet_el_pt->interpolated_x(s_tet, x_tet);
6759 new_node_pt->x(0) = x_tet[0];
6760 new_node_pt->x(1) = x_tet[1];
6761 new_node_pt->x(2) = x_tet[2];
6766 el_pt->node_pt(j) = old_node_pt;
6775 Edge edge(el_pt->node_pt(18), el_pt->node_pt(20));
6776 old_node_pt = brick_edge_node_pt[edge];
6777 if (old_node_pt == 0)
6779 Node* new_node_pt = 0;
6780 if (edge.is_boundary_edge())
6782 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6786 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6788 brick_edge_node_pt[edge] = new_node_pt;
6789 Node_pt.push_back(new_node_pt);
6790 Vector<double> s(3);
6791 Vector<double> s_tet(3);
6792 Vector<double> x_tet(3);
6793 el_pt->local_coordinate_of_node(j, s);
6794 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6795 tet_el_pt->interpolated_x(s_tet, x_tet);
6796 new_node_pt->x(0) = x_tet[0];
6797 new_node_pt->x(1) = x_tet[1];
6798 new_node_pt->x(2) = x_tet[2];
6803 el_pt->node_pt(j) = old_node_pt;
6813 Edge edge(el_pt->node_pt(18), el_pt->node_pt(24));
6814 old_node_pt = brick_edge_node_pt[edge];
6815 if (old_node_pt == 0)
6817 Node* new_node_pt = 0;
6818 if (edge.is_boundary_edge())
6820 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6824 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6826 brick_edge_node_pt[edge] = new_node_pt;
6827 Node_pt.push_back(new_node_pt);
6828 Vector<double> s(3);
6829 Vector<double> s_tet(3);
6830 Vector<double> x_tet(3);
6831 el_pt->local_coordinate_of_node(j, s);
6832 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6833 tet_el_pt->interpolated_x(s_tet, x_tet);
6834 new_node_pt->x(0) = x_tet[0];
6835 new_node_pt->x(1) = x_tet[1];
6836 new_node_pt->x(2) = x_tet[2];
6841 el_pt->node_pt(j) = old_node_pt;
6850 Edge edge(el_pt->node_pt(20), el_pt->node_pt(26));
6851 old_node_pt = brick_edge_node_pt[edge];
6852 if (old_node_pt == 0)
6854 Node* new_node_pt = 0;
6855 if (edge.is_boundary_edge())
6857 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6861 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6863 brick_edge_node_pt[edge] = new_node_pt;
6864 Node_pt.push_back(new_node_pt);
6865 Vector<double> s(3);
6866 Vector<double> s_tet(3);
6867 Vector<double> x_tet(3);
6868 el_pt->local_coordinate_of_node(j, s);
6869 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6870 tet_el_pt->interpolated_x(s_tet, x_tet);
6871 new_node_pt->x(0) = x_tet[0];
6872 new_node_pt->x(1) = x_tet[1];
6873 new_node_pt->x(2) = x_tet[2];
6878 el_pt->node_pt(j) = old_node_pt;
6888 Edge edge(el_pt->node_pt(24), el_pt->node_pt(26));
6889 old_node_pt = brick_edge_node_pt[edge];
6890 if (old_node_pt == 0)
6892 Node* new_node_pt = 0;
6893 if (edge.is_boundary_edge())
6895 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6899 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6901 brick_edge_node_pt[edge] = new_node_pt;
6902 Node_pt.push_back(new_node_pt);
6903 Vector<double> s(3);
6904 Vector<double> s_tet(3);
6905 Vector<double> x_tet(3);
6906 el_pt->local_coordinate_of_node(j, s);
6907 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6908 tet_el_pt->interpolated_x(s_tet, x_tet);
6909 new_node_pt->x(0) = x_tet[0];
6910 new_node_pt->x(1) = x_tet[1];
6911 new_node_pt->x(2) = x_tet[2];
6916 el_pt->node_pt(j) = old_node_pt;
6925 Edge edge(el_pt->node_pt(0), el_pt->node_pt(18));
6926 old_node_pt = brick_edge_node_pt[edge];
6927 if (old_node_pt == 0)
6929 Node* new_node_pt = 0;
6930 if (edge.is_boundary_edge())
6932 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6936 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6938 brick_edge_node_pt[edge] = new_node_pt;
6939 Node_pt.push_back(new_node_pt);
6940 Vector<double> s(3);
6941 Vector<double> s_tet(3);
6942 Vector<double> x_tet(3);
6943 el_pt->local_coordinate_of_node(j, s);
6944 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6945 tet_el_pt->interpolated_x(s_tet, x_tet);
6946 new_node_pt->x(0) = x_tet[0];
6947 new_node_pt->x(1) = x_tet[1];
6948 new_node_pt->x(2) = x_tet[2];
6953 el_pt->node_pt(j) = old_node_pt;
6963 Edge edge(el_pt->node_pt(2), el_pt->node_pt(20));
6964 old_node_pt = brick_edge_node_pt[edge];
6965 if (old_node_pt == 0)
6967 Node* new_node_pt = 0;
6968 if (edge.is_boundary_edge())
6970 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
6974 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
6976 brick_edge_node_pt[edge] = new_node_pt;
6977 Node_pt.push_back(new_node_pt);
6978 Vector<double> s(3);
6979 Vector<double> s_tet(3);
6980 Vector<double> x_tet(3);
6981 el_pt->local_coordinate_of_node(j, s);
6982 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
6983 tet_el_pt->interpolated_x(s_tet, x_tet);
6984 new_node_pt->x(0) = x_tet[0];
6985 new_node_pt->x(1) = x_tet[1];
6986 new_node_pt->x(2) = x_tet[2];
6991 el_pt->node_pt(j) = old_node_pt;
7001 Edge edge(el_pt->node_pt(6), el_pt->node_pt(24));
7002 old_node_pt = brick_edge_node_pt[edge];
7003 if (old_node_pt == 0)
7005 Node* new_node_pt = 0;
7006 if (edge.is_boundary_edge())
7008 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7012 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7014 brick_edge_node_pt[edge] = new_node_pt;
7015 Node_pt.push_back(new_node_pt);
7016 Vector<double> s(3);
7017 Vector<double> s_tet(3);
7018 Vector<double> x_tet(3);
7019 el_pt->local_coordinate_of_node(j, s);
7020 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
7021 tet_el_pt->interpolated_x(s_tet, x_tet);
7022 new_node_pt->x(0) = x_tet[0];
7023 new_node_pt->x(1) = x_tet[1];
7024 new_node_pt->x(2) = x_tet[2];
7029 el_pt->node_pt(j) = old_node_pt;
7039 Edge edge(el_pt->node_pt(8), el_pt->node_pt(26));
7040 old_node_pt = brick_edge_node_pt[edge];
7041 if (old_node_pt == 0)
7043 Node* new_node_pt = 0;
7044 if (edge.is_boundary_edge())
7046 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7050 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7052 brick_edge_node_pt[edge] = new_node_pt;
7053 Node_pt.push_back(new_node_pt);
7054 Vector<double> s(3);
7055 Vector<double> s_tet(3);
7056 Vector<double> x_tet(3);
7057 el_pt->local_coordinate_of_node(j, s);
7058 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
7059 tet_el_pt->interpolated_x(s_tet, x_tet);
7060 new_node_pt->x(0) = x_tet[0];
7061 new_node_pt->x(1) = x_tet[1];
7062 new_node_pt->x(2) = x_tet[2];
7067 el_pt->node_pt(j) = old_node_pt;
7078 TFace face(tet_el_pt->node_pt(central_tet_vertex),
7079 tet_el_pt->node_pt(tet_edge_node[0][0]),
7080 tet_el_pt->node_pt(tet_edge_node[2][0]));
7082 old_node_pt = tet_face_node_pt[face];
7083 if (old_node_pt == 0)
7085 Node* new_node_pt = 0;
7086 if (face.is_boundary_face())
7088 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7092 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7094 tet_face_node_pt[face] = new_node_pt;
7095 Node_pt.push_back(new_node_pt);
7096 Vector<double> s(3);
7097 Vector<double> s_tet(3);
7098 Vector<double> x_tet(3);
7099 el_pt->local_coordinate_of_node(j, s);
7100 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
7101 tet_el_pt->interpolated_x(s_tet, x_tet);
7102 new_node_pt->x(0) = x_tet[0];
7103 new_node_pt->x(1) = x_tet[1];
7104 new_node_pt->x(2) = x_tet[2];
7109 el_pt->node_pt(j) = old_node_pt;
7120 TFace face(tet_el_pt->node_pt(central_tet_vertex),
7121 tet_el_pt->node_pt(tet_edge_node[1][0]),
7122 tet_el_pt->node_pt(tet_edge_node[2][0]));
7124 old_node_pt = tet_face_node_pt[face];
7125 if (old_node_pt == 0)
7127 Node* new_node_pt = 0;
7128 if (face.is_boundary_face())
7130 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7134 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7136 tet_face_node_pt[face] = new_node_pt;
7137 Node_pt.push_back(new_node_pt);
7138 Vector<double> s(3);
7139 Vector<double> s_tet(3);
7140 Vector<double> x_tet(3);
7141 el_pt->local_coordinate_of_node(j, s);
7142 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
7143 tet_el_pt->interpolated_x(s_tet, x_tet);
7144 new_node_pt->x(0) = x_tet[0];
7145 new_node_pt->x(1) = x_tet[1];
7146 new_node_pt->x(2) = x_tet[2];
7151 el_pt->node_pt(j) = old_node_pt;
7162 TFace face(tet_el_pt->node_pt(central_tet_vertex),
7163 tet_el_pt->node_pt(tet_edge_node[0][0]),
7164 tet_el_pt->node_pt(tet_edge_node[1][0]));
7166 old_node_pt = tet_face_node_pt[face];
7167 if (old_node_pt == 0)
7169 Node* new_node_pt = 0;
7170 if (face.is_boundary_face())
7172 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7176 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7178 tet_face_node_pt[face] = new_node_pt;
7179 Node_pt.push_back(new_node_pt);
7180 Vector<double> s(3);
7181 Vector<double> s_tet(3);
7182 Vector<double> x_tet(3);
7183 el_pt->local_coordinate_of_node(j, s);
7184 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
7185 tet_el_pt->interpolated_x(s_tet, x_tet);
7186 new_node_pt->x(0) = x_tet[0];
7187 new_node_pt->x(1) = x_tet[1];
7188 new_node_pt->x(2) = x_tet[2];
7193 el_pt->node_pt(j) = old_node_pt;
7201 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7202 Node_pt.push_back(new_node_pt);
7203 Vector<double> s(3);
7204 Vector<double> s_tet(3);
7205 Vector<double> x_tet(3);
7206 el_pt->local_coordinate_of_node(j, s);
7207 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
7208 top_mid_face_node1_pt = new_node_pt;
7209 tet_el_pt->interpolated_x(s_tet, x_tet);
7210 new_node_pt->x(0) = x_tet[0];
7211 new_node_pt->x(1) = x_tet[1];
7212 new_node_pt->x(2) = x_tet[2];
7219 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7220 Node_pt.push_back(new_node_pt);
7221 Vector<double> s(3);
7222 Vector<double> s_tet(3);
7223 Vector<double> x_tet(3);
7224 el_pt->local_coordinate_of_node(j, s);
7225 dummy_q_el_pt[1]->interpolated_s_tet(s, s_tet);
7226 right_mid_face_node1_pt = new_node_pt;
7227 tet_el_pt->interpolated_x(s_tet, x_tet);
7228 new_node_pt->x(0) = x_tet[0];
7229 new_node_pt->x(1) = x_tet[1];
7230 new_node_pt->x(2) = x_tet[2];
7239 el_pt->node_pt(j) = right_mid_face_node0_pt;
7248 for (
unsigned j = 0; j < 8; j++)
7250 Node* nod_pt = dummy_q_el_pt[2]->node_pt(j);
7251 Vector<double> s_tet(3);
7252 Vector<double> x_tet(3);
7256 tet_el_pt->local_coordinate_of_node(3, s_tet);
7257 nod_pt->set_value(0, s_tet[0]);
7258 nod_pt->set_value(1, s_tet[1]);
7259 nod_pt->set_value(2, s_tet[2]);
7260 tet_el_pt->interpolated_x(s_tet, x_tet);
7261 nod_pt->x(0) = x_tet[0];
7262 nod_pt->x(1) = x_tet[1];
7263 nod_pt->x(2) = x_tet[2];
7266 tet_el_pt->local_coordinate_of_node(6, s_tet);
7267 nod_pt->set_value(0, s_tet[0]);
7268 nod_pt->set_value(1, s_tet[1]);
7269 nod_pt->set_value(2, s_tet[2]);
7270 tet_el_pt->interpolated_x(s_tet, x_tet);
7271 nod_pt->x(0) = x_tet[0];
7272 nod_pt->x(1) = x_tet[1];
7273 nod_pt->x(2) = x_tet[2];
7276 tet_el_pt->local_coordinate_of_node(9, s_tet);
7277 nod_pt->set_value(0, s_tet[0]);
7278 nod_pt->set_value(1, s_tet[1]);
7279 nod_pt->set_value(2, s_tet[2]);
7280 tet_el_pt->interpolated_x(s_tet, x_tet);
7281 nod_pt->x(0) = x_tet[0];
7282 nod_pt->x(1) = x_tet[1];
7283 nod_pt->x(2) = x_tet[2];
7288 s_tet[0] = 1.0 / 3.0;
7289 s_tet[1] = 1.0 / 3.0;
7291 nod_pt->set_value(0, s_tet[0]);
7292 nod_pt->set_value(1, s_tet[1]);
7293 nod_pt->set_value(2, s_tet[2]);
7294 tet_el_pt->interpolated_x(s_tet, x_tet);
7295 nod_pt->x(0) = x_tet[0];
7296 nod_pt->x(1) = x_tet[1];
7297 nod_pt->x(2) = x_tet[2];
7300 tet_el_pt->local_coordinate_of_node(8, s_tet);
7301 nod_pt->set_value(0, s_tet[0]);
7302 nod_pt->set_value(1, s_tet[1]);
7303 nod_pt->set_value(2, s_tet[2]);
7304 tet_el_pt->interpolated_x(s_tet, x_tet);
7305 nod_pt->x(0) = x_tet[0];
7306 nod_pt->x(1) = x_tet[1];
7307 nod_pt->x(2) = x_tet[2];
7312 s_tet[0] = 1.0 / 3.0;
7314 s_tet[2] = 1.0 / 3.0;
7315 nod_pt->set_value(0, s_tet[0]);
7316 nod_pt->set_value(1, s_tet[1]);
7317 nod_pt->set_value(2, s_tet[2]);
7318 tet_el_pt->interpolated_x(s_tet, x_tet);
7319 nod_pt->x(0) = x_tet[0];
7320 nod_pt->x(1) = x_tet[1];
7321 nod_pt->x(2) = x_tet[2];
7327 s_tet[1] = 1.0 / 3.0;
7328 s_tet[2] = 1.0 / 3.0;
7329 nod_pt->set_value(0, s_tet[0]);
7330 nod_pt->set_value(1, s_tet[1]);
7331 nod_pt->set_value(2, s_tet[2]);
7332 tet_el_pt->interpolated_x(s_tet, x_tet);
7333 nod_pt->x(0) = x_tet[0];
7334 nod_pt->x(1) = x_tet[1];
7335 nod_pt->x(2) = x_tet[2];
7342 nod_pt->set_value(0, s_tet[0]);
7343 nod_pt->set_value(1, s_tet[1]);
7344 nod_pt->set_value(2, s_tet[2]);
7345 tet_el_pt->interpolated_x(s_tet, x_tet);
7346 nod_pt->x(0) = x_tet[0];
7347 nod_pt->x(1) = x_tet[1];
7348 nod_pt->x(2) = x_tet[2];
7355 FiniteElement* el_pt =
new ELEMENT;
7356 brick_el2_pt = el_pt;
7357 Element_pt.push_back(el_pt);
7360 tet_el_pt->node_pt(3), tet_el_pt->node_pt(0), tet_el_pt->node_pt(2));
7363 tet_el_pt->node_pt(3), tet_el_pt->node_pt(1), tet_el_pt->node_pt(2));
7366 tet_el_pt->node_pt(3), tet_el_pt->node_pt(1), tet_el_pt->node_pt(0));
7369 Vector<Vector<unsigned>> tet_edge_node(3);
7370 tet_edge_node[0].resize(2);
7371 tet_edge_node[0][0] = 6;
7372 tet_edge_node[0][1] = 0;
7373 tet_edge_node[1].resize(2);
7374 tet_edge_node[1][0] = 9;
7375 tet_edge_node[1][1] = 1;
7376 tet_edge_node[2].resize(2);
7377 tet_edge_node[2][0] = 8;
7378 tet_edge_node[2][1] = 2;
7381 unsigned central_tet_vertex = 3;
7383 Node* tet_node_pt = 0;
7384 Node* old_node_pt = 0;
7391 tet_node_pt = tet_el_pt->node_pt(central_tet_vertex);
7392 old_node_pt = tet_node_node_pt[tet_node_pt];
7393 if (old_node_pt == 0)
7395 Node* new_node_pt = 0;
7396 if (tet_node_pt->is_on_boundary())
7398 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7402 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7404 tet_node_node_pt[tet_node_pt] = new_node_pt;
7405 Node_pt.push_back(new_node_pt);
7406 Vector<double> s(3);
7407 Vector<double> s_tet(3);
7408 Vector<double> x_tet(3);
7409 el_pt->local_coordinate_of_node(j, s);
7410 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7411 tet_el_pt->interpolated_x(s_tet, x_tet);
7412 new_node_pt->x(0) = x_tet[0];
7413 new_node_pt->x(1) = x_tet[1];
7414 new_node_pt->x(2) = x_tet[2];
7419 el_pt->node_pt(j) = old_node_pt;
7429 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[0][0]);
7430 old_node_pt = tet_node_node_pt[tet_node_pt];
7431 if (old_node_pt == 0)
7433 Node* new_node_pt = 0;
7434 if (tet_node_pt->is_on_boundary())
7436 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7440 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7442 tet_node_node_pt[tet_node_pt] = new_node_pt;
7443 Node_pt.push_back(new_node_pt);
7444 Vector<double> s(3);
7445 Vector<double> s_tet(3);
7446 Vector<double> x_tet(3);
7447 el_pt->local_coordinate_of_node(j, s);
7448 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7449 tet_el_pt->interpolated_x(s_tet, x_tet);
7450 new_node_pt->x(0) = x_tet[0];
7451 new_node_pt->x(1) = x_tet[1];
7452 new_node_pt->x(2) = x_tet[2];
7457 el_pt->node_pt(j) = old_node_pt;
7467 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[1][0]);
7468 old_node_pt = tet_node_node_pt[tet_node_pt];
7469 if (old_node_pt == 0)
7471 Node* new_node_pt = 0;
7472 if (tet_node_pt->is_on_boundary())
7474 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7478 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7480 tet_node_node_pt[tet_node_pt] = new_node_pt;
7481 Node_pt.push_back(new_node_pt);
7482 Vector<double> s(3);
7483 Vector<double> s_tet(3);
7484 Vector<double> x_tet(3);
7485 el_pt->local_coordinate_of_node(j, s);
7486 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7487 tet_el_pt->interpolated_x(s_tet, x_tet);
7488 new_node_pt->x(0) = x_tet[0];
7489 new_node_pt->x(1) = x_tet[1];
7490 new_node_pt->x(2) = x_tet[2];
7495 el_pt->node_pt(j) = old_node_pt;
7505 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[2][0]);
7506 old_node_pt = tet_node_node_pt[tet_node_pt];
7507 if (old_node_pt == 0)
7509 Node* new_node_pt = 0;
7510 if (tet_node_pt->is_on_boundary())
7512 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7516 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7518 tet_node_node_pt[tet_node_pt] = new_node_pt;
7519 Node_pt.push_back(new_node_pt);
7520 Vector<double> s(3);
7521 Vector<double> s_tet(3);
7522 Vector<double> x_tet(3);
7523 el_pt->local_coordinate_of_node(j, s);
7524 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7525 tet_el_pt->interpolated_x(s_tet, x_tet);
7526 new_node_pt->x(0) = x_tet[0];
7527 new_node_pt->x(1) = x_tet[1];
7528 new_node_pt->x(2) = x_tet[2];
7533 el_pt->node_pt(j) = old_node_pt;
7543 old_node_pt = tet_face_node_pt[face0];
7544 if (old_node_pt == 0)
7546 Node* new_node_pt = 0;
7547 if (face0.is_boundary_face())
7549 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7553 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7555 tet_face_node_pt[face0] = new_node_pt;
7556 Node_pt.push_back(new_node_pt);
7557 Vector<double> s(3);
7558 Vector<double> s_tet(3);
7559 Vector<double> x_tet(3);
7560 el_pt->local_coordinate_of_node(j, s);
7561 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7562 tet_el_pt->interpolated_x(s_tet, x_tet);
7563 new_node_pt->x(0) = x_tet[0];
7564 new_node_pt->x(1) = x_tet[1];
7565 new_node_pt->x(2) = x_tet[2];
7570 el_pt->node_pt(j) = old_node_pt;
7579 old_node_pt = tet_face_node_pt[face1];
7580 if (old_node_pt == 0)
7582 Node* new_node_pt = 0;
7583 if (face1.is_boundary_face())
7585 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7589 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7591 tet_face_node_pt[face1] = new_node_pt;
7592 Node_pt.push_back(new_node_pt);
7593 Vector<double> s(3);
7594 Vector<double> s_tet(3);
7595 Vector<double> x_tet(3);
7596 el_pt->local_coordinate_of_node(j, s);
7597 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7598 tet_el_pt->interpolated_x(s_tet, x_tet);
7599 new_node_pt->x(0) = x_tet[0];
7600 new_node_pt->x(1) = x_tet[1];
7601 new_node_pt->x(2) = x_tet[2];
7606 el_pt->node_pt(j) = old_node_pt;
7615 old_node_pt = tet_face_node_pt[face2];
7616 if (old_node_pt == 0)
7618 Node* new_node_pt = 0;
7619 if (face2.is_boundary_face())
7621 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7625 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7627 tet_face_node_pt[face2] = new_node_pt;
7628 Node_pt.push_back(new_node_pt);
7629 Vector<double> s(3);
7630 Vector<double> s_tet(3);
7631 Vector<double> x_tet(3);
7632 el_pt->local_coordinate_of_node(j, s);
7633 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7634 tet_el_pt->interpolated_x(s_tet, x_tet);
7635 new_node_pt->x(0) = x_tet[0];
7636 new_node_pt->x(1) = x_tet[1];
7637 new_node_pt->x(2) = x_tet[2];
7642 el_pt->node_pt(j) = old_node_pt;
7653 el_pt->node_pt(j) = centroid_node_pt;
7663 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7664 Node_pt.push_back(new_node_pt);
7665 Vector<double> s(3);
7666 Vector<double> s_tet(3);
7667 Vector<double> x_tet(3);
7668 el_pt->local_coordinate_of_node(j, s);
7669 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7670 tet_el_pt->interpolated_x(s_tet, x_tet);
7671 new_node_pt->x(0) = x_tet[0];
7672 new_node_pt->x(1) = x_tet[1];
7673 new_node_pt->x(2) = x_tet[2];
7682 Edge edge(el_pt->node_pt(0), el_pt->node_pt(2));
7683 old_node_pt = brick_edge_node_pt[edge];
7684 if (old_node_pt == 0)
7686 Node* new_node_pt = 0;
7687 if (edge.is_boundary_edge())
7689 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7693 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7695 brick_edge_node_pt[edge] = new_node_pt;
7696 Node_pt.push_back(new_node_pt);
7697 Vector<double> s(3);
7698 Vector<double> s_tet(3);
7699 Vector<double> x_tet(3);
7700 el_pt->local_coordinate_of_node(j, s);
7701 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7702 tet_el_pt->interpolated_x(s_tet, x_tet);
7703 new_node_pt->x(0) = x_tet[0];
7704 new_node_pt->x(1) = x_tet[1];
7705 new_node_pt->x(2) = x_tet[2];
7710 el_pt->node_pt(j) = old_node_pt;
7720 Edge edge(el_pt->node_pt(0), el_pt->node_pt(6));
7721 old_node_pt = brick_edge_node_pt[edge];
7722 if (old_node_pt == 0)
7724 Node* new_node_pt = 0;
7725 if (edge.is_boundary_edge())
7727 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7731 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7733 brick_edge_node_pt[edge] = new_node_pt;
7734 Node_pt.push_back(new_node_pt);
7735 Vector<double> s(3);
7736 Vector<double> s_tet(3);
7737 Vector<double> x_tet(3);
7738 el_pt->local_coordinate_of_node(j, s);
7739 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7740 tet_el_pt->interpolated_x(s_tet, x_tet);
7741 new_node_pt->x(0) = x_tet[0];
7742 new_node_pt->x(1) = x_tet[1];
7743 new_node_pt->x(2) = x_tet[2];
7748 el_pt->node_pt(j) = old_node_pt;
7757 Edge edge(el_pt->node_pt(2), el_pt->node_pt(8));
7758 old_node_pt = brick_edge_node_pt[edge];
7759 if (old_node_pt == 0)
7761 Node* new_node_pt = 0;
7762 if (edge.is_boundary_edge())
7764 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7768 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7770 brick_edge_node_pt[edge] = new_node_pt;
7771 Node_pt.push_back(new_node_pt);
7772 Vector<double> s(3);
7773 Vector<double> s_tet(3);
7774 Vector<double> x_tet(3);
7775 el_pt->local_coordinate_of_node(j, s);
7776 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7777 tet_el_pt->interpolated_x(s_tet, x_tet);
7778 new_node_pt->x(0) = x_tet[0];
7779 new_node_pt->x(1) = x_tet[1];
7780 new_node_pt->x(2) = x_tet[2];
7785 el_pt->node_pt(j) = old_node_pt;
7794 Edge edge(el_pt->node_pt(6), el_pt->node_pt(8));
7795 old_node_pt = brick_edge_node_pt[edge];
7796 if (old_node_pt == 0)
7798 Node* new_node_pt = 0;
7799 if (edge.is_boundary_edge())
7801 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7805 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7807 brick_edge_node_pt[edge] = new_node_pt;
7808 Node_pt.push_back(new_node_pt);
7809 Vector<double> s(3);
7810 Vector<double> s_tet(3);
7811 Vector<double> x_tet(3);
7812 el_pt->local_coordinate_of_node(j, s);
7813 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7814 tet_el_pt->interpolated_x(s_tet, x_tet);
7815 new_node_pt->x(0) = x_tet[0];
7816 new_node_pt->x(1) = x_tet[1];
7817 new_node_pt->x(2) = x_tet[2];
7822 el_pt->node_pt(j) = old_node_pt;
7831 Edge edge(el_pt->node_pt(18), el_pt->node_pt(20));
7832 old_node_pt = brick_edge_node_pt[edge];
7833 if (old_node_pt == 0)
7835 Node* new_node_pt = 0;
7836 if (edge.is_boundary_edge())
7838 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7842 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7844 brick_edge_node_pt[edge] = new_node_pt;
7845 Node_pt.push_back(new_node_pt);
7846 Vector<double> s(3);
7847 Vector<double> s_tet(3);
7848 Vector<double> x_tet(3);
7849 el_pt->local_coordinate_of_node(j, s);
7850 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7851 tet_el_pt->interpolated_x(s_tet, x_tet);
7852 new_node_pt->x(0) = x_tet[0];
7853 new_node_pt->x(1) = x_tet[1];
7854 new_node_pt->x(2) = x_tet[2];
7859 el_pt->node_pt(j) = old_node_pt;
7869 Edge edge(el_pt->node_pt(18), el_pt->node_pt(24));
7870 old_node_pt = brick_edge_node_pt[edge];
7871 if (old_node_pt == 0)
7873 Node* new_node_pt = 0;
7874 if (edge.is_boundary_edge())
7876 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7880 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7882 brick_edge_node_pt[edge] = new_node_pt;
7883 Node_pt.push_back(new_node_pt);
7884 Vector<double> s(3);
7885 Vector<double> s_tet(3);
7886 Vector<double> x_tet(3);
7887 el_pt->local_coordinate_of_node(j, s);
7888 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7889 tet_el_pt->interpolated_x(s_tet, x_tet);
7890 new_node_pt->x(0) = x_tet[0];
7891 new_node_pt->x(1) = x_tet[1];
7892 new_node_pt->x(2) = x_tet[2];
7897 el_pt->node_pt(j) = old_node_pt;
7906 Edge edge(el_pt->node_pt(20), el_pt->node_pt(26));
7907 old_node_pt = brick_edge_node_pt[edge];
7908 if (old_node_pt == 0)
7910 Node* new_node_pt = 0;
7911 if (edge.is_boundary_edge())
7913 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7917 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7919 brick_edge_node_pt[edge] = new_node_pt;
7920 Node_pt.push_back(new_node_pt);
7921 Vector<double> s(3);
7922 Vector<double> s_tet(3);
7923 Vector<double> x_tet(3);
7924 el_pt->local_coordinate_of_node(j, s);
7925 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7926 tet_el_pt->interpolated_x(s_tet, x_tet);
7927 new_node_pt->x(0) = x_tet[0];
7928 new_node_pt->x(1) = x_tet[1];
7929 new_node_pt->x(2) = x_tet[2];
7934 el_pt->node_pt(j) = old_node_pt;
7944 Edge edge(el_pt->node_pt(24), el_pt->node_pt(26));
7945 old_node_pt = brick_edge_node_pt[edge];
7946 if (old_node_pt == 0)
7948 Node* new_node_pt = 0;
7949 if (edge.is_boundary_edge())
7951 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7955 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7957 brick_edge_node_pt[edge] = new_node_pt;
7958 Node_pt.push_back(new_node_pt);
7959 Vector<double> s(3);
7960 Vector<double> s_tet(3);
7961 Vector<double> x_tet(3);
7962 el_pt->local_coordinate_of_node(j, s);
7963 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
7964 tet_el_pt->interpolated_x(s_tet, x_tet);
7965 new_node_pt->x(0) = x_tet[0];
7966 new_node_pt->x(1) = x_tet[1];
7967 new_node_pt->x(2) = x_tet[2];
7972 el_pt->node_pt(j) = old_node_pt;
7981 Edge edge(el_pt->node_pt(0), el_pt->node_pt(18));
7982 old_node_pt = brick_edge_node_pt[edge];
7983 if (old_node_pt == 0)
7985 Node* new_node_pt = 0;
7986 if (edge.is_boundary_edge())
7988 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
7992 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
7994 brick_edge_node_pt[edge] = new_node_pt;
7995 Node_pt.push_back(new_node_pt);
7996 Vector<double> s(3);
7997 Vector<double> s_tet(3);
7998 Vector<double> x_tet(3);
7999 el_pt->local_coordinate_of_node(j, s);
8000 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
8001 tet_el_pt->interpolated_x(s_tet, x_tet);
8002 new_node_pt->x(0) = x_tet[0];
8003 new_node_pt->x(1) = x_tet[1];
8004 new_node_pt->x(2) = x_tet[2];
8009 el_pt->node_pt(j) = old_node_pt;
8019 Edge edge(el_pt->node_pt(2), el_pt->node_pt(20));
8020 old_node_pt = brick_edge_node_pt[edge];
8021 if (old_node_pt == 0)
8023 Node* new_node_pt = 0;
8024 if (edge.is_boundary_edge())
8026 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8030 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8032 brick_edge_node_pt[edge] = new_node_pt;
8033 Node_pt.push_back(new_node_pt);
8034 Vector<double> s(3);
8035 Vector<double> s_tet(3);
8036 Vector<double> x_tet(3);
8037 el_pt->local_coordinate_of_node(j, s);
8038 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
8039 tet_el_pt->interpolated_x(s_tet, x_tet);
8040 new_node_pt->x(0) = x_tet[0];
8041 new_node_pt->x(1) = x_tet[1];
8042 new_node_pt->x(2) = x_tet[2];
8047 el_pt->node_pt(j) = old_node_pt;
8057 Edge edge(el_pt->node_pt(6), el_pt->node_pt(24));
8058 old_node_pt = brick_edge_node_pt[edge];
8059 if (old_node_pt == 0)
8061 Node* new_node_pt = 0;
8062 if (edge.is_boundary_edge())
8064 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8068 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8070 brick_edge_node_pt[edge] = new_node_pt;
8071 Node_pt.push_back(new_node_pt);
8072 Vector<double> s(3);
8073 Vector<double> s_tet(3);
8074 Vector<double> x_tet(3);
8075 el_pt->local_coordinate_of_node(j, s);
8076 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
8077 tet_el_pt->interpolated_x(s_tet, x_tet);
8078 new_node_pt->x(0) = x_tet[0];
8079 new_node_pt->x(1) = x_tet[1];
8080 new_node_pt->x(2) = x_tet[2];
8085 el_pt->node_pt(j) = old_node_pt;
8095 Edge edge(el_pt->node_pt(8), el_pt->node_pt(26));
8096 old_node_pt = brick_edge_node_pt[edge];
8097 if (old_node_pt == 0)
8099 Node* new_node_pt = 0;
8100 if (edge.is_boundary_edge())
8102 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8106 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8108 brick_edge_node_pt[edge] = new_node_pt;
8109 Node_pt.push_back(new_node_pt);
8110 Vector<double> s(3);
8111 Vector<double> s_tet(3);
8112 Vector<double> x_tet(3);
8113 el_pt->local_coordinate_of_node(j, s);
8114 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
8115 tet_el_pt->interpolated_x(s_tet, x_tet);
8116 new_node_pt->x(0) = x_tet[0];
8117 new_node_pt->x(1) = x_tet[1];
8118 new_node_pt->x(2) = x_tet[2];
8123 el_pt->node_pt(j) = old_node_pt;
8134 TFace face(tet_el_pt->node_pt(central_tet_vertex),
8135 tet_el_pt->node_pt(tet_edge_node[0][0]),
8136 tet_el_pt->node_pt(tet_edge_node[2][0]));
8138 old_node_pt = tet_face_node_pt[face];
8139 if (old_node_pt == 0)
8141 Node* new_node_pt = 0;
8142 if (face.is_boundary_face())
8144 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8148 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8150 tet_face_node_pt[face] = new_node_pt;
8151 Node_pt.push_back(new_node_pt);
8152 Vector<double> s(3);
8153 Vector<double> s_tet(3);
8154 Vector<double> x_tet(3);
8155 el_pt->local_coordinate_of_node(j, s);
8156 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
8157 tet_el_pt->interpolated_x(s_tet, x_tet);
8158 new_node_pt->x(0) = x_tet[0];
8159 new_node_pt->x(1) = x_tet[1];
8160 new_node_pt->x(2) = x_tet[2];
8165 el_pt->node_pt(j) = old_node_pt;
8176 TFace face(tet_el_pt->node_pt(central_tet_vertex),
8177 tet_el_pt->node_pt(tet_edge_node[1][0]),
8178 tet_el_pt->node_pt(tet_edge_node[2][0]));
8179 old_node_pt = tet_face_node_pt[face];
8180 if (old_node_pt == 0)
8182 Node* new_node_pt = 0;
8183 if (face.is_boundary_face())
8185 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8189 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8191 tet_face_node_pt[face] = new_node_pt;
8192 Node_pt.push_back(new_node_pt);
8193 Vector<double> s(3);
8194 Vector<double> s_tet(3);
8195 Vector<double> x_tet(3);
8196 el_pt->local_coordinate_of_node(j, s);
8197 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
8198 tet_el_pt->interpolated_x(s_tet, x_tet);
8199 new_node_pt->x(0) = x_tet[0];
8200 new_node_pt->x(1) = x_tet[1];
8201 new_node_pt->x(2) = x_tet[2];
8206 el_pt->node_pt(j) = old_node_pt;
8217 TFace face(tet_el_pt->node_pt(central_tet_vertex),
8218 tet_el_pt->node_pt(tet_edge_node[0][0]),
8219 tet_el_pt->node_pt(tet_edge_node[1][0]));
8221 old_node_pt = tet_face_node_pt[face];
8222 if (old_node_pt == 0)
8224 Node* new_node_pt = 0;
8225 if (face.is_boundary_face())
8227 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8231 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8233 tet_face_node_pt[face] = new_node_pt;
8234 Node_pt.push_back(new_node_pt);
8235 Vector<double> s(3);
8236 Vector<double> s_tet(3);
8237 Vector<double> x_tet(3);
8238 el_pt->local_coordinate_of_node(j, s);
8239 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
8240 tet_el_pt->interpolated_x(s_tet, x_tet);
8241 new_node_pt->x(0) = x_tet[0];
8242 new_node_pt->x(1) = x_tet[1];
8243 new_node_pt->x(2) = x_tet[2];
8248 el_pt->node_pt(j) = old_node_pt;
8256 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8257 Node_pt.push_back(new_node_pt);
8258 Vector<double> s(3);
8259 Vector<double> s_tet(3);
8260 Vector<double> x_tet(3);
8261 el_pt->local_coordinate_of_node(j, s);
8262 dummy_q_el_pt[2]->interpolated_s_tet(s, s_tet);
8263 top_mid_face_node2_pt = new_node_pt;
8264 tet_el_pt->interpolated_x(s_tet, x_tet);
8265 new_node_pt->x(0) = x_tet[0];
8266 new_node_pt->x(1) = x_tet[1];
8267 new_node_pt->x(2) = x_tet[2];
8276 el_pt->node_pt(j) = back_mid_face_node0_pt;
8285 el_pt->node_pt(j) = right_mid_face_node1_pt;
8294 for (
unsigned j = 0; j < 8; j++)
8296 Node* nod_pt = dummy_q_el_pt[3]->node_pt(j);
8297 Vector<double> s_tet(3);
8298 Vector<double> x_tet(3);
8302 tet_el_pt->local_coordinate_of_node(2, s_tet);
8303 nod_pt->set_value(0, s_tet[0]);
8304 nod_pt->set_value(1, s_tet[1]);
8305 nod_pt->set_value(2, s_tet[2]);
8306 tet_el_pt->interpolated_x(s_tet, x_tet);
8307 nod_pt->x(0) = x_tet[0];
8308 nod_pt->x(1) = x_tet[1];
8309 nod_pt->x(2) = x_tet[2];
8312 tet_el_pt->local_coordinate_of_node(7, s_tet);
8313 nod_pt->set_value(0, s_tet[0]);
8314 nod_pt->set_value(1, s_tet[1]);
8315 nod_pt->set_value(2, s_tet[2]);
8316 tet_el_pt->interpolated_x(s_tet, x_tet);
8317 nod_pt->x(0) = x_tet[0];
8318 nod_pt->x(1) = x_tet[1];
8319 nod_pt->x(2) = x_tet[2];
8322 tet_el_pt->local_coordinate_of_node(5, s_tet);
8323 nod_pt->set_value(0, s_tet[0]);
8324 nod_pt->set_value(1, s_tet[1]);
8325 nod_pt->set_value(2, s_tet[2]);
8326 tet_el_pt->interpolated_x(s_tet, x_tet);
8327 nod_pt->x(0) = x_tet[0];
8328 nod_pt->x(1) = x_tet[1];
8329 nod_pt->x(2) = x_tet[2];
8334 s_tet[0] = 1.0 / 3.0;
8335 s_tet[1] = 1.0 / 3.0;
8336 s_tet[2] = 1.0 / 3.0;
8337 nod_pt->set_value(0, s_tet[0]);
8338 nod_pt->set_value(1, s_tet[1]);
8339 nod_pt->set_value(2, s_tet[2]);
8340 tet_el_pt->interpolated_x(s_tet, x_tet);
8341 nod_pt->x(0) = x_tet[0];
8342 nod_pt->x(1) = x_tet[1];
8343 nod_pt->x(2) = x_tet[2];
8346 tet_el_pt->local_coordinate_of_node(8, s_tet);
8347 nod_pt->set_value(0, s_tet[0]);
8348 nod_pt->set_value(1, s_tet[1]);
8349 nod_pt->set_value(2, s_tet[2]);
8350 tet_el_pt->interpolated_x(s_tet, x_tet);
8351 nod_pt->x(0) = x_tet[0];
8352 nod_pt->x(1) = x_tet[1];
8353 nod_pt->x(2) = x_tet[2];
8359 s_tet[1] = 1.0 / 3.0;
8360 s_tet[2] = 1.0 / 3.0;
8361 nod_pt->set_value(0, s_tet[0]);
8362 nod_pt->set_value(1, s_tet[1]);
8363 nod_pt->set_value(2, s_tet[2]);
8364 tet_el_pt->interpolated_x(s_tet, x_tet);
8365 nod_pt->x(0) = x_tet[0];
8366 nod_pt->x(1) = x_tet[1];
8367 nod_pt->x(2) = x_tet[2];
8372 s_tet[0] = 1.0 / 3.0;
8374 s_tet[2] = 1.0 / 3.0;
8375 nod_pt->set_value(0, s_tet[0]);
8376 nod_pt->set_value(1, s_tet[1]);
8377 nod_pt->set_value(2, s_tet[2]);
8378 tet_el_pt->interpolated_x(s_tet, x_tet);
8379 nod_pt->x(0) = x_tet[0];
8380 nod_pt->x(1) = x_tet[1];
8381 nod_pt->x(2) = x_tet[2];
8388 nod_pt->set_value(0, s_tet[0]);
8389 nod_pt->set_value(1, s_tet[1]);
8390 nod_pt->set_value(2, s_tet[2]);
8391 tet_el_pt->interpolated_x(s_tet, x_tet);
8392 nod_pt->x(0) = x_tet[0];
8393 nod_pt->x(1) = x_tet[1];
8394 nod_pt->x(2) = x_tet[2];
8401 FiniteElement* el_pt =
new ELEMENT;
8402 brick_el3_pt = el_pt;
8403 Element_pt.push_back(el_pt);
8406 tet_el_pt->node_pt(1), tet_el_pt->node_pt(2), tet_el_pt->node_pt(3));
8409 tet_el_pt->node_pt(0), tet_el_pt->node_pt(2), tet_el_pt->node_pt(3));
8412 tet_el_pt->node_pt(0), tet_el_pt->node_pt(1), tet_el_pt->node_pt(2));
8415 Vector<Vector<unsigned>> tet_edge_node(3);
8416 tet_edge_node[0].resize(2);
8417 tet_edge_node[0][0] = 7;
8418 tet_edge_node[0][1] = 1;
8419 tet_edge_node[1].resize(2);
8420 tet_edge_node[1][0] = 5;
8421 tet_edge_node[1][1] = 0;
8422 tet_edge_node[2].resize(2);
8423 tet_edge_node[2][0] = 8;
8424 tet_edge_node[2][1] = 3;
8427 unsigned central_tet_vertex = 2;
8429 Node* tet_node_pt = 0;
8430 Node* old_node_pt = 0;
8437 tet_node_pt = tet_el_pt->node_pt(central_tet_vertex);
8438 old_node_pt = tet_node_node_pt[tet_node_pt];
8439 if (old_node_pt == 0)
8441 Node* new_node_pt = 0;
8442 if (tet_node_pt->is_on_boundary())
8444 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8448 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8450 tet_node_node_pt[tet_node_pt] = new_node_pt;
8451 Node_pt.push_back(new_node_pt);
8452 Vector<double> s(3);
8453 Vector<double> s_tet(3);
8454 Vector<double> x_tet(3);
8455 el_pt->local_coordinate_of_node(j, s);
8456 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8457 tet_el_pt->interpolated_x(s_tet, x_tet);
8458 new_node_pt->x(0) = x_tet[0];
8459 new_node_pt->x(1) = x_tet[1];
8460 new_node_pt->x(2) = x_tet[2];
8465 el_pt->node_pt(j) = old_node_pt;
8475 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[0][0]);
8476 old_node_pt = tet_node_node_pt[tet_node_pt];
8477 if (old_node_pt == 0)
8479 Node* new_node_pt = 0;
8480 if (tet_node_pt->is_on_boundary())
8482 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8486 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8488 tet_node_node_pt[tet_node_pt] = new_node_pt;
8489 Node_pt.push_back(new_node_pt);
8490 Vector<double> s(3);
8491 Vector<double> s_tet(3);
8492 Vector<double> x_tet(3);
8493 el_pt->local_coordinate_of_node(j, s);
8494 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8495 tet_el_pt->interpolated_x(s_tet, x_tet);
8496 new_node_pt->x(0) = x_tet[0];
8497 new_node_pt->x(1) = x_tet[1];
8498 new_node_pt->x(2) = x_tet[2];
8503 el_pt->node_pt(j) = old_node_pt;
8513 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[1][0]);
8514 old_node_pt = tet_node_node_pt[tet_node_pt];
8515 if (old_node_pt == 0)
8517 Node* new_node_pt = 0;
8518 if (tet_node_pt->is_on_boundary())
8520 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8524 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8526 tet_node_node_pt[tet_node_pt] = new_node_pt;
8527 Node_pt.push_back(new_node_pt);
8528 Vector<double> s(3);
8529 Vector<double> s_tet(3);
8530 Vector<double> x_tet(3);
8531 el_pt->local_coordinate_of_node(j, s);
8532 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8533 tet_el_pt->interpolated_x(s_tet, x_tet);
8534 new_node_pt->x(0) = x_tet[0];
8535 new_node_pt->x(1) = x_tet[1];
8536 new_node_pt->x(2) = x_tet[2];
8541 el_pt->node_pt(j) = old_node_pt;
8551 tet_node_pt = tet_el_pt->node_pt(tet_edge_node[2][0]);
8552 old_node_pt = tet_node_node_pt[tet_node_pt];
8553 if (old_node_pt == 0)
8555 Node* new_node_pt = 0;
8556 if (tet_node_pt->is_on_boundary())
8558 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8562 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8564 tet_node_node_pt[tet_node_pt] = new_node_pt;
8565 Node_pt.push_back(new_node_pt);
8566 Vector<double> s(3);
8567 Vector<double> s_tet(3);
8568 Vector<double> x_tet(3);
8569 el_pt->local_coordinate_of_node(j, s);
8570 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8571 tet_el_pt->interpolated_x(s_tet, x_tet);
8572 new_node_pt->x(0) = x_tet[0];
8573 new_node_pt->x(1) = x_tet[1];
8574 new_node_pt->x(2) = x_tet[2];
8579 el_pt->node_pt(j) = old_node_pt;
8589 old_node_pt = tet_face_node_pt[face0];
8590 if (old_node_pt == 0)
8592 Node* new_node_pt = 0;
8593 if (face0.is_boundary_face())
8595 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8599 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8601 tet_face_node_pt[face0] = new_node_pt;
8602 Node_pt.push_back(new_node_pt);
8603 Vector<double> s(3);
8604 Vector<double> s_tet(3);
8605 Vector<double> x_tet(3);
8606 el_pt->local_coordinate_of_node(j, s);
8607 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8608 tet_el_pt->interpolated_x(s_tet, x_tet);
8609 new_node_pt->x(0) = x_tet[0];
8610 new_node_pt->x(1) = x_tet[1];
8611 new_node_pt->x(2) = x_tet[2];
8616 el_pt->node_pt(j) = old_node_pt;
8625 old_node_pt = tet_face_node_pt[face1];
8626 if (old_node_pt == 0)
8628 Node* new_node_pt = 0;
8629 if (face1.is_boundary_face())
8631 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8635 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8637 tet_face_node_pt[face1] = new_node_pt;
8638 Node_pt.push_back(new_node_pt);
8639 Vector<double> s(3);
8640 Vector<double> s_tet(3);
8641 Vector<double> x_tet(3);
8642 el_pt->local_coordinate_of_node(j, s);
8643 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8644 tet_el_pt->interpolated_x(s_tet, x_tet);
8645 new_node_pt->x(0) = x_tet[0];
8646 new_node_pt->x(1) = x_tet[1];
8647 new_node_pt->x(2) = x_tet[2];
8652 el_pt->node_pt(j) = old_node_pt;
8661 old_node_pt = tet_face_node_pt[face2];
8662 if (old_node_pt == 0)
8664 Node* new_node_pt = 0;
8665 if (face2.is_boundary_face())
8667 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8671 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8673 tet_face_node_pt[face2] = new_node_pt;
8674 Node_pt.push_back(new_node_pt);
8675 Vector<double> s(3);
8676 Vector<double> s_tet(3);
8677 Vector<double> x_tet(3);
8678 el_pt->local_coordinate_of_node(j, s);
8679 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8680 tet_el_pt->interpolated_x(s_tet, x_tet);
8681 new_node_pt->x(0) = x_tet[0];
8682 new_node_pt->x(1) = x_tet[1];
8683 new_node_pt->x(2) = x_tet[2];
8688 el_pt->node_pt(j) = old_node_pt;
8699 el_pt->node_pt(j) = centroid_node_pt;
8709 Node* new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8710 Node_pt.push_back(new_node_pt);
8711 Vector<double> s(3);
8712 Vector<double> s_tet(3);
8713 Vector<double> x_tet(3);
8714 el_pt->local_coordinate_of_node(j, s);
8715 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8716 tet_el_pt->interpolated_x(s_tet, x_tet);
8717 new_node_pt->x(0) = x_tet[0];
8718 new_node_pt->x(1) = x_tet[1];
8719 new_node_pt->x(2) = x_tet[2];
8728 Edge edge(el_pt->node_pt(0), el_pt->node_pt(2));
8729 old_node_pt = brick_edge_node_pt[edge];
8730 if (old_node_pt == 0)
8732 Node* new_node_pt = 0;
8733 if (edge.is_boundary_edge())
8735 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8739 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8741 brick_edge_node_pt[edge] = new_node_pt;
8742 Node_pt.push_back(new_node_pt);
8743 Vector<double> s(3);
8744 Vector<double> s_tet(3);
8745 Vector<double> x_tet(3);
8746 el_pt->local_coordinate_of_node(j, s);
8747 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8748 tet_el_pt->interpolated_x(s_tet, x_tet);
8749 new_node_pt->x(0) = x_tet[0];
8750 new_node_pt->x(1) = x_tet[1];
8751 new_node_pt->x(2) = x_tet[2];
8756 el_pt->node_pt(j) = old_node_pt;
8766 Edge edge(el_pt->node_pt(0), el_pt->node_pt(6));
8767 old_node_pt = brick_edge_node_pt[edge];
8768 if (old_node_pt == 0)
8770 Node* new_node_pt = 0;
8771 if (edge.is_boundary_edge())
8773 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8777 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8779 brick_edge_node_pt[edge] = new_node_pt;
8780 Node_pt.push_back(new_node_pt);
8781 Vector<double> s(3);
8782 Vector<double> s_tet(3);
8783 Vector<double> x_tet(3);
8784 el_pt->local_coordinate_of_node(j, s);
8785 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8786 tet_el_pt->interpolated_x(s_tet, x_tet);
8787 new_node_pt->x(0) = x_tet[0];
8788 new_node_pt->x(1) = x_tet[1];
8789 new_node_pt->x(2) = x_tet[2];
8794 el_pt->node_pt(j) = old_node_pt;
8803 Edge edge(el_pt->node_pt(2), el_pt->node_pt(8));
8804 old_node_pt = brick_edge_node_pt[edge];
8805 if (old_node_pt == 0)
8807 Node* new_node_pt = 0;
8808 if (edge.is_boundary_edge())
8810 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8814 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8816 brick_edge_node_pt[edge] = new_node_pt;
8817 Node_pt.push_back(new_node_pt);
8818 Vector<double> s(3);
8819 Vector<double> s_tet(3);
8820 Vector<double> x_tet(3);
8821 el_pt->local_coordinate_of_node(j, s);
8822 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8823 tet_el_pt->interpolated_x(s_tet, x_tet);
8824 new_node_pt->x(0) = x_tet[0];
8825 new_node_pt->x(1) = x_tet[1];
8826 new_node_pt->x(2) = x_tet[2];
8831 el_pt->node_pt(j) = old_node_pt;
8840 Edge edge(el_pt->node_pt(6), el_pt->node_pt(8));
8841 old_node_pt = brick_edge_node_pt[edge];
8842 if (old_node_pt == 0)
8844 Node* new_node_pt = 0;
8845 if (edge.is_boundary_edge())
8847 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8851 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8853 brick_edge_node_pt[edge] = new_node_pt;
8854 Node_pt.push_back(new_node_pt);
8855 Vector<double> s(3);
8856 Vector<double> s_tet(3);
8857 Vector<double> x_tet(3);
8858 el_pt->local_coordinate_of_node(j, s);
8859 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8860 tet_el_pt->interpolated_x(s_tet, x_tet);
8861 new_node_pt->x(0) = x_tet[0];
8862 new_node_pt->x(1) = x_tet[1];
8863 new_node_pt->x(2) = x_tet[2];
8868 el_pt->node_pt(j) = old_node_pt;
8877 Edge edge(el_pt->node_pt(18), el_pt->node_pt(20));
8878 old_node_pt = brick_edge_node_pt[edge];
8879 if (old_node_pt == 0)
8881 Node* new_node_pt = 0;
8882 if (edge.is_boundary_edge())
8884 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8888 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8890 brick_edge_node_pt[edge] = new_node_pt;
8891 Node_pt.push_back(new_node_pt);
8892 Vector<double> s(3);
8893 Vector<double> s_tet(3);
8894 Vector<double> x_tet(3);
8895 el_pt->local_coordinate_of_node(j, s);
8896 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8897 tet_el_pt->interpolated_x(s_tet, x_tet);
8898 new_node_pt->x(0) = x_tet[0];
8899 new_node_pt->x(1) = x_tet[1];
8900 new_node_pt->x(2) = x_tet[2];
8905 el_pt->node_pt(j) = old_node_pt;
8915 Edge edge(el_pt->node_pt(18), el_pt->node_pt(24));
8916 old_node_pt = brick_edge_node_pt[edge];
8917 if (old_node_pt == 0)
8919 Node* new_node_pt = 0;
8920 if (edge.is_boundary_edge())
8922 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8926 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8928 brick_edge_node_pt[edge] = new_node_pt;
8929 Node_pt.push_back(new_node_pt);
8930 Vector<double> s(3);
8931 Vector<double> s_tet(3);
8932 Vector<double> x_tet(3);
8933 el_pt->local_coordinate_of_node(j, s);
8934 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8935 tet_el_pt->interpolated_x(s_tet, x_tet);
8936 new_node_pt->x(0) = x_tet[0];
8937 new_node_pt->x(1) = x_tet[1];
8938 new_node_pt->x(2) = x_tet[2];
8943 el_pt->node_pt(j) = old_node_pt;
8952 Edge edge(el_pt->node_pt(20), el_pt->node_pt(26));
8953 old_node_pt = brick_edge_node_pt[edge];
8954 if (old_node_pt == 0)
8956 Node* new_node_pt = 0;
8957 if (edge.is_boundary_edge())
8959 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
8963 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
8965 brick_edge_node_pt[edge] = new_node_pt;
8966 Node_pt.push_back(new_node_pt);
8967 Vector<double> s(3);
8968 Vector<double> s_tet(3);
8969 Vector<double> x_tet(3);
8970 el_pt->local_coordinate_of_node(j, s);
8971 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
8972 tet_el_pt->interpolated_x(s_tet, x_tet);
8973 new_node_pt->x(0) = x_tet[0];
8974 new_node_pt->x(1) = x_tet[1];
8975 new_node_pt->x(2) = x_tet[2];
8980 el_pt->node_pt(j) = old_node_pt;
8990 Edge edge(el_pt->node_pt(24), el_pt->node_pt(26));
8991 old_node_pt = brick_edge_node_pt[edge];
8992 if (old_node_pt == 0)
8994 Node* new_node_pt = 0;
8995 if (edge.is_boundary_edge())
8997 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
9001 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
9003 brick_edge_node_pt[edge] = new_node_pt;
9004 Node_pt.push_back(new_node_pt);
9005 Vector<double> s(3);
9006 Vector<double> s_tet(3);
9007 Vector<double> x_tet(3);
9008 el_pt->local_coordinate_of_node(j, s);
9009 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
9010 tet_el_pt->interpolated_x(s_tet, x_tet);
9011 new_node_pt->x(0) = x_tet[0];
9012 new_node_pt->x(1) = x_tet[1];
9013 new_node_pt->x(2) = x_tet[2];
9018 el_pt->node_pt(j) = old_node_pt;
9027 Edge edge(el_pt->node_pt(0), el_pt->node_pt(18));
9028 old_node_pt = brick_edge_node_pt[edge];
9029 if (old_node_pt == 0)
9031 Node* new_node_pt = 0;
9032 if (edge.is_boundary_edge())
9034 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
9038 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
9040 brick_edge_node_pt[edge] = new_node_pt;
9041 Node_pt.push_back(new_node_pt);
9042 Vector<double> s(3);
9043 Vector<double> s_tet(3);
9044 Vector<double> x_tet(3);
9045 el_pt->local_coordinate_of_node(j, s);
9046 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
9047 tet_el_pt->interpolated_x(s_tet, x_tet);
9048 new_node_pt->x(0) = x_tet[0];
9049 new_node_pt->x(1) = x_tet[1];
9050 new_node_pt->x(2) = x_tet[2];
9055 el_pt->node_pt(j) = old_node_pt;
9065 Edge edge(el_pt->node_pt(2), el_pt->node_pt(20));
9066 old_node_pt = brick_edge_node_pt[edge];
9067 if (old_node_pt == 0)
9069 Node* new_node_pt = 0;
9070 if (edge.is_boundary_edge())
9072 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
9076 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
9078 brick_edge_node_pt[edge] = new_node_pt;
9079 Node_pt.push_back(new_node_pt);
9080 Vector<double> s(3);
9081 Vector<double> s_tet(3);
9082 Vector<double> x_tet(3);
9083 el_pt->local_coordinate_of_node(j, s);
9084 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
9085 tet_el_pt->interpolated_x(s_tet, x_tet);
9086 new_node_pt->x(0) = x_tet[0];
9087 new_node_pt->x(1) = x_tet[1];
9088 new_node_pt->x(2) = x_tet[2];
9093 el_pt->node_pt(j) = old_node_pt;
9103 Edge edge(el_pt->node_pt(6), el_pt->node_pt(24));
9104 old_node_pt = brick_edge_node_pt[edge];
9105 if (old_node_pt == 0)
9107 Node* new_node_pt = 0;
9108 if (edge.is_boundary_edge())
9110 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
9114 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
9116 brick_edge_node_pt[edge] = new_node_pt;
9117 Node_pt.push_back(new_node_pt);
9118 Vector<double> s(3);
9119 Vector<double> s_tet(3);
9120 Vector<double> x_tet(3);
9121 el_pt->local_coordinate_of_node(j, s);
9122 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
9123 tet_el_pt->interpolated_x(s_tet, x_tet);
9124 new_node_pt->x(0) = x_tet[0];
9125 new_node_pt->x(1) = x_tet[1];
9126 new_node_pt->x(2) = x_tet[2];
9131 el_pt->node_pt(j) = old_node_pt;
9141 Edge edge(el_pt->node_pt(8), el_pt->node_pt(26));
9142 old_node_pt = brick_edge_node_pt[edge];
9143 if (old_node_pt == 0)
9145 Node* new_node_pt = 0;
9146 if (edge.is_boundary_edge())
9148 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
9152 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
9154 brick_edge_node_pt[edge] = new_node_pt;
9155 Node_pt.push_back(new_node_pt);
9156 Vector<double> s(3);
9157 Vector<double> s_tet(3);
9158 Vector<double> x_tet(3);
9159 el_pt->local_coordinate_of_node(j, s);
9160 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
9161 tet_el_pt->interpolated_x(s_tet, x_tet);
9162 new_node_pt->x(0) = x_tet[0];
9163 new_node_pt->x(1) = x_tet[1];
9164 new_node_pt->x(2) = x_tet[2];
9169 el_pt->node_pt(j) = old_node_pt;
9180 TFace face(tet_el_pt->node_pt(central_tet_vertex),
9181 tet_el_pt->node_pt(tet_edge_node[0][0]),
9182 tet_el_pt->node_pt(tet_edge_node[2][0]));
9184 old_node_pt = tet_face_node_pt[face];
9185 if (old_node_pt == 0)
9187 Node* new_node_pt = 0;
9188 if (face.is_boundary_face())
9190 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
9194 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
9196 tet_face_node_pt[face] = new_node_pt;
9197 Node_pt.push_back(new_node_pt);
9198 Vector<double> s(3);
9199 Vector<double> s_tet(3);
9200 Vector<double> x_tet(3);
9201 el_pt->local_coordinate_of_node(j, s);
9202 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
9203 tet_el_pt->interpolated_x(s_tet, x_tet);
9204 new_node_pt->x(0) = x_tet[0];
9205 new_node_pt->x(1) = x_tet[1];
9206 new_node_pt->x(2) = x_tet[2];
9211 el_pt->node_pt(j) = old_node_pt;
9222 TFace face(tet_el_pt->node_pt(central_tet_vertex),
9223 tet_el_pt->node_pt(tet_edge_node[1][0]),
9224 tet_el_pt->node_pt(tet_edge_node[2][0]));
9226 old_node_pt = tet_face_node_pt[face];
9227 if (old_node_pt == 0)
9229 Node* new_node_pt = 0;
9230 if (face.is_boundary_face())
9232 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
9236 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
9238 tet_face_node_pt[face] = new_node_pt;
9239 Node_pt.push_back(new_node_pt);
9240 Vector<double> s(3);
9241 Vector<double> s_tet(3);
9242 Vector<double> x_tet(3);
9243 el_pt->local_coordinate_of_node(j, s);
9244 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
9245 tet_el_pt->interpolated_x(s_tet, x_tet);
9246 new_node_pt->x(0) = x_tet[0];
9247 new_node_pt->x(1) = x_tet[1];
9248 new_node_pt->x(2) = x_tet[2];
9253 el_pt->node_pt(j) = old_node_pt;
9264 TFace face(tet_el_pt->node_pt(central_tet_vertex),
9265 tet_el_pt->node_pt(tet_edge_node[0][0]),
9266 tet_el_pt->node_pt(tet_edge_node[1][0]));
9268 old_node_pt = tet_face_node_pt[face];
9269 if (old_node_pt == 0)
9271 Node* new_node_pt = 0;
9272 if (face.is_boundary_face())
9274 new_node_pt = el_pt->construct_boundary_node(j, time_stepper_pt);
9278 new_node_pt = el_pt->construct_node(j, time_stepper_pt);
9280 tet_face_node_pt[face] = new_node_pt;
9281 Node_pt.push_back(new_node_pt);
9282 Vector<double> s(3);
9283 Vector<double> s_tet(3);
9284 Vector<double> x_tet(3);
9285 el_pt->local_coordinate_of_node(j, s);
9286 dummy_q_el_pt[3]->interpolated_s_tet(s, s_tet);
9287 tet_el_pt->interpolated_x(s_tet, x_tet);
9288 new_node_pt->x(0) = x_tet[0];
9289 new_node_pt->x(1) = x_tet[1];
9290 new_node_pt->x(2) = x_tet[2];
9295 el_pt->node_pt(j) = old_node_pt;
9305 el_pt->node_pt(j) = top_mid_face_node2_pt;
9314 el_pt->node_pt(j) = top_mid_face_node1_pt;
9323 el_pt->node_pt(j) = top_mid_face_node0_pt;
9333 for (
int face_index = 0; face_index < 4; face_index++)
9341 face_pt =
new TFace(tet_el_pt->node_pt(1),
9342 tet_el_pt->node_pt(2),
9343 tet_el_pt->node_pt(3));
9348 face_pt =
new TFace(tet_el_pt->node_pt(0),
9349 tet_el_pt->node_pt(2),
9350 tet_el_pt->node_pt(3));
9357 face_pt =
new TFace(tet_el_pt->node_pt(0),
9358 tet_el_pt->node_pt(1),
9359 tet_el_pt->node_pt(3));
9365 face_pt =
new TFace(tet_el_pt->node_pt(0),
9366 tet_el_pt->node_pt(1),
9367 tet_el_pt->node_pt(2));
9372 if (face_pt->is_boundary_face())
9374 std::set<unsigned> bnd;
9375 std::set<unsigned>* bnd_pt = &bnd;
9376 face_pt->get_boundaries_pt(bnd_pt);
9379 if ((*bnd_pt).size() > 1)
9381 std::ostringstream error_stream;
9382 error_stream <<
"TFace should only be on one boundary.\n";
9383 throw OomphLibError(error_stream.str(),
9384 OOMPH_CURRENT_FUNCTION,
9385 OOMPH_EXCEPTION_LOCATION);
9389 if ((*bnd_pt).size() == 1)
9392 FaceElement* face_el_pt = 0;
9393 if (tet_mesh_is_solid_mesh)
9396 if (
dynamic_cast<SolidTElement<3, 3>*
>(tet_el_pt) == 0)
9398 std::ostringstream error_stream;
9400 <<
"Tet-element cannot be cast to SolidTElement<3,3>.\n"
9401 <<
"BrickFromTetMesh can only be built from\n"
9402 <<
"mesh containing quadratic tets.\n"
9404 throw OomphLibError(error_stream.str(),
9405 OOMPH_CURRENT_FUNCTION,
9406 OOMPH_EXCEPTION_LOCATION);
9410 face_el_pt =
new DummyFaceElement<SolidTElement<3, 3>>(
9411 tet_el_pt, face_index);
9416 if (
dynamic_cast<TElement<3, 3>*
>(tet_el_pt) == 0)
9418 std::ostringstream error_stream;
9419 error_stream <<
"Tet-element cannot be cast to TElement<3,3>.\n"
9420 <<
"BrickFromTetMesh can only be built from\n"
9421 <<
"mesh containing quadratic tets.\n"
9423 throw OomphLibError(error_stream.str(),
9424 OOMPH_CURRENT_FUNCTION,
9425 OOMPH_EXCEPTION_LOCATION);
9431 new DummyFaceElement<TElement<3, 3>>(tet_el_pt, face_index);
9437 unsigned b = (*(*bnd_pt).begin());
9438 Boundary_coordinate_exists[b] =
true;
9439 face_el_pt->set_boundary_number_in_bulk_mesh(b);
9443 Vector<Node*> brick_face_node_pt(19);
9448 brick_face_node_pt[0] = brick_el1_pt->node_pt(0);
9449 brick_face_node_pt[1] = brick_el3_pt->node_pt(0);
9450 brick_face_node_pt[2] = brick_el2_pt->node_pt(0);
9452 brick_face_node_pt[3] = brick_el1_pt->node_pt(18);
9453 brick_face_node_pt[4] = brick_el2_pt->node_pt(18);
9454 brick_face_node_pt[5] = brick_el1_pt->node_pt(2);
9456 brick_face_node_pt[6] = brick_el1_pt->node_pt(9);
9457 brick_face_node_pt[7] = brick_el3_pt->node_pt(1);
9458 brick_face_node_pt[8] = brick_el3_pt->node_pt(9);
9460 brick_face_node_pt[9] = brick_el2_pt->node_pt(9);
9461 brick_face_node_pt[10] = brick_el2_pt->node_pt(3);
9462 brick_face_node_pt[11] = brick_el1_pt->node_pt(1);
9464 brick_face_node_pt[12] = brick_el1_pt->node_pt(20);
9466 brick_face_node_pt[13] = brick_el2_pt->node_pt(12);
9467 brick_face_node_pt[14] = brick_el1_pt->node_pt(19);
9469 brick_face_node_pt[15] = brick_el1_pt->node_pt(10);
9470 brick_face_node_pt[16] = brick_el2_pt->node_pt(21);
9472 brick_face_node_pt[17] = brick_el3_pt->node_pt(10);
9473 brick_face_node_pt[18] = brick_el1_pt->node_pt(11);
9477 brick_face_node_pt[0] = brick_el0_pt->node_pt(0);
9478 brick_face_node_pt[1] = brick_el3_pt->node_pt(0);
9479 brick_face_node_pt[2] = brick_el2_pt->node_pt(0);
9481 brick_face_node_pt[3] = brick_el0_pt->node_pt(18);
9482 brick_face_node_pt[4] = brick_el2_pt->node_pt(18);
9483 brick_face_node_pt[5] = brick_el0_pt->node_pt(6);
9485 brick_face_node_pt[6] = brick_el0_pt->node_pt(9);
9486 brick_face_node_pt[7] = brick_el3_pt->node_pt(3);
9487 brick_face_node_pt[8] = brick_el3_pt->node_pt(9);
9489 brick_face_node_pt[9] = brick_el2_pt->node_pt(9);
9490 brick_face_node_pt[10] = brick_el2_pt->node_pt(1);
9491 brick_face_node_pt[11] = brick_el0_pt->node_pt(3);
9493 brick_face_node_pt[12] = brick_el0_pt->node_pt(24);
9495 brick_face_node_pt[13] = brick_el2_pt->node_pt(10);
9496 brick_face_node_pt[14] = brick_el0_pt->node_pt(21);
9498 brick_face_node_pt[15] = brick_el0_pt->node_pt(12);
9499 brick_face_node_pt[16] = brick_el3_pt->node_pt(21);
9501 brick_face_node_pt[17] = brick_el3_pt->node_pt(12);
9502 brick_face_node_pt[18] = brick_el0_pt->node_pt(15);
9506 brick_face_node_pt[0] = brick_el0_pt->node_pt(0);
9507 brick_face_node_pt[1] = brick_el1_pt->node_pt(0);
9508 brick_face_node_pt[2] = brick_el2_pt->node_pt(0);
9510 brick_face_node_pt[3] = brick_el0_pt->node_pt(2);
9511 brick_face_node_pt[4] = brick_el1_pt->node_pt(2);
9512 brick_face_node_pt[5] = brick_el0_pt->node_pt(6);
9514 brick_face_node_pt[6] = brick_el0_pt->node_pt(1);
9515 brick_face_node_pt[7] = brick_el1_pt->node_pt(3);
9516 brick_face_node_pt[8] = brick_el1_pt->node_pt(1);
9518 brick_face_node_pt[9] = brick_el2_pt->node_pt(3);
9519 brick_face_node_pt[10] = brick_el2_pt->node_pt(1);
9520 brick_face_node_pt[11] = brick_el0_pt->node_pt(3);
9522 brick_face_node_pt[12] = brick_el0_pt->node_pt(8);
9524 brick_face_node_pt[13] = brick_el2_pt->node_pt(4);
9525 brick_face_node_pt[14] = brick_el0_pt->node_pt(5);
9527 brick_face_node_pt[15] = brick_el0_pt->node_pt(4);
9528 brick_face_node_pt[16] = brick_el1_pt->node_pt(5);
9530 brick_face_node_pt[17] = brick_el1_pt->node_pt(4);
9531 brick_face_node_pt[18] = brick_el0_pt->node_pt(7);
9535 brick_face_node_pt[0] = brick_el1_pt->node_pt(0);
9536 brick_face_node_pt[1] = brick_el3_pt->node_pt(0);
9537 brick_face_node_pt[2] = brick_el0_pt->node_pt(0);
9539 brick_face_node_pt[3] = brick_el1_pt->node_pt(18);
9540 brick_face_node_pt[4] = brick_el3_pt->node_pt(6);
9541 brick_face_node_pt[5] = brick_el1_pt->node_pt(6);
9543 brick_face_node_pt[6] = brick_el1_pt->node_pt(9);
9544 brick_face_node_pt[7] = brick_el3_pt->node_pt(1);
9545 brick_face_node_pt[8] = brick_el3_pt->node_pt(3);
9547 brick_face_node_pt[9] = brick_el0_pt->node_pt(9);
9548 brick_face_node_pt[10] = brick_el0_pt->node_pt(1);
9549 brick_face_node_pt[11] = brick_el1_pt->node_pt(3);
9551 brick_face_node_pt[12] = brick_el1_pt->node_pt(24);
9553 brick_face_node_pt[13] = brick_el0_pt->node_pt(10);
9554 brick_face_node_pt[14] = brick_el1_pt->node_pt(21);
9556 brick_face_node_pt[15] = brick_el1_pt->node_pt(12);
9557 brick_face_node_pt[16] = brick_el3_pt->node_pt(7);
9559 brick_face_node_pt[17] = brick_el3_pt->node_pt(4);
9560 brick_face_node_pt[18] = brick_el1_pt->node_pt(15);
9566 Vector<unsigned> translate(19);
9569 for (
unsigned i = 0; i < 19; i++)
9575 for (
unsigned j = 0; j < 19; j++)
9578 Node* brick_node_pt = brick_face_node_pt[translate[j]];
9581 Vector<double> s = s_face[j];
9582 Vector<double> zeta(2);
9583 Vector<double> x(3);
9584 face_el_pt->interpolated_zeta(s, zeta);
9585 face_el_pt->interpolated_x(s, x);
9589 double dist = sqrt(pow(brick_node_pt->x(0) - x[0], 2) +
9590 pow(brick_node_pt->x(1) - x[1], 2) +
9591 pow(brick_node_pt->x(2) - x[2], 2));
9592 if (dist > BrickFromTetMeshHelper::Face_position_tolerance)
9594 std::ofstream brick0;
9595 std::ofstream brick1;
9596 std::ofstream brick2;
9597 std::ofstream brick3;
9598 brick0.open(
"full_brick0.dat");
9599 brick1.open(
"full_brick1.dat");
9600 brick2.open(
"full_brick2.dat");
9601 brick3.open(
"full_brick3.dat");
9602 for (
unsigned j = 0; j < 27; j++)
9604 brick0 << brick_el0_pt->node_pt(j)->x(0) <<
" "
9605 << brick_el0_pt->node_pt(j)->x(1) <<
" "
9606 << brick_el0_pt->node_pt(j)->x(2) <<
"\n";
9608 brick1 << brick_el1_pt->node_pt(j)->x(0) <<
" "
9609 << brick_el1_pt->node_pt(j)->x(1) <<
" "
9610 << brick_el1_pt->node_pt(j)->x(2) <<
"\n";
9612 brick2 << brick_el2_pt->node_pt(j)->x(0) <<
" "
9613 << brick_el2_pt->node_pt(j)->x(1) <<
" "
9614 << brick_el2_pt->node_pt(j)->x(2) <<
"\n";
9616 brick3 << brick_el3_pt->node_pt(j)->x(0) <<
" "
9617 << brick_el3_pt->node_pt(j)->x(1) <<
" "
9618 << brick_el3_pt->node_pt(j)->x(2) <<
"\n";
9625 std::ofstream full_face;
9626 full_face.open(
"full_face.dat");
9627 for (
unsigned j = 0; j < 6; j++)
9629 full_face << face_el_pt->node_pt(j)->x(0) <<
" "
9630 << face_el_pt->node_pt(j)->x(1) <<
" "
9631 << face_el_pt->node_pt(j)->x(2) <<
"\n";
9636 int normal_sign = face_el_pt->normal_sign();
9638 std::ostringstream error_stream;
9640 <<
"During assignment of boundary cordinates, the distance\n"
9641 <<
"between brick node and reference point in \n"
9642 <<
"triangular FaceElement is " << dist <<
" which \n"
9643 <<
"is bigger than the tolerance defined in \n"
9644 <<
"BrickFromTetMeshHelper::Face_position_tolerance="
9645 << BrickFromTetMeshHelper::Face_position_tolerance <<
".\n"
9646 <<
"If this is tolerable, increase the tolerance \n"
9647 <<
"(it's defined in a namespace and therefore publically\n"
9648 <<
"accessible). If not, the Face may be inverted in which \n"
9649 <<
"case you should re-implement the translation scheme,\n"
9650 <<
"following the pattern used in the "
9651 "ThinLayerBrickOnTetMesh."
9652 <<
"\nThe required code fragements are already here but \n"
9653 <<
"the translation is the unit map.\n"
9654 <<
"To aid the diagnostics, the files full_brick[0-3].dat\n"
9655 <<
"contain the coordinates of the 27 nodes in the four\n"
9656 <<
"bricks associated with the current tet and "
9658 <<
"contains the coordinates of the 6 nodes in the "
9660 <<
"\nfrom which the boundary coordinates are extracted.\n"
9661 <<
"FYI: The normal_sign of the face is: " << normal_sign
9663 throw OomphLibError(error_stream.str(),
9664 OOMPH_CURRENT_FUNCTION,
9665 OOMPH_EXCEPTION_LOCATION);
9670 add_boundary_node(b, brick_node_pt);
9671 brick_node_pt->set_coordinates_on_boundary(b, zeta);
9678 Boundary_element_pt[b].push_back(brick_el1_pt);
9679 Face_index_at_boundary[b].push_back(-2);
9680 Boundary_element_pt[b].push_back(brick_el2_pt);
9681 Face_index_at_boundary[b].push_back(-1);
9682 Boundary_element_pt[b].push_back(brick_el3_pt);
9683 Face_index_at_boundary[b].push_back(-2);
9687 Boundary_element_pt[b].push_back(brick_el0_pt);
9688 Face_index_at_boundary[b].push_back(-1);
9689 Boundary_element_pt[b].push_back(brick_el2_pt);
9690 Face_index_at_boundary[b].push_back(-2);
9691 Boundary_element_pt[b].push_back(brick_el3_pt);
9692 Face_index_at_boundary[b].push_back(-1);
9696 Boundary_element_pt[b].push_back(brick_el0_pt);
9697 Face_index_at_boundary[b].push_back(-3);
9698 Boundary_element_pt[b].push_back(brick_el1_pt);
9699 Face_index_at_boundary[b].push_back(-3);
9700 Boundary_element_pt[b].push_back(brick_el2_pt);
9701 Face_index_at_boundary[b].push_back(-3);
9705 Boundary_element_pt[b].push_back(brick_el0_pt);
9706 Face_index_at_boundary[b].push_back(-2);
9707 Boundary_element_pt[b].push_back(brick_el1_pt);
9708 Face_index_at_boundary[b].push_back(-1);
9709 Boundary_element_pt[b].push_back(brick_el3_pt);
9710 Face_index_at_boundary[b].push_back(-3);
9723 Lookup_for_elements_next_boundary_is_setup =
true;
9739 for (
unsigned e = 0; e < 4; e++)
9741 for (
unsigned j = 0; j < 8; j++)
9743 delete dummy_q_el_pt[e]->node_pt(j);
9745 delete dummy_q_el_pt[e];
void build_mesh(XdaTetMesh< TElement< 3, 3 >> *tet_mesh_pt, TimeStepper *time_stepper_pt)
Build fct: Pass pointer to existing tet mesh.
Unstructured tet mesh based on output from Tetgen: http://wias-berlin.de/software/tetgen/.
Tet mesh made of quadratic (ten node) tets built from xda input file.
////////////////////////////////////////////////////////////////////// //////////////////////////////...