21 : computed_(false), abscissa_(nullptr), triangle_(nullptr)
23 plucker_coordinates_abscissa_ =
nullptr;
24 plucker_coordinates_triangle_.resize(3,
nullptr);
25 plucker_products_.resize(3,
nullptr);
30 : computed_(false), abscissa_(&abscissa), triangle_(&triangle)
33 plucker_coordinates_abscissa_ =
new Plucker((*abscissa_)[0].point_coordinates(),
34 (*abscissa_)[1].point_coordinates());
36 plucker_coordinates_triangle_.resize(3);
37 plucker_products_.resize(3);
38 for(
unsigned int side = 0; side < 3; side++){
39 plucker_coordinates_triangle_[side] =
new Plucker((*triangle_)[side][0].point_coordinates(),
40 (*triangle_)[side][1].point_coordinates());
42 plucker_products_[side] =
new double((*plucker_coordinates_abscissa_)*(*plucker_coordinates_triangle_[side]));
48 if(plucker_coordinates_abscissa_ !=
nullptr)
49 delete plucker_coordinates_abscissa_;
51 for(
unsigned int side = 0; side < RefElement<2>::n_sides; side++){
52 if(plucker_products_[side] !=
nullptr)
53 delete plucker_products_[side];
54 if(plucker_coordinates_triangle_[side] !=
nullptr)
55 delete plucker_coordinates_triangle_[side];
62 for(
unsigned int side = 0; side < RefElement<2>::n_sides; side++)
64 plucker_products_[side] =
nullptr;
65 plucker_coordinates_triangle_[side] =
nullptr;
67 plucker_coordinates_abscissa_ =
nullptr;
73 if(!plucker_coordinates_abscissa_->is_computed()){
74 plucker_coordinates_abscissa_->compute((*abscissa_)[0].point_coordinates(),
75 (*abscissa_)[1].point_coordinates());
77 scale_line_=plucker_coordinates_abscissa_->scale();
82 scale_triangle_=std::numeric_limits<double>::max();
84 for(
unsigned int side = 0; side < RefElement<2>::n_sides; side++){
85 if(!plucker_coordinates_triangle_[side]->is_computed()){
86 plucker_coordinates_triangle_[side]->compute((*triangle_)[side][0].point_coordinates(),
87 (*triangle_)[side][1].point_coordinates());
89 scale_triangle_ = std::min( scale_triangle_, plucker_coordinates_triangle_[side]->scale());
91 ASSERT_DBG(plucker_products_[side]).error(
"Undefined plucker product.");
93 *plucker_products_[side] = (*plucker_coordinates_abscissa_)*(*plucker_coordinates_triangle_[side]);
102 abscissa_ = &abscissa;
103 triangle_ = ▵
127 (local[0])(local[1])(local[2]);
131 arma::vec3 local_triangle({local[2],local[1],local[0]});
137 arma::vec3 u = (*abscissa_)[1].point_coordinates() - (*abscissa_)[0].point_coordinates();
142 if(fabs((
double)u[1]) > fabs(max)){ max = u[1]; i = 1;}
143 if(fabs((
double)u[2]) > fabs(max)){ max = u[2]; i = 2;}
146 double isect_coord_i =
147 local_triangle[0]*(*triangle_)[0][0].point_coordinates()[i] +
148 local_triangle[1]*(*triangle_)[0][1].point_coordinates()[i] +
149 local_triangle[2]*(*triangle_)[1][1].point_coordinates()[i];
154 double t = (-(*abscissa_)[0].point_coordinates()[i] + isect_coord_i)/max;
175 arma::vec2 local_abscissa = {1-t, t};
204 arma::vec3 A = (*abscissa_)[0].point_coordinates();
206 arma::vec3 U = plucker_coordinates_abscissa_->get_u_vector();
208 arma::vec3 C = (*triangle_)[side][side%2].point_coordinates();
210 arma::vec3 V = plucker_coordinates_triangle_[side]->get_u_vector();
228 unsigned int max_index = 0;
229 double maximum = fabs(Det[0]);
230 if(fabs((
double)Det[1]) > maximum){
231 maximum = fabs(Det[1]);
234 if(fabs((
double)Det[2]) > maximum){
235 maximum = fabs(Det[2]);
247 unsigned int i = (max_index+1)%3,
250 double DetX = -K[i]*V[j] + K[j]*V[i];
251 double DetY = -K[i]*U[j] + K[j]*U[i];
253 double s = DetX/Det[max_index];
254 double t = DetY/Det[max_index];
276 arma::vec2 local_abscissa({1-s, s});
296 compute_plucker_products();
305 signed_plucker_product(1),
306 signed_plucker_product(2)};
307 double w_sum = w[0] + w[1] + w[2];
309 unsigned int n_positive = 0;
310 unsigned int n_negative = 0;
311 unsigned int zero_idx_sum =0;
316 double scaled_epsilon =
rounding_epsilon*scale_line_*scale_triangle_*scale_triangle_;
317 if(std::fabs(w_sum) > scaled_epsilon) {
319 for (
unsigned int i=0; i < 3; i++) {
334 for (
unsigned int i=0; i < 3; i++) {
336 if (w[i] > scaled_epsilon || w[i] < -scaled_epsilon) n_negative++;
348 if (n_positive > 0) {
351 compute_plucker(IP, w);
353 unsigned int non_zero_idx=0;
354 if (n_positive == 2) {
358 non_zero_idx = (zero_idx_sum + 1) % 3;
360 else if (n_positive == 1) {
364 non_zero_idx = 3-zero_idx_sum;
409 for(
unsigned int i = 0; i < 3;i++){
412 if (compute_degenerate(i,IP))
416 if(t >= -tol && t <= 1+tol)
421 if(IP12s.back().local_bcoords_A()[1] == t)
425 if(IP12s.back().local_bcoords_A()[1] > t)
438 os <<
"\tPluckerCoordinates Abscissa[0]";
439 if(plucker_coordinates_abscissa_ ==
nullptr){
440 os <<
"NULL" << endl;
442 os << plucker_coordinates_abscissa_;
444 for(
unsigned int i = 0; i < 3;i++){
445 os <<
"\tPluckerCoordinates Triangle[" << i <<
"]";
446 if(plucker_coordinates_triangle_[i] ==
nullptr){
447 os <<
"NULL" << endl;
449 os << plucker_coordinates_triangle_[i];
472 for(
unsigned int side = 0; side < 2*RefElement<2>::n_sides; side++){
473 plucker_coordinates_[side] =
new Plucker();
477 for(
unsigned int p = 0; p < 3*RefElement<2>::n_sides; p++){
481 set_data(triaA, triaB);
487 for(
unsigned int side = 0; side < 2*RefElement<2>::n_sides; side++)
488 CI12[side].clear_all();
491 for(
unsigned int side = 0; side < 2*RefElement<2>::n_sides; side++){
492 if(plucker_coordinates_[side] !=
nullptr)
493 delete plucker_coordinates_[side];
496 for(
unsigned int p = 0; p < 3*RefElement<2>::n_sides; p++){
497 if(plucker_products_[p] !=
nullptr)
498 delete plucker_products_[p];
505 for(
unsigned int side = 0; side < 2*RefElement<2>::n_sides; side++)
507 plucker_coordinates_[side] =
nullptr;
509 for(
unsigned int p = 0; p < 3*RefElement<2>::n_sides; p++){
510 plucker_products_[p] =
nullptr;
517 for(
unsigned int i = 0; i < RefElement<2>::n_sides; i++){
519 for(
unsigned int j = 0; j < RefElement<2>::n_sides; j++)
520 CI12[i].set_pc_triangle(plucker_coordinates_[3+j], j);
522 CI12[i].set_pc_abscissa(plucker_coordinates_[i]);
525 for(
unsigned int j = 0; j < RefElement<2>::n_sides; j++)
531 for(
unsigned int j = 0; j < RefElement<2>::n_sides; j++)
534 CI12[i].set_plucker_product(get_plucker_product(i,j),j);
544 for(
unsigned int i = 0; i < RefElement< 2 >::n_sides;i++){
546 CI12[i].set_data(triaA.
abscissa(i), triaB);
559 unsigned int ip_coutner = 0;
562 for(
unsigned int i = 0; i < 2*RefElement<2>::n_sides && ip_coutner < 2; i++){
563 if(!CI12[i].is_computed())
566 if(CI12[i].compute_final(IP12s) == 0)
continue;
568 unsigned int triangle_side = i%3;
579 if( IP.dim_A() == 0 )
588 for(
unsigned int s=0; s < RefElement<2>::n_sides_per_node; s++)
591 if( IP.dim_B() == 0 )
595 for(
unsigned int s=0; s < RefElement<2>::n_sides_per_node; s++)
598 else if( IP.dim_B() == 1 )
602 CI12[3 + IP.idx_B()].set_computed();
605 else if( IP.dim_A() == 0 )
615 for(
unsigned int s=0; s < RefElement<2>::n_sides_per_node; s++)
620 IP22s.push_back(IP22);
658 for(
unsigned int i = 0; i < RefElement<2>::n_lines; i++){
659 os <<
"\tPluckerCoordinates Triangle A[" << i <<
"]";
660 if(plucker_coordinates_[i] ==
nullptr){
661 os <<
"NULL" << endl;
663 os << plucker_coordinates_[i];
666 for(
unsigned int i = 0; i < RefElement<2>::n_lines; i++){
667 os <<
"\tPluckerCoordinates Triangle B[" << i <<
"]";
669 os <<
"NULL" << endl;
671 os << plucker_coordinates_[RefElement<2>::n_lines + i];
677 os <<
"ComputeIntersection<Simplex<2>, <Simplex<2>> Plucker Coordinates Tree:" << endl;
678 print_plucker_coordinates(os);
679 for(
unsigned int i = 0; i < 6;i++){
680 os <<
"ComputeIntersection<Simplex<1>, Simplex<2>>["<< i <<
"] Plucker Coordinates:" << endl;
681 CI12[i].print_plucker_coordinates(os);
691 plucker_coordinates_abscissa_ =
nullptr;
692 plucker_coordinates_tetrahedron.resize(6,
nullptr);
693 plucker_products_.resize(6,
nullptr);
699 plucker_coordinates_abscissa_ =
new Plucker();
700 plucker_coordinates_tetrahedron.resize(6);
701 plucker_products_.resize(6);
703 for(
unsigned int line = 0; line < RefElement<3>::n_lines;
line++){
704 plucker_coordinates_tetrahedron[
line] =
new Plucker();
709 set_data(abscissa, tetrahedron);
715 for(
unsigned int side = 0; side < RefElement<3>::n_sides; side++)
716 CI12[side].clear_all();
719 if(plucker_coordinates_abscissa_ !=
nullptr)
720 delete plucker_coordinates_abscissa_;
722 for(
unsigned int line = 0; line < RefElement<3>::n_lines;
line++){
723 if(plucker_products_[
line] !=
nullptr)
724 delete plucker_products_[
line];
725 if(plucker_coordinates_tetrahedron[
line] !=
nullptr)
726 delete plucker_coordinates_tetrahedron[
line];
733 for(
unsigned int side = 0; side < RefElement<3>::n_lines; side++)
735 plucker_products_[side] =
nullptr;
736 plucker_coordinates_tetrahedron[side] =
nullptr;
738 plucker_coordinates_abscissa_ =
nullptr;
743 for(
unsigned int side = 0; side < RefElement<3>::n_sides; side++){
744 for(
unsigned int line = 0; line < RefElement<3>::n_lines_per_side;
line++){
745 CI12[side].set_pc_triangle(plucker_coordinates_tetrahedron[
748 CI12[side].set_plucker_product(
752 CI12[side].set_pc_abscissa(plucker_coordinates_abscissa_);
758 for(
unsigned int i = 0; i < 4;i++){
759 CI12[i].set_data(abscissa, tetrahedron[i]);
766 unsigned int count = compute(intersection.
i_points_);
785 for(
unsigned int face = 0; face < RefElement<3>::n_sides && IP13s.size() < 2; face++){
789 if (CI12[face].is_computed())
continue;
806 CI12[node_face].set_computed();
810 else if(IP.dim_B() == 1)
815 CI12[edge_face].set_computed();
819 IP13s.push_back(IP13);
822 if (IP13s.size() == 0)
return IP13s.size();
825 if(IP13s.size() == 1){
826 double f_theta = IP13s[0].local_bcoords_A()[1];
829 if(f_theta > 1 || f_theta < 0){
836 if(IP13s[0].local_bcoords_A()[1] > IP13s[1].local_bcoords_A()[1])
840 int ip_sign[] = {-2, +2};
841 for(
unsigned int ip=0; ip<2; ip++) {
842 t[ip] = IP13s[ip].local_bcoords_A()[1];
845 sign[ip] = (t[ip] < 0 ? -2 : (t[ip] > 1 ? +2 : 0) );
846 if (t[ip] == 0) sign[ip] = -1;
847 if (t[ip] == 1) sign[ip] = +1;
850 if (sign[ip] == ip_sign[ip]) {
853 correct_tetrahedron_ip_topology(t[ip], ip, IP13s);
855 if (sign[ip] == -1) IP13s[ip].set_topology_A(0, 0);
856 if (sign[ip] == +1) IP13s[ip].set_topology_A(1, 0);
878 ips[0].local_bcoords_B(), ips[1].local_bcoords_B(),
879 ips[0].local_bcoords_A()[1], ips[1].local_bcoords_A()[1], t);
880 arma::vec2 local_abscissa({1 - t, t});
881 ips[ip].set_coordinates(local_abscissa, local_tetra);
886 unsigned int zeros = 0;
887 unsigned int n_zeros = 0;
888 for(
char i=0; i < 4; i++){
891 zeros = zeros | (1 << i);
905 default: ips[ip].set_topology_B(0,3);
918 os <<
"\tPluckerCoordinates Abscissa[0]";
919 if(plucker_coordinates_abscissa_ ==
nullptr){
920 os <<
"NULL" << endl;
922 os << plucker_coordinates_abscissa_;
925 for(
unsigned int i = 0; i < 6;i++){
926 os <<
"\tPluckerCoordinates Tetrahedron[" << i <<
"]";
927 if(plucker_coordinates_tetrahedron[i] ==
nullptr){
928 os <<
"NULL" << endl;
930 os << plucker_coordinates_tetrahedron[i];
936 os <<
"ComputeIntersection<Simplex<1>, <Simplex<3>> Plucker Coordinates Tree:" << endl;
937 print_plucker_coordinates(os);
938 for(
unsigned int i = 0; i < 4;i++){
939 os <<
"ComputeIntersection<Simplex<1>, Simplex<2>>["<< i <<
"] Plucker Coordinates:" << endl;
940 CI12[i].print_plucker_coordinates(os);
951 s3_dim_starts({0, 4, 10, 14}),
952 s2_dim_starts({15, 18, 21}),
953 object_next(22, no_idx)
956 plucker_coordinates_triangle_.resize(3,
nullptr);
957 plucker_coordinates_tetrahedron.resize(6,
nullptr);
958 plucker_products_.resize(3*6,
nullptr);
966 plucker_coordinates_triangle_.resize(3);
967 plucker_coordinates_tetrahedron.resize(6);
970 for(
unsigned int i = 0; i < 6;i++){
971 plucker_coordinates_tetrahedron[i] =
new Plucker();
972 CI12[i].set_data(tetrahedron.
abscissa(i), triangle);
975 for(
unsigned int i = 0; i < 3;i++){
976 plucker_coordinates_triangle_[i] =
new Plucker();
977 CI13[i].set_data(triangle.
abscissa(i) , tetrahedron);
984 plucker_products_.resize(np,
nullptr);
994 for(
unsigned int triangle_side = 0; triangle_side < RefElement<2>::n_sides; triangle_side++)
995 CI13[triangle_side].clear_all();
997 for(
unsigned int line = 0; line < RefElement<3>::n_lines;
line++)
998 CI12[
line].clear_all();
1003 if(plucker_products_[
line] !=
nullptr)
1004 delete plucker_products_[
line];
1007 for(
unsigned int i = 0; i < RefElement<3>::n_lines;i++){
1008 if(plucker_coordinates_tetrahedron[i] !=
nullptr)
1009 delete plucker_coordinates_tetrahedron[i];
1011 for(
unsigned int i = 0; i < RefElement<2>::n_sides;i++){
1012 if(plucker_coordinates_triangle_[i] !=
nullptr)
1013 delete plucker_coordinates_triangle_[i];
1022 for(
unsigned int triangle_side = 0; triangle_side < RefElement<2>::n_sides; triangle_side++){
1023 for(
unsigned int line = 0; line < RefElement<3>::n_lines;
line++){
1024 CI13[triangle_side].set_plucker_product(
1027 CI12[
line].set_plucker_product(
1031 CI13[triangle_side].set_pc_tetrahedron(plucker_coordinates_tetrahedron[
line],line);
1032 CI12[
line].set_pc_triangle(plucker_coordinates_triangle_[triangle_side],triangle_side);
1034 CI13[triangle_side].set_pc_abscissa(plucker_coordinates_triangle_[triangle_side]);
1035 CI13[triangle_side].init();
1039 for(
unsigned int line = 0; line < RefElement<3>::n_lines;
line++)
1040 CI12[
line].set_pc_abscissa(plucker_coordinates_tetrahedron[
line]);
1048 unsigned int ip = object_next[i_obj];
1049 if (ip == no_idx)
return false;
1051 return IP_next[ip] == i_obj;
1059 if (have_backlink(obj_after_ip)) {
1065 (mesh_->element.get_id(intersection_->component_ele_idx()))
1066 (mesh_->element.get_id(intersection_->bulk_ele_idx()))
1067 (obj_before_ip)(ip_idx)(obj_after_ip);
1068 object_next[obj_before_ip] = ip_idx;
1069 IP_next.push_back( obj_after_ip);
1070 if (object_next[obj_after_ip] == no_idx) {
1071 object_next[obj_after_ip] = ip_idx;
1079 intersection_= &intersection;
1086 std::fill(object_next.begin(), object_next.end(), no_idx);
1089 std::array<bool, 6> edge_touch={
false,
false,
false,
false,
false,
false};
1090 unsigned int object_before_ip, object_after_ip;
1093 unsigned int current_triangle_vertex;
1104 for(
unsigned int _i_side = 0; _i_side < RefElement<2>::n_lines; _i_side++) {
1105 unsigned int i_side = cycle_sides[_i_side];
1107 CI13[ i_side ].compute(IP13s);
1109 if (IP13s.size() == 0)
continue;
1110 for(
unsigned int _ip=0; _ip < IP13s.size(); _ip++) {
1114 unsigned int ip = (side_cycle_orientation[_i_side] + _ip) % IP13s.size();
1126 unsigned int tetra_object = s3_dim_starts[IP23.
dim_B()] + IP23.
idx_B();
1127 unsigned int side_object = s2_dim_starts[1] + i_side;
1130 object_before_ip = tetra_object;
1131 object_after_ip = side_object;
1135 if( IP.
dim_A() == 0 )
1147 if (IP.
dim_B() == 3)
1148 object_before_ip = s2_dim_starts[0]+current_triangle_vertex;
1153 if (IP13s.size() == 1 ) {
1154 if (IP.
dim_B() == 0) {
1157 if (IP.
dim_A() == 0) {
1158 object_before_ip = tetra_object;
1159 object_after_ip = s2_dim_starts[0]+current_triangle_vertex;
1169 edge_touch[IP23.
idx_B()]=
true;
1170 std::swap(object_before_ip, object_after_ip);
1174 IP23_list.push_back(IP23);
1176 unsigned int ip_idx = IP23_list.size()-1;
1179 set_links(object_before_ip, ip_idx, object_after_ip);
1195 for(
unsigned int tetra_edge = 0; tetra_edge < 6; tetra_edge++) {
1201 IP12s_.push_back(IP12_local[0]);
1206 IP12s_.back().set_orientation(result);
1211 for(
unsigned int tetra_edge = 0; tetra_edge < 6;tetra_edge++) {
1212 if (! processed_edge[tetra_edge]) {
1213 IPAux12 &IP12 = IP12s_[tetra_edge];
1218 if ( edge_coord > 1 || edge_coord < 0 ||
int(IP12.
orientation()) >= 2 )
continue;
1222 uint i_edge = tetra_edge;
1225 if ( edge_dim == 1) {
1226 face_pair = edge_faces(i_edge);
1231 face_pair = vertex_faces(i_edge);
1234 processed_edge[ie] = 1;
1242 IP23_list.push_back(IP23);
1243 unsigned int ip_idx = IP23_list.size()-1;
1245 unsigned int s3_object = s3_dim_starts[edge_dim] + i_edge;
1248 if (IP12.
dim_B() < 2
1249 && (! edge_touch[i_edge])
1250 && object_next[s3_object] != no_idx) {
1252 if ( have_backlink(s3_object) ) {
1253 set_links(s3_object, ip_idx, face_pair[1]);
1255 set_links(face_pair[0], ip_idx, s3_object);
1260 set_links(face_pair[0], ip_idx, face_pair[1]);
1262 if ( have_backlink(s3_object) ) {
1263 object_next[s3_object]=ip_idx;
1273 if (IP23_list.size() == 0)
return;
1279 for(
auto obj : IP_next) {
1281 unsigned int ip = object_next[obj];
1282 if (ip < IP_next.size()) have_predecessor[ip]=1;
1284 unsigned int ip_init=0;
1285 for(
unsigned int i=0; i< IP23_list.size(); i++)
if (! have_predecessor[i]) ip_init=i;
1288 unsigned int ip=ip_init;
1290 intersection.
points().push_back(IP23_list[ip]);
1295 unsigned int object = IP_next[ip];
1298 ip = object_next[object];
1299 object_next[object]=no_idx;
1300 if ((ip == no_idx))
break;
1303 if ( ! ips_topology_equal(intersection.
points().back(), IP23_list[ip]) ) {
1305 intersection.
points().push_back(IP23_list[ip]);
1311 if (intersection.
points().size() == 1)
return;
1313 if (ips_topology_equal(intersection.
points().back(), IP23_list[ip_init]) )
1314 intersection.
points().pop_back();
1332 unsigned int ip_ori = (
unsigned int)(IP12s_[i_edge].orientation());
1338 return { s3_dim_starts[2] + line_faces[1-ip_ori], s3_dim_starts[2] + line_faces[ip_ori] };
1345 std::array<unsigned int, 3> n_ori, sum_idx;
1348 for(
unsigned int ie=0; ie <3; ie++) {
1349 unsigned int edge_ip_ori = (
unsigned int)(IP12s_[ vtx_edges[ie]].orientation());
1352 edge_ip_ori = (edge_ip_ori +1)%2;
1354 if (edge_ip_ori == 3) edge_ip_ori=2;
1355 n_ori[edge_ip_ori]++;
1356 sum_idx[edge_ip_ori]+=ie;
1363 if ( n_degen == 2 ) {
1367 unsigned int i_edge = 3 - sum_degen;
1368 FacePair pair = edge_faces(vtx_edges[i_edge]);
1371 if (pair[0] == s3_dim_starts[2] + vtx_faces[(i_edge+1)%3])
1372 return { s3_dim_starts[1] + (i_edge+2)%3, s3_dim_starts[1] + (i_edge+1)%3 };
1374 return { s3_dim_starts[1] + (i_edge+1)%3, s3_dim_starts[1] + (i_edge+2)%3 };
1376 }
else if (n_degen == 1) {
1378 unsigned int i_edge = sum_degen;
1379 ASSERT( n_positive + n_negative == 2);
1380 if ( n_positive == 1) {
1383 FacePair pair = edge_faces(vtx_edges[(i_edge+1)%3]);
1387 if (pair[0] == s3_dim_starts[2] + face)
1388 return { s3_dim_starts[2] + face, s3_dim_starts[1] + vtx_edges[i_edge]};
1390 return { s3_dim_starts[1] + vtx_edges[i_edge], s3_dim_starts[2] + face };
1395 ASSERT(n_positive == 0 || n_positive== 2);
1396 return { s3_dim_starts[0]+i_vertex, s3_dim_starts[1] + vtx_edges[i_edge]};
1402 ASSERT( n_positive + n_negative == 3);
1404 if (n_positive == 1) {
1406 return edge_faces(vtx_edges[i_edge]);
1407 }
else if (n_negative == 1) {
1409 return edge_faces(vtx_edges[i_edge]);
1412 ASSERT( n_positive == 0 || n_positive == 3);
1413 return { s3_dim_starts[0]+i_vertex, s3_dim_starts[0]+i_vertex};
1420 for(
unsigned int i = 0; i < 3;i++){
1421 os <<
"\tPluckerCoordinates Triangle[" << i <<
"]";
1422 if(plucker_coordinates_triangle_[i] ==
nullptr){
1423 os <<
"NULL" << endl;
1425 os << plucker_coordinates_triangle_[i];
1428 for(
unsigned int i = 0; i < 6;i++){
1429 os <<
"\tPluckerCoordinates Tetrahedron[" << i <<
"]";
1430 if(plucker_coordinates_tetrahedron[i] ==
nullptr){
1431 os <<
"NULL" << endl;
1433 os << plucker_coordinates_tetrahedron[i];
1439 os <<
"ComputeIntersection<Simplex<2>, <Simplex<3>> Plucker Coordinates Tree:" << endl;
1440 print_plucker_coordinates(os);
1441 for(
unsigned int i = 0; i < 6;i++){
1442 os <<
"ComputeIntersection<Simplex<1>, Simplex<2>>["<< i <<
"] Plucker Coordinates:" << endl;
1443 CI12[i].print_plucker_coordinates(os);
1445 for(
unsigned int i = 0; i < 3;i++){
1446 CI13[i].print_plucker_coordinates_tree(os);
unsigned int dim_A() const
Returns dimension of object A.
#define ASSERT_EQ_DBG(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
void set_topology_B(unsigned int idx, unsigned int dim_B)
Sets the topology of object B in Simplex<M>.
std::vector< IntersectionPointAux< dimA, dimB > > i_points_
Vector of internal intersection points.
Plucker coordinates class.
static BaryPoint line_barycentric_interpolation(BaryPoint first_coords, BaryPoint second_coords, double first_theta, double second_theta, double theta)
void clear()
Resets the object to default values.
Fundamental simplicial intersections.
void set_topology_A(unsigned int idx, unsigned int dim_A)
Sets the topology of object A in Simplex<N>.
static const double rounding_epsilon
unsigned int size() const
Returns number of intersection points.
void set_orientation(IntersectionResult orientation)
Setter orientation flag.
static const double geometry_epsilon
Simplex< 1 > & abscissa(unsigned int idx)
Get simplex of abscissa from different simplices - if it has own implementation in ...
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
const arma::vec::fixed< N+1 > & local_bcoords_A() const
Returns barycentric coordinates in the Simplex<N>.
static unsigned int normal_orientation(unsigned int sid)
unsigned int idx_A() const
Returns the index of Simplex<N>.
unsigned int dim_B() const
Returns dimension of object B.
void set_coordinates(const arma::vec::fixed< N+1 > &lcA, const arma::vec::fixed< M+1 > &lcB)
Setter for coordinates.
static const IdxVector< (InDim >OutDim?InDim+1:dim-InDim) > interact(TInteraction< OutDim, InDim > interaction)
std::vector< IntersectionPointAux< dimA, dimB > > & points()
Returns intersection points by a reference.
void swap(nlohmann::json &j1, nlohmann::json &j2) noexcept(is_nothrow_move_constructible< nlohmann::json >::value andis_nothrow_move_assignable< nlohmann::json >::value)
exchanges the values of two JSON objects
std::array< unsigned int, Size > IdxVector
IntersectionPointAux< M, N > switch_objects() const
Switches the object A and B.
static const double plucker_empty
Auxiliary value for Plucker product. If equal this value, it is supposed not to be set yet...
Internal auxiliary class represents an intersection point of simplex<N> and simplex<M>.
Class RefElement defines numbering of vertices, sides, calculation of normal vectors etc...
IntersectionResult orientation() const
Returns the orientation.
std::array< uint, 2 > FacePair
unsigned int idx_B() const
Returns the index of Simplex<M>.
Internal class representing intersection point.
Plucker coordinates representing line given by points A,B.
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual)
Internal class representing intersection object.
#define ASSERT_LT_DBG(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.