46 outfile <<
"ZONE I=2, J=2, K=2 C=" <<
colour << std::endl;
52 outfile << corner[0] <<
" " << corner[1] <<
" " << corner[2] <<
" "
59 outfile << corner[0] <<
" " << corner[1] <<
" " << corner[2] <<
" "
66 outfile << corner[0] <<
" " << corner[1] <<
" " << corner[2] <<
" "
73 outfile << corner[0] <<
" " << corner[1] <<
" " << corner[2] <<
" "
83 outfile << corner[0] <<
" " << corner[1] <<
" " << corner[2] <<
" "
90 outfile << corner[0] <<
" " << corner[1] <<
" " << corner[2] <<
" "
97 outfile << corner[0] <<
" " << corner[1] <<
" " << corner[2] <<
" "
104 outfile << corner[0] <<
" " << corner[1] <<
" " << corner[2] <<
" "
128 using namespace OcTreeNames;
131 unsigned n_p = nnode_1d();
134 Father_bound[n_p].resize(n_p * n_p * n_p, 8);
137 for (
unsigned n = 0; n < n_p * n_p * n_p; n++)
139 for (
unsigned ison = 0; ison < 8; ison++)
145 for (
int i_son =
LDB; i_son <=
RUF; i_son++)
152 for (
unsigned i0 = 0; i0 < n_p; i0++)
154 for (
unsigned i1 = 0; i1 < n_p; i1++)
156 for (
unsigned i2 = 0; i2 < n_p; i2++)
159 for (
unsigned i = 0;
i < 3;
i++)
161 vect_bound[
i] = -vect_son[
i];
204 for (
int i = 0;
i < 3;
i++)
206 vect_bound[
i] = (vect_bound[
i] + vect_son[
i]) / 2;
210 Father_bound[n_p](i0 + n_p * i1 + n_p * n_p * i2, i_son) =
240 using namespace OcTreeNames;
243 unsigned nvalue = ncont_interpolated_values();
245 Vector<int> bound_cons1(nvalue), bound_cons2(nvalue);
258 for (
int i = 0;
i < 3;
i++)
260 if (vect_elem[
i] != 0)
263 notzero.push_back(
i);
271 get_face_bcs(bound, bound_cons);
277 for (
unsigned i = 0;
i < 3;
i++)
283 vect1[notzero[0]] = vect_elem[notzero[0]];
284 vect2[notzero[1]] = vect_elem[notzero[1]];
289 for (
unsigned k = 0; k < nvalue; k++)
291 bound_cons[k] = (bound_cons1[k] || bound_cons2[k]);
298 for (
unsigned i = 0;
i < 3;
i++)
305 vect1[0] = vect_elem[0];
306 vect2[1] = vect_elem[1];
307 vect3[2] = vect_elem[2];
315 for (
unsigned k = 0; k < nvalue; k++)
317 bound_cons[k] = (bound_cons1[k] || bound_cons2[k] || bound_cons3[k]);
322 throw OomphLibError(
"Make sure you are not giving OMEGA as bound",
323 OOMPH_CURRENT_FUNCTION,
324 OOMPH_EXCEPTION_LOCATION);
340 using namespace OcTreeNames;
343 unsigned n_p = nnode_1d();
345 unsigned node1, node2, node3, node4;
351 node1 = n_p * n_p * n_p - 1;
352 node2 = n_p * n_p - 1;
353 node3 = n_p * (n_p - 1);
354 node4 = n_p * (n_p * n_p - 1);
360 node3 = (n_p * n_p + 1) * (n_p - 1);
361 node4 = n_p * n_p * (n_p - 1);
366 node2 = (n_p * n_p + 1) * (n_p - 1);
367 node3 = n_p * n_p * n_p - 1;
368 node4 = n_p * n_p - 1;
373 node2 = n_p * (n_p - 1);
374 node3 = n_p * (n_p * n_p - 1);
375 node4 = n_p * n_p * (n_p - 1);
381 node3 = n_p * n_p - 1;
382 node4 = n_p * (n_p - 1);
386 node1 = n_p * n_p * n_p - 1;
387 node2 = n_p * (n_p * n_p - 1);
388 node3 = n_p * n_p * (n_p - 1);
389 node4 = (n_p - 1) * (n_p * n_p + 1);
393 std::ostringstream error_stream;
394 error_stream <<
"Wrong edge " << face <<
" passed\n";
397 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
401 unsigned maxnvalue = ncont_interpolated_values();
406 for (
unsigned k = 0; k < maxnvalue; k++)
409 node_pt(node1)->is_pinned(k) * node_pt(node2)->is_pinned(k) *
410 node_pt(node3)->is_pinned(k) * node_pt(node4)->is_pinned(k);
425 std::set<unsigned>& boundary)
const
427 using namespace OcTreeNames;
430 unsigned n_p = nnode_1d();
445 int one_d_node_number[3] = {0, 0, 0};
448 for (
int i = 0;
i < 3;
i++)
450 if (vect_face[
i] == 0)
460 if (vect_face[
i] == 1)
462 one_d_node_number[
i] = n_p - 1;
471 node[0] = one_d_node_number[0] + n_p * one_d_node_number[1] +
472 n_p * n_p * one_d_node_number[2];
482 node[0] = (n_p - 1) + n_p * one_d_node_number[1] +
483 n_p * n_p * one_d_node_number[2];
485 n_p * one_d_node_number[1] + n_p * n_p * one_d_node_number[2];
489 node[0] = n_p * (n_p - 1) + one_d_node_number[0] +
490 n_p * n_p * one_d_node_number[2];
491 node[1] = one_d_node_number[0] + n_p * n_p * one_d_node_number[2];
495 node[0] = one_d_node_number[0] + n_p * one_d_node_number[1] +
496 n_p * n_p * (n_p - 1);
497 node[1] = one_d_node_number[0] + n_p * one_d_node_number[1];
508 one_d_node_number[0] + n_p * n_p * (n_p - 1) + n_p * (n_p - 1);
509 node[1] = one_d_node_number[0] + n_p * (n_p - 1);
510 node[2] = one_d_node_number[0] + n_p * n_p * (n_p - 1);
511 node[3] = one_d_node_number[0];
516 n_p * one_d_node_number[1] + n_p * n_p * (n_p - 1) + (n_p - 1);
517 node[1] = n_p * one_d_node_number[1] + (n_p - 1);
518 node[2] = n_p * one_d_node_number[1] + n_p * n_p * (n_p - 1);
519 node[3] = n_p * one_d_node_number[1];
524 n_p * n_p * one_d_node_number[2] + n_p * (n_p - 1) + (n_p - 1);
525 node[1] = n_p * n_p * one_d_node_number[2] + (n_p - 1);
526 node[2] = n_p * n_p * one_d_node_number[2] + n_p * (n_p - 1);
527 node[3] = n_p * n_p * one_d_node_number[2];
531 throw OomphLibError(
"Make sure you are not giving OMEGA as boundary",
532 OOMPH_CURRENT_FUNCTION,
533 OOMPH_EXCEPTION_LOCATION);
544 for (
unsigned i = 0;
i < 4;
i++)
546 node_pt(node[
i])->get_boundaries_pt(node_boundaries_pt[
i]);
553 for (
unsigned i = 0;
i < 2;
i++)
556 if ((node_boundaries_pt[2 *
i] != 0) &&
557 (node_boundaries_pt[2 *
i + 1] != 0))
560 std::set_intersection(
561 node_boundaries_pt[2 *
i]->begin(),
562 node_boundaries_pt[2 *
i]->end(),
563 node_boundaries_pt[2 *
i + 1]->begin(),
564 node_boundaries_pt[2 *
i + 1]->end(),
565 inserter(boundary_aux[
i], boundary_aux[
i].begin()));
570 set_intersection(boundary_aux[0].begin(),
571 boundary_aux[0].end(),
572 boundary_aux[1].begin(),
573 boundary_aux[1].end(),
574 inserter(boundary, boundary.begin()));
583 const unsigned& boundary,
588 using namespace OcTreeNames;
591 unsigned nnodes_1d = nnode_1d();
594 unsigned nnodes_2d = nnodes_1d * nnodes_1d;
597 unsigned nnodes_3d = nnode();
600 Shape psi(nnodes_3d);
607 unsigned start = 0, increment1 = 1, increment2 = 1;
619 std::ostringstream error_stream;
620 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
621 <<
" is not on Left face\n";
624 OOMPH_CURRENT_FUNCTION,
625 OOMPH_EXCEPTION_LOCATION);
629 increment1 = nnodes_1d;
638 std::ostringstream error_stream;
639 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
640 <<
" is not on Right face\n";
643 OOMPH_CURRENT_FUNCTION,
644 OOMPH_EXCEPTION_LOCATION);
648 start = nnodes_1d - 1;
649 increment1 = nnodes_1d;
658 std::ostringstream error_stream;
659 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
660 <<
" is not on Bottom face\n";
663 OOMPH_CURRENT_FUNCTION,
664 OOMPH_EXCEPTION_LOCATION);
668 increment2 = nnodes_2d - nnodes_1d;
676 std::ostringstream error_stream;
677 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
678 <<
" is not on Upper face\n";
681 OOMPH_CURRENT_FUNCTION,
682 OOMPH_EXCEPTION_LOCATION);
686 start = nnodes_2d - nnodes_1d;
695 std::ostringstream error_stream;
696 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
697 <<
" is not on Back face\n";
700 OOMPH_CURRENT_FUNCTION,
701 OOMPH_EXCEPTION_LOCATION);
713 std::ostringstream error_stream;
714 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
715 <<
" is not on Front face\n";
718 OOMPH_CURRENT_FUNCTION,
719 OOMPH_EXCEPTION_LOCATION);
723 start = nnodes_3d - nnodes_2d;
730 if ((
s[0] != -1.0) || (
s[2] != 1.0))
732 std::ostringstream error_stream;
733 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
734 <<
" is not on Front-Left edge\n";
737 OOMPH_CURRENT_FUNCTION,
738 OOMPH_EXCEPTION_LOCATION);
741 start = nnodes_3d - nnodes_2d;
742 increment1 = nnodes_1d;
747 if ((
s[0] != -1.0) || (
s[1] != -1.0))
749 std::ostringstream error_stream;
750 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
751 <<
" is not on Bottom-Left edge\n";
754 OOMPH_CURRENT_FUNCTION,
755 OOMPH_EXCEPTION_LOCATION);
758 increment1 = nnodes_2d;
763 if ((
s[0] != -1.0) || (
s[1] != 1.0))
765 std::ostringstream error_stream;
766 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
767 <<
" is not on Upper-Left edge\n";
770 OOMPH_CURRENT_FUNCTION,
771 OOMPH_EXCEPTION_LOCATION);
774 start = nnodes_2d - nnodes_1d;
775 increment1 = nnodes_2d;
780 if ((
s[0] != -1.0) || (
s[2] != -1.0))
782 std::ostringstream error_stream;
783 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
784 <<
" is not on Back-Left edge\n";
787 OOMPH_CURRENT_FUNCTION,
788 OOMPH_EXCEPTION_LOCATION);
791 increment1 = nnodes_1d;
796 if ((
s[0] != 1.0) || (
s[2] != 1.0))
798 std::ostringstream error_stream;
799 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
800 <<
" is not on Front-Right edge\n";
803 OOMPH_CURRENT_FUNCTION,
804 OOMPH_EXCEPTION_LOCATION);
807 start = nnodes_3d - 1;
808 increment1 = -nnodes_1d;
813 if ((
s[0] != 1.0) || (
s[1] != -1.0))
815 std::ostringstream error_stream;
816 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
817 <<
" is not on Bottom-Right edge\n";
820 OOMPH_CURRENT_FUNCTION,
821 OOMPH_EXCEPTION_LOCATION);
824 start = nnodes_1d - 1;
825 increment1 = nnodes_2d;
830 if ((
s[0] != 1.0) || (
s[1] != 1.0))
832 std::ostringstream error_stream;
833 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
834 <<
" is not on Upper-Right edge\n";
837 OOMPH_CURRENT_FUNCTION,
838 OOMPH_EXCEPTION_LOCATION);
841 start = nnodes_2d - 1;
842 increment1 = nnodes_2d;
847 if ((
s[0] != 1.0) || (
s[2] != -1.0))
849 std::ostringstream error_stream;
850 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
851 <<
" is not on Back-Right edge\n";
854 OOMPH_CURRENT_FUNCTION,
855 OOMPH_EXCEPTION_LOCATION);
858 start = nnodes_1d - 1;
859 increment1 = nnodes_1d;
864 if ((
s[1] != -1.0) || (
s[2] != -1.0))
866 std::ostringstream error_stream;
867 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
868 <<
" is not on Back-Bottom edge\n";
871 OOMPH_CURRENT_FUNCTION,
872 OOMPH_EXCEPTION_LOCATION);
879 if ((
s[1] != -1.0) || (
s[2] != 1.0))
881 std::ostringstream error_stream;
882 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
883 <<
" is not on Front-Bottom edge\n";
886 OOMPH_CURRENT_FUNCTION,
887 OOMPH_EXCEPTION_LOCATION);
890 start = nnodes_3d - nnodes_2d;
895 if ((
s[1] != 1.0) || (
s[2] != -1.0))
897 std::ostringstream error_stream;
898 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
899 <<
" is not on Back-Upper edge\n";
902 OOMPH_CURRENT_FUNCTION,
903 OOMPH_EXCEPTION_LOCATION);
906 start = nnodes_2d - nnodes_1d;
911 if ((
s[1] != 1.0) || (
s[2] != 1.0))
913 std::ostringstream error_stream;
914 error_stream <<
"Coordinate " <<
s[0] <<
" " <<
s[1] <<
" " <<
s[2]
915 <<
" is not on Upper-Front edge\n";
918 OOMPH_CURRENT_FUNCTION,
919 OOMPH_EXCEPTION_LOCATION);
922 start = nnodes_3d - nnodes_1d;
927 std::ostringstream error_stream;
929 <<
" passed" << std::endl;
930 error_stream <<
"Trouble at : s= [" <<
s[0] <<
" " <<
s[1] <<
" "
933 this->interpolated_x(
s, x);
934 error_stream <<
"corresponding to : x= [" << x[0] <<
" " << x[1] <<
" "
937 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
945 unsigned node =
start;
949 for (
unsigned l1 = 0; l1 < nnodes_1d; l1++)
953 node_pt(node)->get_coordinates_on_boundary(boundary, node_zeta);
956 zeta[0] += node_zeta[0] * psi(node);
957 zeta[1] += node_zeta[1] * psi(node);
965 for (
unsigned l2 = 0; l2 < nnodes_1d; l2++)
967 for (
unsigned l1 = 0; l1 < nnodes_1d; l1++)
971 node_pt(node)->get_coordinates_on_boundary(boundary, node_zeta);
974 zeta[0] += node_zeta[0] * psi(node);
975 zeta[1] += node_zeta[1] * psi(node);
995 using namespace OcTreeNames;
1001 if (s_fraction[0] == 0.0)
1004 if (s_fraction[1] == 0.0)
1006 edges.push_back(
LD);
1008 if (s_fraction[2] == 0.0)
1010 edges.push_back(
LB);
1012 if (s_fraction[1] == 1.0)
1014 edges.push_back(
LU);
1016 if (s_fraction[2] == 1.0)
1018 edges.push_back(
LF);
1022 if (s_fraction[0] == 1.0)
1025 if (s_fraction[1] == 0.0)
1027 edges.push_back(
RD);
1029 if (s_fraction[2] == 0.0)
1031 edges.push_back(
RB);
1033 if (s_fraction[1] == 1.0)
1035 edges.push_back(
RU);
1037 if (s_fraction[2] == 1.0)
1039 edges.push_back(
RF);
1043 if (s_fraction[1] == 0.0)
1046 if (s_fraction[2] == 0.0)
1048 edges.push_back(
DB);
1050 if (s_fraction[2] == 1.0)
1052 edges.push_back(
DF);
1056 if (s_fraction[1] == 1.0)
1059 if (s_fraction[2] == 0.0)
1061 edges.push_back(
UB);
1063 if (s_fraction[2] == 1.0)
1065 edges.push_back(
UF);
1069 if (s_fraction[2] == 0.0)
1074 if (s_fraction[2] == 1.0)
1080 unsigned n_face = faces.size();
1083 unsigned n_edge = edges.size();
1090 int neigh_face, diff_level;
1094 for (
unsigned j = 0; j < n_face; j++)
1098 bool in_neighbouring_tree;
1108 in_neighbouring_tree);
1124 for (
unsigned i = 0;
i < 3;
i++)
1126 s[
i] = s_lo_neigh[
i] +
1127 s_fraction[translate_s[
i]] * (s_hi_neigh[
i] - s_lo_neigh[
i]);
1131 Node* neighbour_node_pt =
1135 if (neighbour_node_pt != 0)
1139 if (in_neighbouring_tree)
1143 octree_pt()->root_pt()->is_neighbour_periodic(faces[j]);
1147 return neighbour_node_pt;
1155 for (
unsigned j = 0; j < n_edge; j++)
1169 unsigned i_root_edge_neighbour = 0;
1172 unsigned nroot_edge_neighbour = 0;
1176 bool keep_searching =
true;
1177 while (keep_searching)
1182 i_root_edge_neighbour,
1183 nroot_edge_neighbour,
1204 for (
unsigned i = 0;
i < 3;
i++)
1206 s[
i] = s_lo_neigh[
i] + s_fraction[translate_s[
i]] *
1207 (s_hi_neigh[
i] - s_lo_neigh[
i]);
1211 Node* neighbour_node_pt =
1215 if (neighbour_node_pt != 0)
1222 unsigned n_faces_attached_to_edge = faces_attached_to_edge.size();
1225 for (
unsigned i_face = 0; i_face < n_faces_attached_to_edge;
1229 is_periodic = octree_pt()->root_pt()->is_neighbour_periodic(
1230 faces_attached_to_edge[i_face]);
1242 return neighbour_node_pt;
1249 i_root_edge_neighbour++;
1252 if (i_root_edge_neighbour >= nroot_edge_neighbour)
1255 keep_searching =
false;
1295 bool& was_already_built,
1296 std::ofstream& new_nodes_file)
1298 using namespace OcTreeNames;
1304 unsigned n_p = nnode_1d();
1307 if (Father_bound[n_p].nrow() == 0)
1309 setup_father_bounds();
1313 OcTree* father_pt =
dynamic_cast<OcTree*
>(octree_pt()->father_pt());
1316 int son_type = octree_pt()->
son_type();
1325 "Something fishy here: I have no father and yet \n";
1326 error_message +=
"I have no nodes. Who has created me then?!\n";
1329 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1334 was_already_built =
false;
1346 unsigned ntstorage = time_stepper_pt->ntstorage();
1353 throw OomphLibError(
"Can't handle generalised nodal positions (yet).",
1354 OOMPH_CURRENT_FUNCTION,
1355 OOMPH_EXCEPTION_LOCATION);
1366 s_lo = octree_pt()->Direction_to_vector[son_type];
1370 for (
unsigned i = 0;
i < n_dim;
i++)
1372 s_lo[
i] = (s_lo[
i] + 1) / 2 - 1;
1376 for (
unsigned i = 0;
i < n_dim;
i++)
1378 s_hi[
i] = s_lo[
i] + 1;
1386 for (
unsigned i = 0;
i < n_dim;
i++)
1390 0.5 * (s_lo[
i] + 1.0) *
1394 0.5 * (s_hi[
i] + 1.0) *
1401 if (father_el_pt->
node_pt(0) == 0)
1404 "Trouble: father_el_pt->node_pt(0)==0\n Can't build son element!\n",
1405 OOMPH_CURRENT_FUNCTION,
1406 OOMPH_EXCEPTION_LOCATION);
1414 for (
unsigned i0 = 0; i0 < n_p; i0++)
1417 s_fraction[0] = local_one_d_fraction_of_node(i0, 0);
1419 s[0] = s_lo[0] + (s_hi[0] - s_lo[0]) * s_fraction[0];
1421 for (
unsigned i1 = 0; i1 < n_p; i1++)
1424 s_fraction[1] = local_one_d_fraction_of_node(i1, 1);
1426 s[1] = s_lo[1] + (s_hi[1] - s_lo[1]) * s_fraction[1];
1428 for (
unsigned i2 = 0; i2 < n_p; i2++)
1432 s_fraction[2] = local_one_d_fraction_of_node(i2, 2);
1435 s[2] = s_lo[2] + (s_hi[2] - s_lo[2]) * s_fraction[2];
1438 jnod = i0 + n_p * i1 + n_p * n_p * i2;
1442 bool node_done =
false;
1446 Node* created_node_pt =
1451 bool node_exists_in_father =
false;
1452 if (created_node_pt != 0)
1455 node_exists_in_father =
true;
1458 node_pt(jnod) = created_node_pt;
1466 for (
unsigned t = 0;
t < ntstorage;
t++)
1475 unsigned n_val_at_node = created_node_pt->
nvalue();
1476 unsigned n_val_from_function = prev_values.size();
1478 unsigned n_var = n_val_at_node < n_val_from_function ?
1480 n_val_from_function;
1482 for (
unsigned k = 0; k < n_var; k++)
1484 created_node_pt->
set_value(
t, k, prev_values[k]);
1498 bool is_periodic =
false;
1504 node_created_by_neighbour(s_fraction, is_periodic);
1507 if (created_node_pt != 0)
1512 Node* neighbour_node_pt = created_node_pt;
1515 int father_bound = Father_bound[n_p](jnod, son_type);
1519 std::set<unsigned> boundaries;
1532 if (boundaries.size() > 2)
1535 "boundaries.size()>2 seems a bit strange..\n",
1536 OOMPH_CURRENT_FUNCTION,
1537 OOMPH_EXCEPTION_LOCATION);
1544 if ((is_periodic) && (boundaries.size() > 0))
1548 construct_boundary_node(jnod, time_stepper_pt);
1554 new_node_pt.push_back(created_node_pt);
1557 for (
unsigned t = 0;
t < ntstorage;
t++)
1565 father_el_pt->
get_x(
t,
s, x_prev);
1567 for (
unsigned i = 0;
i < n_dim;
i++)
1569 created_node_pt->
x(
t,
i) = x_prev[
i];
1575 for (std::set<unsigned>::iterator it = boundaries.begin();
1576 it != boundaries.end();
1590 *it, father_bound,
s, zeta);
1602 node_pt(jnod) = created_node_pt;
1615 bool is_periodic =
false;
1617 node_created_by_son_of_neighbour(s_fraction, is_periodic);
1620 if (created_node_pt != 0)
1628 Node* neighbour_node_pt = created_node_pt;
1631 int father_bound = Father_bound[n_p](jnod, son_type);
1635 std::set<unsigned> boundaries;
1648 if (boundaries.size() > 2)
1651 "boundaries.size()>2 seems a bit strange..\n",
1652 OOMPH_CURRENT_FUNCTION,
1653 OOMPH_EXCEPTION_LOCATION);
1658 if (boundaries.size() == 0)
1660 std::ostringstream error_stream;
1662 <<
"Periodic node is not on a boundary...\n"
1663 <<
"Coordinates: " << created_node_pt->
x(0) <<
" "
1664 << created_node_pt->
x(1) <<
"\n";
1666 OOMPH_CURRENT_FUNCTION,
1667 OOMPH_EXCEPTION_LOCATION);
1673 construct_boundary_node(jnod, time_stepper_pt);
1679 new_node_pt.push_back(created_node_pt);
1682 for (
unsigned t = 0;
t < ntstorage;
t++)
1690 father_el_pt->
get_x(
t,
s, x_prev);
1692 for (
unsigned i = 0;
i < n_dim;
i++)
1694 created_node_pt->
x(
t,
i) = x_prev[
i];
1700 for (std::set<unsigned>::iterator it = boundaries.begin();
1701 it != boundaries.end();
1715 *it, father_bound,
s, zeta);
1728 node_pt(jnod) = created_node_pt;
1738 if (!node_exists_in_father)
1751 int father_bound = Father_bound[n_p](jnod, son_type);
1758 std::set<unsigned> boundaries;
1771 if (boundaries.size() > 2)
1774 "boundaries.size()>2 seems a bit strange..\n",
1775 OOMPH_CURRENT_FUNCTION,
1776 OOMPH_EXCEPTION_LOCATION);
1782 if (boundaries.size() > 0)
1789 construct_boundary_node(jnod, time_stepper_pt);
1791 new_node_pt.push_back(created_node_pt);
1801 unsigned n_cont = ncont_interpolated_values();
1803 father_el_pt->
get_bcs(father_bound, bound_cons);
1807 for (
unsigned k = 0; k < n_cont; k++)
1811 created_node_pt->
pin(k);
1818 dynamic_cast<SolidNode*
>(created_node_pt);
1819 if (solid_node_pt != 0)
1822 unsigned n_dim = created_node_pt->
ndim();
1827 if (father_solid_el_pt == 0)
1829 std::string error_message =
"We have a SolidNode outside "
1830 "a refineable SolidElement\n";
1832 "during mesh refinement -- this doesn't make sense";
1835 OOMPH_CURRENT_FUNCTION,
1836 OOMPH_EXCEPTION_LOCATION);
1843 for (
unsigned k = 0; k < n_dim; k++)
1845 if (solid_bound_cons[k])
1855 for (std::set<unsigned>::iterator it = boundaries.begin();
1856 it != boundaries.end();
1871 *it, father_bound,
s, zeta);
1885 created_node_pt = construct_node(jnod, time_stepper_pt);
1887 new_node_pt.push_back(created_node_pt);
1906 for (
unsigned t = 0;
t < ntstorage;
t++)
1914 father_el_pt->
get_x(
t,
s, x_prev);
1917 for (
unsigned i = 0;
i < n_dim;
i++)
1919 created_node_pt->
x(
t,
i) = x_prev[
i];
1925 for (
unsigned t = 0;
t < ntstorage;
t++)
1933 unsigned n_value = created_node_pt->
nvalue();
1934 for (
unsigned k = 0; k < n_value; k++)
1936 created_node_pt->
set_value(
t, k, prev_values[k]);
1966 node_pt(jnod),
s, father_el_pt);
1970 if ((!node_done) && (new_nodes_file.is_open()))
1972 new_nodes_file << node_pt(jnod)->x(0) <<
" "
1973 << node_pt(jnod)->x(1) <<
" "
1974 << node_pt(jnod)->x(2) << std::endl;
1990 if (father_m_el_pt != 0)
2004 "Failed to cast to MacroElementNodeUpdateElementBase*\n";
2006 "Strange -- if the father is a MacroElementNodeUpdateElement\n";
2007 error_message +=
"the son should be too....\n";
2010 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2024 #ifdef OOMPH_HAS_MPI
2026 if (tree_pt()->father_pt()->object_pt()->is_halo())
2029 tree_pt()->father_pt()->object_pt()->non_halo_proc_ID();
2045 if (aux_father_el_pt == 0)
2048 "Failed to cast to ElementWithMovingNodes*\n";
2050 "Strange -- if the son is a ElementWithMovingNodes\n";
2051 error_message +=
"the father should be too....\n";
2054 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2060 if (aux_father_el_pt
2061 ->are_dresidual_dnodal_coordinates_always_evaluated_by_fd())
2073 if (aux_father_el_pt
2074 ->is_fill_in_jacobian_from_geometric_data_bypassed())
2088 was_already_built =
true;
2101 if (output_stream.size() != 6)
2104 OOMPH_CURRENT_FUNCTION,
2105 OOMPH_EXCEPTION_LOCATION);
2109 using namespace OcTreeNames;
2112 oc_hang_helper(-1,
U, *(output_stream[0]));
2113 oc_hang_helper(-1,
D, *(output_stream[1]));
2114 oc_hang_helper(-1,
L, *(output_stream[2]));
2115 oc_hang_helper(-1,
R, *(output_stream[3]));
2116 oc_hang_helper(-1,
B, *(output_stream[4]));
2117 oc_hang_helper(-1,
F, *(output_stream[5]));
2126 using namespace OcTreeNames;
2128 std::ofstream dummy_hangfile;
2130 oc_hang_helper(value_id,
U, dummy_hangfile);
2131 oc_hang_helper(value_id,
D, dummy_hangfile);
2132 oc_hang_helper(value_id,
R, dummy_hangfile);
2133 oc_hang_helper(value_id,
L, dummy_hangfile);
2134 oc_hang_helper(value_id,
B, dummy_hangfile);
2135 oc_hang_helper(value_id,
F, dummy_hangfile);
2144 std::ofstream& output_hangfile)
2146 using namespace OcTreeNames;
2156 bool in_neighbouring_tree;
2166 in_neighbouring_tree);
2172 if (diff_level != 0)
2176 bool is_periodic =
false;
2177 if (in_neighbouring_tree)
2194 int neigh_face_of_neigh;
2195 int diff_level_of_neigh;
2196 bool in_neighbouring_tree_of_neigh;
2200 OcTree* neigh_of_neigh_pt;
2203 translate_s_in_neigh,
2204 s_lo_neigh_of_neigh,
2205 s_hi_neigh_of_neigh,
2206 neigh_face_of_neigh,
2207 diff_level_of_neigh,
2208 in_neighbouring_tree_of_neigh);
2211 neigh_pt = neigh_of_neigh_pt;
2212 neigh_face = neigh_face_of_neigh;
2227 for (
unsigned i = 0;
i < n_dim;
i++)
2229 s_lo_frac[
i] = (s_lo_neigh[
i] - s_min) / (s_max - s_min);
2230 s_hi_frac[
i] = (s_hi_neigh[
i] - s_min) / (s_max - s_min);
2235 for (
unsigned i = 0;
i < n_dim;
i++)
2237 s_lo_neigh[
i] = s_lo_neigh_of_neigh[
i] +
2238 s_lo_frac[translate_s_in_neigh[
i]] *
2239 (s_hi_neigh_of_neigh[
i] - s_lo_neigh_of_neigh[
i]);
2240 s_hi_neigh[
i] = s_lo_neigh_of_neigh[
i] +
2241 s_hi_frac[translate_s_in_neigh[
i]] *
2242 (s_hi_neigh_of_neigh[
i] - s_lo_neigh_of_neigh[
i]);
2247 for (
unsigned i = 0;
i < n_dim;
i++)
2249 temp_translate[
i] = translate_s_in_neigh[translate_s[
i]];
2251 for (
unsigned i = 0;
i < n_dim;
i++)
2253 translate_s[
i] = temp_translate[
i];
2258 unsigned n_p = ninterpolating_node_1d(value_id);
2260 Node* local_node_pt = 0;
2263 for (
unsigned i0 = 0; i0 < n_p; i0++)
2265 for (
unsigned i1 = 0; i1 < n_p; i1++)
2275 local_one_d_fraction_of_interpolating_node(i0, 0, value_id);
2276 s_fraction[1] = 1.0;
2278 local_one_d_fraction_of_interpolating_node(i1, 2, value_id);
2279 local_node_pt = interpolating_node_pt(
2280 i0 + (n_p - 1) * n_p + n_p * n_p * i1, value_id);
2285 local_one_d_fraction_of_interpolating_node(i0, 0, value_id);
2286 s_fraction[1] = 0.0;
2288 local_one_d_fraction_of_interpolating_node(i1, 2, value_id);
2290 interpolating_node_pt(i0 + n_p * n_p * i1, value_id);
2294 s_fraction[0] = 1.0;
2296 local_one_d_fraction_of_interpolating_node(i0, 1, value_id);
2298 local_one_d_fraction_of_interpolating_node(i1, 2, value_id);
2299 local_node_pt = interpolating_node_pt(
2300 n_p - 1 + i0 * n_p + i1 * n_p * n_p, value_id);
2304 s_fraction[0] = 0.0;
2306 local_one_d_fraction_of_interpolating_node(i0, 1, value_id);
2308 local_one_d_fraction_of_interpolating_node(i1, 2, value_id);
2310 interpolating_node_pt(n_p * i0 + i1 * n_p * n_p, value_id);
2315 local_one_d_fraction_of_interpolating_node(i0, 0, value_id);
2317 local_one_d_fraction_of_interpolating_node(i1, 1, value_id);
2318 s_fraction[2] = 0.0;
2319 local_node_pt = interpolating_node_pt(i0 + i1 * n_p, value_id);
2324 local_one_d_fraction_of_interpolating_node(i0, 0, value_id);
2326 local_one_d_fraction_of_interpolating_node(i1, 1, value_id);
2327 s_fraction[2] = 1.0;
2328 local_node_pt = interpolating_node_pt(
2329 i0 + i1 * n_p + (n_p - 1) * n_p * n_p, value_id);
2334 OOMPH_CURRENT_FUNCTION,
2335 OOMPH_EXCEPTION_LOCATION);
2340 for (
unsigned i = 0;
i < n_dim;
i++)
2344 s_fraction[translate_s[
i]] * (s_hi_neigh[
i] - s_lo_neigh[
i]);
2348 Node* neighbouring_node_pt =
2350 s_in_neighb, value_id);
2353 if (0 == neighbouring_node_pt)
2357 bool make_hanging_node =
false;
2363 make_hanging_node =
true;
2369 if ((value_id != -1) && (local_node_pt->
hanging_pt(value_id) ==
2372 make_hanging_node =
true;
2376 if (make_hanging_node ==
true)
2391 unsigned n_neighbour;
2394 for (
unsigned ii0 = 0; ii0 < n_p; ii0++)
2396 for (
unsigned ii1 = 0; ii1 < n_p; ii1++)
2401 n_neighbour = ii0 + n_p * (n_p - 1) + ii1 * n_p * n_p;
2405 n_neighbour = ii0 + ii1 * n_p * n_p;
2409 n_neighbour = ii0 * n_p + ii1 * n_p * n_p;
2413 n_neighbour = (n_p - 1) + ii0 * n_p + ii1 * n_p * n_p;
2417 n_neighbour = ii0 + ii1 * n_p;
2421 n_neighbour = ii0 + ii1 * n_p + n_p * n_p * (n_p - 1);
2425 OOMPH_CURRENT_FUNCTION,
2426 OOMPH_EXCEPTION_LOCATION);
2446 if (output_hangfile.is_open())
2449 output_hangfile << local_node_pt->
x(0) <<
" "
2450 << local_node_pt->
x(1) <<
" "
2451 << local_node_pt->
x(2) << std::endl;
2457 if (local_node_pt != neighbouring_node_pt)
2459 std::ofstream reportage(
"dodgy.dat", std::ios_base::app);
2460 reportage << local_node_pt->
x(0) <<
" " << local_node_pt->
x(1)
2461 <<
" " << local_node_pt->
x(2) << std::endl;
2464 std::ostringstream warning_stream;
2466 <<
"SANITY CHECK in oc_hang_helper \n"
2467 <<
"Current node " << local_node_pt <<
" at "
2468 <<
"(" << local_node_pt->
x(0) <<
", " << local_node_pt->
x(1)
2469 <<
", " << local_node_pt->
x(2) <<
")" << std::endl
2470 <<
" is not hanging and has " << std::endl
2471 <<
"Neighbour's node " << neighbouring_node_pt <<
" at "
2472 <<
"(" << neighbouring_node_pt->
x(0) <<
", "
2473 << neighbouring_node_pt->
x(1) <<
", "
2474 << neighbouring_node_pt->
x(2) <<
")" << std::endl
2475 <<
"even though the two should be "
2476 <<
"identical" << std::endl;
2478 OOMPH_CURRENT_FUNCTION,
2479 OOMPH_EXCEPTION_LOCATION);
2493 local_node_pt->
x(0) = x_in_neighb[0];
2494 local_node_pt->
x(1) = x_in_neighb[1];
2495 local_node_pt->
x(2) = x_in_neighb[2];
2511 using namespace OcTreeNames;
2516 unsigned n_p = nnode_1d();
2520 unsigned n_time = 1;
2525 double max_error_val = 0.0;
2537 for (
unsigned face_counter = 0; face_counter < 6; face_counter++)
2542 int neigh_face, diff_level;
2544 bool in_neighbouring_tree;
2546 my_face = faces[face_counter];
2556 in_neighbouring_tree);
2565 bool is_periodic =
false;
2566 if (in_neighbouring_tree)
2574 for (
unsigned i0 = 0; i0 < n_p; i0++)
2576 for (
unsigned i1 = 0; i1 < n_p; i1++)
2580 switch (face_counter)
2584 s_fraction[0] = local_one_d_fraction_of_node(i0, 0);
2585 s_fraction[1] = 0.0;
2586 s_fraction[2] = local_one_d_fraction_of_node(i1, 2);
2588 n = i0 + i1 * n_p * n_p;
2592 s_fraction[0] = local_one_d_fraction_of_node(i0, 0);
2593 s_fraction[1] = 1.0;
2594 s_fraction[2] = local_one_d_fraction_of_node(i1, 2);
2596 n = i0 + n_p * (n_p - 1) + i1 * n_p * n_p;
2600 s_fraction[0] = 0.0;
2601 s_fraction[1] = local_one_d_fraction_of_node(i0, 1);
2602 s_fraction[2] = local_one_d_fraction_of_node(i1, 2);
2604 n = n_p * i0 + i1 * n_p * n_p;
2608 s_fraction[0] = 1.0;
2609 s_fraction[1] = local_one_d_fraction_of_node(i0, 1);
2610 s_fraction[2] = local_one_d_fraction_of_node(i1, 2);
2612 n = n_p - 1 + n_p * i0 + n_p * n_p * i1;
2616 s_fraction[0] = local_one_d_fraction_of_node(i0, 0);
2617 s_fraction[1] = local_one_d_fraction_of_node(i1, 1);
2618 s_fraction[2] = 0.0;
2624 s_fraction[0] = local_one_d_fraction_of_node(i0, 0);
2625 s_fraction[1] = local_one_d_fraction_of_node(i1, 1);
2626 s_fraction[2] = 1.0;
2628 n = i0 + n_p * i1 + n_p * n_p * (n_p - 1);
2636 for (
unsigned i = 0;
i < 3;
i++)
2638 s[
i] = -1.0 + 2.0 * s_fraction[
i];
2641 s_fraction[translate_s[
i]] * (s_hi_neigh[
i] - s_lo_neigh[
i]);
2646 for (
unsigned t = 0;
t < n_time;
t++)
2651 t, s_in_neighb, x_in_neighb);
2654 if (is_periodic ==
false)
2657 for (
unsigned i = 0;
i < 3;
i++)
2661 std::fabs(node_pt(n)->x(
t,
i) - x_in_neighb[
i]);
2666 oomph_info <<
"errx[" <<
i <<
"], t x, x_neigh: " << err
2667 <<
" " <<
t <<
" " << node_pt(n)->x(
t,
i)
2668 <<
" " << x_in_neighb[
i] << std::endl;
2669 oomph_info <<
"at " << node_pt(n)->x(0) <<
" "
2670 << node_pt(n)->x(1) <<
" " << node_pt(n)->x(2)
2671 <<
" " << std::endl;
2676 if (err > max_error_x[
i])
2678 max_error_x[
i] = err;
2688 t, s_in_neighb, values_in_neighb);
2692 get_interpolated_values(
t,
s, values);
2700 for (
unsigned ival = 0; ival < num_val; ival++)
2702 double err = std::fabs(values[ival] - values_in_neighb[ival]);
2706 oomph_info << node_pt(n)->x(0) <<
" " << node_pt(n)->x(1)
2707 <<
" " << node_pt(n)->x(2) <<
" \n# "
2708 <<
"erru (S)" << err <<
" " << ival <<
" " << n
2709 <<
" " << values[ival] <<
" "
2710 << values_in_neighb[ival] << std::endl;
2717 if (err > max_error_val)
2719 max_error_val = err;
2729 max_error = max_error_x[0];
2730 if (max_error_x[1] > max_error) max_error = max_error_x[1];
2731 if (max_error_x[2] > max_error) max_error = max_error_x[2];
2732 if (max_error_val > max_error) max_error = max_error_val;
2734 if (max_error > 1
e-9)
2736 oomph_info <<
"\n#------------------------------------ \n#Max error ";
2737 oomph_info << max_error_x[0] <<
" " << max_error_x[1] <<
" "
2738 << max_error_x[2] <<
" " << max_error_val << std::endl;
2739 oomph_info <<
"#------------------------------------ \n " << std::endl;
2767 using namespace OcTreeNames;
2770 unsigned n_dim = this->nodal_dimension();
2772 Vector<int> bound_cons1(n_dim), bound_cons2(n_dim);
2785 for (
int i = 0;
i < 3;
i++)
2787 if (vect_elem[
i] != 0)
2790 notzero.push_back(
i);
2798 get_face_solid_bcs(bound, solid_bound_cons);
2804 for (
unsigned i = 0;
i < 3;
i++)
2810 vect1[notzero[0]] = vect_elem[notzero[0]];
2811 vect2[notzero[1]] = vect_elem[notzero[1]];
2816 for (
unsigned k = 0; k < n_dim; k++)
2818 solid_bound_cons[k] = (bound_cons1[k] || bound_cons2[k]);
2825 for (
unsigned i = 0;
i < 3;
i++)
2832 vect1[0] = vect_elem[0];
2833 vect2[1] = vect_elem[1];
2834 vect3[2] = vect_elem[2];
2842 for (
unsigned k = 0; k < n_dim; k++)
2844 solid_bound_cons[k] =
2845 (bound_cons1[k] || bound_cons2[k] || bound_cons3[k]);
2850 throw OomphLibError(
"Make sure you are not giving OMEGA as bound",
2851 OOMPH_CURRENT_FUNCTION,
2852 OOMPH_EXCEPTION_LOCATION);
2867 const int& face,
Vector<int>& solid_bound_cons)
const
2869 using namespace OcTreeNames;
2872 unsigned n_p = nnode_1d();
2874 unsigned node1, node2, node3, node4;
2880 node1 = n_p * n_p * n_p - 1;
2881 node2 = n_p * n_p - 1;
2882 node3 = n_p * (n_p - 1);
2883 node4 = n_p * (n_p * n_p - 1);
2889 node3 = (n_p * n_p + 1) * (n_p - 1);
2890 node4 = n_p * n_p * (n_p - 1);
2895 node2 = (n_p * n_p + 1) * (n_p - 1);
2896 node3 = n_p * n_p * n_p - 1;
2897 node4 = n_p * n_p - 1;
2902 node2 = n_p * (n_p - 1);
2903 node3 = n_p * (n_p * n_p - 1);
2904 node4 = n_p * n_p * (n_p - 1);
2910 node3 = n_p * n_p - 1;
2911 node4 = n_p * (n_p - 1);
2915 node1 = n_p * n_p * n_p - 1;
2916 node2 = n_p * (n_p * n_p - 1);
2917 node3 = n_p * n_p * (n_p - 1);
2918 node4 = (n_p - 1) * (n_p * n_p + 1);
2922 std::ostringstream error_stream;
2923 error_stream <<
"Wrong edge " << face <<
" passed\n";
2926 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2936 if (solid_node1_pt == 0)
2939 "Corner node 1 cannot be cast to SolidNode --> something is wrong",
2940 OOMPH_CURRENT_FUNCTION,
2941 OOMPH_EXCEPTION_LOCATION);
2944 if (solid_node2_pt == 0)
2947 "Corner node 2 cannot be cast to SolidNode --> something is wrong",
2948 OOMPH_CURRENT_FUNCTION,
2949 OOMPH_EXCEPTION_LOCATION);
2952 if (solid_node3_pt == 0)
2955 "Corner node 3 cannot be cast to SolidNode --> something is wrong",
2956 OOMPH_CURRENT_FUNCTION,
2957 OOMPH_EXCEPTION_LOCATION);
2960 if (solid_node4_pt == 0)
2963 "Corner node 4 cannot be cast to SolidNode --> something is wrong",
2964 OOMPH_CURRENT_FUNCTION,
2965 OOMPH_EXCEPTION_LOCATION);
2971 unsigned n_dim = this->nodal_dimension();
2976 for (
unsigned k = 0; k < n_dim; k++)
////////////////////////////////////////////////////////////////////
void setup_algebraic_node_update(Node *&node_pt, const Vector< double > &s_father, FiniteElement *father_el_pt) const
Set up node update info for (newly created) algebraic node: I.e. work out its node update information...
void pin(const unsigned &i)
Pin the i-th stored variable.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
void set_value(const unsigned &i, const double &value_)
Set the i-th stored data value to specified value. The only reason that we require an explicit set fu...
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
void enable_bypass_fill_in_jacobian_from_geometric_data()
Bypass the call to fill_in_jacobian_from_geometric_data.
int & method_for_shape_derivs()
Access to method (enumerated flag) for determination of shape derivs.
void enable_always_evaluate_dresidual_dnodal_coordinates_by_fd()
Insist that shape derivatives are always evaluated by fd (using FiniteElement::get_dresidual_dnodal_c...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual Node * get_node_at_local_coordinate(const Vector< double > &s) const
If there is a node at this local coordinate, return the pointer to the node.
virtual double s_min() const
Min value of local coordinate.
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
virtual double s_max() const
Max. value of local coordinate.
void get_x(const Vector< double > &s, Vector< double > &x) const
Global coordinates as function of local coordinates. Either via FE representation or via macro-elemen...
MacroElement * macro_elem_pt()
Access function to pointer to macro element.
Class that contains data for hanging nodes.
void set_master_node_pt(const unsigned &i, Node *const &master_node_pt, const double &weight)
Set the pointer to the i-th master node and its weight.
////////////////////////////////////////////////////////////////////
Vector< GeomObject * > & geom_object_pt()
Vector of (pointers to) geometric objects involved in node update function.
virtual void set_node_update_info(const Vector< GeomObject * > &geom_object_pt)=0
Set node update information: Pass the vector of (pointers to) the geometric objects that affect the n...
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
void add_node_pt(Node *const &node_pt)
Add a (pointer to a) node to the mesh.
bool boundary_coordinate_exists(const unsigned &i) const
Indicate whether the i-th boundary has an intrinsic coordinate.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
virtual void set_coordinates_on_boundary(const unsigned &b, const unsigned &k, const Vector< double > &boundary_zeta)
Set the vector of the k-th generalised boundary coordinates on mesh boundary b. Broken virtual interf...
void set_hanging_pt(HangInfo *const &hang_pt, const int &i)
Set the hanging data for the i-th value. (hang_pt=0 to make non-hanging)
virtual void make_periodic(Node *const &node_pt)
Make the node periodic by copying the values from node_pt. Note that the coordinates will always rema...
unsigned nposition_type() const
Number of coordinate types needed in the mapping between local and global coordinates.
bool is_hanging() const
Test whether the node is geometrically hanging.
OcTree class: Recursively defined, generalised octree.
static Vector< int > faces_of_common_edge(const int &edge)
Function that, given an edge, returns the two faces on which it.
static Vector< std::string > Direct_string
Translate (enumerated) directions into strings.
OcTree * gteq_face_neighbour(const int &direction, Vector< unsigned > &translate_s, Vector< double > &s_sw, Vector< double > &s_ne, int &face, int &diff_level, bool &in_neighbouring_tree) const
Find (pointer to) ‘greater-or-equal-sized face neighbour’ in given direction (L/R/U/D/F/B)....
OcTree * gteq_true_edge_neighbour(const int &direction, const unsigned &i_root_edge_neighbour, unsigned &nroot_edge_neighbour, Vector< unsigned > &translate_s, Vector< double > &s_lo, Vector< double > &s_hi, int &edge, int &diff_level) const
Find (pointer to) ‘greater-or-equal-sized true edge neighbour’ in the given direction (LB,...
static Vector< Vector< int > > Direction_to_vector
For each direction, i.e. a son_type (vertex), a face or an edge, this defines a vector that indicates...
static std::map< Vector< int >, int > Vector_to_direction
Each vector representing a direction can be translated into a direction, either a son type (vertex),...
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
double & s_macro_ll(const unsigned &i)
Access fct to the i-th coordinate of the element's "lower left" vertex in the associated MacroElement...
double & s_macro_ur(const unsigned &i)
Access fct to the i-th coordinate of the element's "upper right" vertex in the associated MacroElemen...
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
virtual bool nodes_built()
Return true if all the nodes have been built, false if not.
virtual unsigned ncont_interpolated_values() const =0
Number of continuously interpolated values. Note: We assume that they are located at the beginning of...
virtual unsigned ninterpolating_node(const int &value_id)
Return the number of nodes that are used to interpolate the value_id-th unknown. Default is to assume...
virtual void interpolating_basis(const Vector< double > &s, Shape &psi, const int &value_id) const
Return the basis functions that are used to interpolate the value_id-th unknown. By default assume is...
virtual Node * interpolating_node_pt(const unsigned &n, const int &value_id)
In mixed elements, different sets of nodes are used to interpolate different unknowns....
virtual Node * get_interpolating_node_at_local_coordinate(const Vector< double > &s, const int &value_id)
Return a pointer to the node that interpolates the value-id-th unknown at local coordinate s....
virtual void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Get all continously interpolated function values in this element as a Vector. Note: Vector sets is ow...
Refineable version of QElement<3,NNODE_1D>.
void interpolated_zeta_on_face(const unsigned &boundary, const int &face, const Vector< double > &s, Vector< double > &zeta)
Return the value of the intrinsic boundary coordinate interpolated along the face.
void get_bcs(int bound, Vector< int > &bound_cons) const
Determine Vector of boundary conditions along the element's boundary (or vertex) bound (S/W/N/E/SW/SE...
void get_boundaries(const int &edge, std::set< unsigned > &boundaries) const
Given an element edge/vertex, return a Vector which contains all the (mesh-)boundary numbers that thi...
A class that is used to template the refineable Q elements by dimension. It's really nothing more tha...
Refineable version of Solid brick elements.
void get_solid_bcs(int bound, Vector< int > &solid_bound_cons) const
Determine vector of solid (positional) boundary conditions along edge (or on vertex) bound (S/W/N/E/S...
A class that is used to template the solid refineable Q elements by dimension. It's really nothing mo...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
void pin_position(const unsigned &i)
Pin the nodal position.
bool position_is_pinned(const unsigned &i)
Test whether the i-th coordinate is pinned, 0: false; 1: true.
////////////////////////////////////////////////////////////////////// //////////////////////////////...
bool is_neighbour_periodic(const int &direction)
Return whether the neighbour in the particular direction is periodic.
RefineableElement * object_pt() const
Return the pointer to the object (RefineableElement) represented by the tree.
int son_type() const
Return son type.
static const int OMEGA
Default value for an unassigned neighbour.
TreeRoot *& root_pt()
Return pointer to root of the tree.
void start(const unsigned &i)
(Re-)start i-th timer
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
unsigned Number
The unsigned.
void shape(const double &s, double *Psi)
Definition for 1D Lagrange shape functions. The value of all the shape functions at the local coordin...
Vector< std::string > colour
Tecplot colours.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...