16 #if !defined(KRATOS_ENRICHMENT_UTILITIES_INCLUDED )
17 #define KRATOS_ENRICHMENT_UTILITIES_INCLUDED
68 template<
class TMatrixType,
class TVectorType,
class TGradientType>
70 TGradientType
const& DN_DX,
71 TVectorType rDistances, TVectorType& rVolumes,
72 TMatrixType& rShapeFunctionValues,
73 TVectorType& rPartitionsSign,
74 std::vector<TMatrixType>& rGradientsValue,
75 TMatrixType& NEnriched,
82 const int n_edges = 6;
84 const int edge_i[] = {0, 0, 0, 1, 1, 2};
85 const int edge_j[] = {1, 2, 3, 2, 3, 3};
96 const double epsilon = 1
e-15;
97 const double near_factor = 1.00e-12;
111 for (
unsigned int i = 0;
i < 4;
i++)
112 for (
unsigned int j = 0;
j < 3;
j++)
113 aux_coordinates(
i,
j) = rPoints(
i,
j);
114 for (
unsigned int i = 4;
i < 8;
i++)
115 for (
unsigned int j = 0;
j < 3;
j++)
116 aux_coordinates(
i,
j) = -10000.0;
118 int split_edge[] = {0, 1, 2, 3, -1, -1, -1, -1, -1, -1, -1, -1};
123 int n_negative_distance_nodes = 0;
124 int n_positive_distance_nodes = 0;
130 for (
int i = 0;
i < 6;
i++)
132 rShapeFunctionValues(
i,
j) = 0.25;
139 double norm =
norm_2(grad_d);
148 double max_lenght = 0.0;
149 for (
int edge = 0; edge < n_edges; edge++)
151 const int i = edge_i[edge];
152 const int j = edge_j[edge];
154 double dx = rPoints(
j, 0) - rPoints(
i, 0);
155 double dy = rPoints(
j, 1) - rPoints(
i, 1);
156 double dz = rPoints(
j, 2) - rPoints(
i, 2);
158 double l = sqrt(dx * dx + dy * dy + dz * dz);
163 edges_length[edge] =
l;
169 double relatively_close = near_factor*max_lenght;
172 for (
unsigned int i=0;
i<4;
i++)
174 if(fabs(rDistances[
i]) < relatively_close)
176 collapsed_node[
i] =
true;
181 collapsed_node[
i] =
false;
183 abs_distance[
i] = fabs(rDistances[
i]);
187 for (
int edge = 0; edge < n_edges; edge++)
189 const int i = edge_i[edge];
190 const int j = edge_j[edge];
191 if (rDistances[
i] * rDistances[
j] < 0.0)
193 const double tmp = fabs(rDistances[
i]) / (fabs(rDistances[
i]) + fabs(rDistances[
j]));
198 if (collapsed_node[
i] ==
false && collapsed_node[
j] ==
false)
200 split_edge[edge + 4] = new_node_id;
201 edge_division_i[edge] =
tmp;
202 edge_division_j[edge] = 1.00 -
tmp;
205 for (
unsigned int k = 0;
k < 3;
k++)
206 aux_coordinates(new_node_id,
k) = rPoints(
i,
k) * edge_division_j[edge] + rPoints(
j,
k) * edge_division_i[edge];
222 base_point[0] = aux_coordinates(4,0);
223 base_point[1] = aux_coordinates(4,1);
224 base_point[2] = aux_coordinates(4,2);
227 for (
int i_node = 0; i_node <
n_nodes; i_node++)
229 double d = (rPoints(i_node,0) - base_point[0]) * grad_d[0] +
230 (rPoints(i_node,1) - base_point[1]) * grad_d[1] +
231 (rPoints(i_node,2) - base_point[2]) * grad_d[2] ;
232 abs_distance[i_node] = fabs(
d);
238 for (
int i_node = 0; i_node <
n_nodes; i_node++)
248 if (rDistances[i_node] < 0.00)
251 negative_distance_nodes[n_negative_distance_nodes++] = i_node;
256 positive_distance_nodes[n_positive_distance_nodes++] = i_node;
263 if (rDistances[
i] < 0.0)
264 exact_distance[
i] = -abs_distance[
i];
266 exact_distance[
i] = abs_distance[
i];
274 int number_of_splitted_edges = new_node_id - 4;
276 double volume = edges_dx[0] * edges_dy[1] * edges_dz[2] -
277 edges_dx[0] * edges_dz[1] * edges_dy[2] +
278 edges_dy[0] * edges_dz[1] * edges_dx[2] -
279 edges_dy[0] * edges_dx[1] * edges_dz[2] +
280 edges_dz[0] * edges_dx[1] * edges_dy[2] -
281 edges_dz[0] * edges_dy[1] * edges_dx[2];
283 const double one_sixth = 1.00 / 6.00;
288 if (number_of_splitted_edges == 0)
300 double min_distance = 1e9;
301 for (
int j = 0;
j < 4;
j++)
302 if(exact_distance[
j] < min_distance) min_distance = exact_distance[
j];
304 if(min_distance < 0.0)
305 rPartitionsSign[0] = -1.0;
307 rPartitionsSign[0] = 1.0;
311 for (
int j = 0;
j < 4;
j++)
312 rShapeFunctionValues(0,
j) = 0.25;
315 NEnriched(
j, 0) = 0.0;
327 int n_splitted_edges;
335 KRATOS_THROW_ERROR(std::logic_error,
"requiring an internal node for splitting ... can not accept this",
"");
341 for (
int i = 0;
i < nel;
i++)
347 double sub_volume = ComputeSubTetraVolumeAndCenter(aux_coordinates, center_position, i0, i1, i2, i3);
351 local_subtet_indices[0] =
t[
i*4];
352 local_subtet_indices[1] =
t[
i*4+1];
353 local_subtet_indices[2] =
t[
i*4+2];
354 local_subtet_indices[3] =
t[
i*4+3];
355 AddToEdgeAreas<3>(edge_areas,exact_distance,local_subtet_indices,sub_volume);
358 rVolumes[
i] = sub_volume;
363 ComputeElementCoordinates(
N, center_position, rPoints,
volume);
364 for (
int j = 0;
j < 4;
j++)
365 rShapeFunctionValues(
i,
j) =
N[
j];
388 double max_aux_dist_on_cut = -1;
389 for (
int edge = 0; edge < n_edges; edge++)
391 const int i = edge_i[edge];
392 const int j = edge_j[edge];
393 if (rDistances[
i] * rDistances[
j] < 0.0)
395 const double tmp = fabs(rDistances[
i]) / (fabs(rDistances[
i]) + fabs(rDistances[
j]));
398 double abs_dist_on_cut = abs_distance[
i] *
tmp + abs_distance[
j] * (1.00 -
tmp);
400 if(abs_dist_on_cut > max_aux_dist_on_cut) max_aux_dist_on_cut = abs_dist_on_cut;
407 if(max_aux_dist_on_cut < 1
e-9*max_lenght)
408 max_aux_dist_on_cut = 1
e-9*max_lenght;
414 double abs_dist = 0.0;
415 for (
int j = 0;
j < 4;
j++)
417 dist += rShapeFunctionValues(
i,
j) * exact_distance[
j];
418 abs_dist += rShapeFunctionValues(
i,
j) * abs_distance[
j];
422 rPartitionsSign[
i] = -1.0;
424 rPartitionsSign[
i] = 1.0;
426 NEnriched(
i, 0) = 0.5 * (abs_dist - rPartitionsSign[
i] *
dist);
436 for (
int j = 0;
j < 3;
j++)
438 rGradientsValue[
i](0,
j) = (0.5) * (abs_distance_gradient[
j] - rPartitionsSign[
i] * exact_distance_gradient[
j]);
446 NEnriched(0,0) = 0.0;
448 for (
int j = 0;
j < 3;
j++)
449 rGradientsValue[0](0,
j) = 0.0;
506 std::vector<Matrix>& rGradientsValue,
512 if (rGradientsValue.size()!=6)
513 rGradientsValue.resize(6);
515 for (
unsigned int i = 0;
i < 6;
i++)
517 if (rGradientsValue[
i].size1() != 2 || rGradientsValue[
i].size2() != 3)
519 std::cout <<
"resizing rGradientsValue[i] to 2x3, please modify your element" << std::endl;
520 rGradientsValue[
i].resize(2, 3,
false);
525 const int n_edges = 6;
527 const int edge_i[] = {0, 0, 0, 1, 1, 2};
528 const int edge_j[] = {1, 2, 3, 2, 3, 3};
539 const double epsilon = 1
e-15;
540 const double near_factor = 1.00e-12;
554 for (
unsigned int i = 0;
i < 4;
i++)
555 for (
unsigned int j = 0;
j < 3;
j++)
556 aux_coordinates(
i,
j) = rPoints(
i,
j);
557 for (
unsigned int i = 4;
i < 8;
i++)
558 for (
unsigned int j = 0;
j < 3;
j++)
559 aux_coordinates(
i,
j) = -10000.0;
561 int split_edge[] = {0, 1, 2, 3, -1, -1, -1, -1, -1, -1, -1, -1};
566 int n_negative_distance_nodes = 0;
567 int n_positive_distance_nodes = 0;
573 for (
int i = 0;
i < 6;
i++)
575 rShapeFunctionValues(
i,
j) = 0.25;
582 double norm =
norm_2(grad_d);
591 double max_lenght = 0.0;
592 for (
int edge = 0; edge < n_edges; edge++)
594 const int i = edge_i[edge];
595 const int j = edge_j[edge];
597 double dx = rPoints(
j, 0) - rPoints(
i, 0);
598 double dy = rPoints(
j, 1) - rPoints(
i, 1);
599 double dz = rPoints(
j, 2) - rPoints(
i, 2);
601 double l = sqrt(dx * dx + dy * dy + dz * dz);
606 edges_length[edge] =
l;
612 double relatively_close = near_factor*max_lenght;
615 for (
unsigned int i=0;
i<4;
i++)
617 if(fabs(rDistances[
i]) < relatively_close)
619 collapsed_node[
i] =
true;
624 collapsed_node[
i] =
false;
626 abs_distance[
i] = fabs(rDistances[
i]);
630 for (
int edge = 0; edge < n_edges; edge++)
632 const int i = edge_i[edge];
633 const int j = edge_j[edge];
634 if (rDistances[
i] * rDistances[
j] < 0.0)
636 const double tmp = fabs(rDistances[
i]) / (fabs(rDistances[
i]) + fabs(rDistances[
j]));
641 if (collapsed_node[
i] ==
false && collapsed_node[
j] ==
false)
643 split_edge[edge + 4] = new_node_id;
644 edge_division_i[edge] =
tmp;
645 edge_division_j[edge] = 1.00 -
tmp;
648 for (
unsigned int k = 0;
k < 3;
k++)
649 aux_coordinates(new_node_id,
k) = rPoints(
i,
k) * edge_division_j[edge] + rPoints(
j,
k) * edge_division_i[edge];
665 base_point[0] = aux_coordinates(4,0);
666 base_point[1] = aux_coordinates(4,1);
667 base_point[2] = aux_coordinates(4,2);
670 for (
int i_node = 0; i_node <
n_nodes; i_node++)
672 double d = (rPoints(i_node,0) - base_point[0]) * grad_d[0] +
673 (rPoints(i_node,1) - base_point[1]) * grad_d[1] +
674 (rPoints(i_node,2) - base_point[2]) * grad_d[2] ;
675 abs_distance[i_node] = fabs(
d);
681 for (
int i_node = 0; i_node <
n_nodes; i_node++)
691 if (rDistances[i_node] < 0.00)
694 negative_distance_nodes[n_negative_distance_nodes++] = i_node;
699 positive_distance_nodes[n_positive_distance_nodes++] = i_node;
706 if (rDistances[
i] < 0.0)
707 exact_distance[
i] = -abs_distance[
i];
709 exact_distance[
i] = abs_distance[
i];
719 int number_of_splitted_edges = new_node_id - 4;
721 double volume = edges_dx[0] * edges_dy[1] * edges_dz[2] -
722 edges_dx[0] * edges_dz[1] * edges_dy[2] +
723 edges_dy[0] * edges_dz[1] * edges_dx[2] -
724 edges_dy[0] * edges_dx[1] * edges_dz[2] +
725 edges_dz[0] * edges_dx[1] * edges_dy[2] -
726 edges_dz[0] * edges_dy[1] * edges_dx[2];
728 const double one_sixth = 1.00 / 6.00;
733 if (number_of_splitted_edges == 0)
745 double min_distance = 1e9;
746 for (
int j = 0;
j < 4;
j++)
747 if(exact_distance[
j] < min_distance) min_distance = exact_distance[
j];
749 if(min_distance < 0.0)
750 rPartitionsSign[0] = -1.0;
752 rPartitionsSign[0] = 1.0;
756 for (
int j = 0;
j < 4;
j++)
757 rShapeFunctionValues(0,
j) = 0.25;
760 NEnriched(
j, 0) = 0.0;
770 int n_splitted_edges;
778 KRATOS_THROW_ERROR(std::logic_error,
"requiring an internal node for splitting ... can not accept this",
"");
783 for (
int i = 0;
i < nel;
i++)
789 double sub_volume = ComputeSubTetraVolumeAndCenter(aux_coordinates, center_position, i0, i1, i2, i3);
791 rVolumes[
i] = sub_volume;
796 ComputeElementCoordinates(
N, center_position, rPoints,
volume);
797 for (
int j = 0;
j < 4;
j++)
798 rShapeFunctionValues(
i,
j) =
N[
j];
821 double max_aux_dist_on_cut = -1;
822 for (
int edge = 0; edge < n_edges; edge++)
824 const int i = edge_i[edge];
825 const int j = edge_j[edge];
826 if (rDistances[
i] * rDistances[
j] < 0.0)
828 const double tmp = fabs(rDistances[
i]) / (fabs(rDistances[
i]) + fabs(rDistances[
j]));
831 double abs_dist_on_cut = abs_distance[
i] *
tmp + abs_distance[
j] * (1.00 -
tmp);
833 if(abs_dist_on_cut > max_aux_dist_on_cut) max_aux_dist_on_cut = abs_dist_on_cut;
840 if(max_aux_dist_on_cut < 1
e-9*max_lenght)
841 max_aux_dist_on_cut = 1
e-9*max_lenght;
847 double abs_dist = 0.0;
848 for (
int j = 0;
j < 4;
j++)
850 dist += rShapeFunctionValues(
i,
j) * exact_distance[
j];
851 abs_dist += rShapeFunctionValues(
i,
j) * abs_distance[
j];
855 rPartitionsSign[
i] = -1.0;
857 rPartitionsSign[
i] = 1.0;
859 NEnriched(
i, 0) = 0.5 * (abs_dist - rPartitionsSign[
i] *
dist);
862 NEnriched(
i, 0) /= max_aux_dist_on_cut;
863 NEnriched(
i, 1) = (rPartitionsSign[
i])*NEnriched(
i, 0);
870 for (
int j = 0;
j < 3;
j++)
872 rGradientsValue[
i](0,
j) = (0.5/max_aux_dist_on_cut) * (abs_distance_gradient[
j] - rPartitionsSign[
i] * exact_distance_gradient[
j]);
873 rGradientsValue[
i](1,
j) = (rPartitionsSign[
i])* rGradientsValue[
i](0,
j);
881 NEnriched(0,0) = 0.0;
883 for (
int j = 0;
j < 3;
j++)
884 rGradientsValue[0](0,
j) = 0.0;
918 std::vector<Matrix>& rGradientsValue,
923 const double one_third=1.0/3.0;
928 double most_common_sign=0;
930 rGPShapeFunctionValues(0,0)=one_third;
931 rGPShapeFunctionValues(0,1)=one_third;
932 rGPShapeFunctionValues(0,2)=one_third;
933 Area = CalculateVolume2D( rPoints );
939 if( (rDistances(0)*rDistances(1))>0.0 && (rDistances(0)*rDistances(2))>0.0 )
942 rGPShapeFunctionValues(0,0)=one_third;
943 rGPShapeFunctionValues(0,1)=one_third;
944 rGPShapeFunctionValues(0,2)=one_third;
945 NEnriched(0,0) = 0.0;
947 for (
int j = 0;
j < 3;
j++)
948 rGradientsValue[0](0,
j) = 0.0;
949 if (rDistances(0) < 0.0) rPartitionsSign[0] = -1.0;
950 else rPartitionsSign[0] = 1.0;
972 if ((rDistances(0)*rDistances(1))<0.0)
976 if ((rDistances(1)*rDistances(2))<0.0)
980 if ((rDistances(2)*rDistances(0))<0.0)
987 const double unsigned_distance0=fabs(rDistances(0));
988 const double unsigned_distance1=fabs(rDistances(1));
989 const double unsigned_distance2=fabs(rDistances(2));
991 double longest_distance=fabs(unsigned_distance0);
992 if (unsigned_distance1>longest_distance)
993 longest_distance=unsigned_distance1;
994 if (unsigned_distance2>longest_distance)
995 longest_distance=unsigned_distance2;
997 const double tolerable_distance =longest_distance*0.001;
999 if (unsigned_distance0<tolerable_distance)
1000 rDistances[0]=tolerable_distance*(rDistances[0]/fabs(rDistances[0]));
1001 if (unsigned_distance1<tolerable_distance)
1002 rDistances[1]=tolerable_distance*(rDistances[1]/fabs(rDistances[1]));
1003 if (unsigned_distance2<tolerable_distance)
1004 rDistances[2]=tolerable_distance*(rDistances[2]/fabs(rDistances[2]));
1010 for (
unsigned int i=0;
i<3;
i++)
1012 int edge_begin_node=
i;
1013 int edge_end_node=
i+1;
1014 if (edge_end_node==3) edge_end_node=0;
1016 if(cut_edges(
i)==
true)
1018 aux_nodes_relative_locations(
i)=fabs(rDistances(edge_end_node)/(rDistances(edge_end_node)-rDistances(edge_begin_node) ) ) ;
1019 aux_nodes_father_nodes(
i,0)=edge_begin_node;
1020 aux_nodes_father_nodes(
i,1)=edge_end_node;
1024 if(fabs(rDistances(edge_end_node))>fabs(rDistances(edge_begin_node)))
1026 aux_nodes_relative_locations(
i)=0.0;
1027 aux_nodes_father_nodes(
i,0)=edge_end_node;
1028 aux_nodes_father_nodes(
i,1)=edge_end_node;
1032 aux_nodes_relative_locations(
i)=1.0;
1033 aux_nodes_father_nodes(
i,0)=edge_begin_node;
1034 aux_nodes_father_nodes(
i,1)=edge_begin_node;
1039 for (
unsigned int j=0;
j<2;
j++)
1040 aux_points(
i,
j)= rPoints(edge_begin_node,
j) * aux_nodes_relative_locations(
i) + rPoints(edge_end_node,
j) * (1.0- aux_nodes_relative_locations(
i));
1045 if (cut_edges(0)==
true)
1047 base_point[0] = aux_points(0,0);
1048 base_point[1] = aux_points(0,1);
1052 base_point[0] = aux_points(1,0);
1053 base_point[1] = aux_points(1,1);
1056 for (
int i_node = 0; i_node < 3; i_node++)
1058 double d = (rPoints(i_node,0) - base_point[0]) * grad_d[0] +
1059 (rPoints(i_node,1) - base_point[1]) * grad_d[1] ;
1060 abs_distance[i_node] = fabs(
d);
1064 for (
int i = 0;
i < 3;
i++)
1066 if (rDistances[
i] < 0.0)
1068 exact_distance[
i] = -abs_distance[
i];
1073 exact_distance[
i] = abs_distance[
i];
1090 double max_aux_dist_on_cut = -1;
1091 for (
int edge = 0; edge < 3; edge++)
1096 if (rDistances[
i] * rDistances[
j] < 0.0)
1098 const double tmp = fabs(rDistances[
i]) / (fabs(rDistances[
i]) + fabs(rDistances[
j]));
1100 double abs_dist_on_cut = abs_distance[
i] *
tmp + abs_distance[
j] * (1.00 -
tmp);
1101 if(abs_dist_on_cut > max_aux_dist_on_cut) max_aux_dist_on_cut = abs_dist_on_cut;
1116 unsigned int partition_number=0;
1119 bool found_empty_partition=
false;
1120 for (
unsigned int i=0;
i<4;
i++)
1122 unsigned int j_aux =
i + 2;
1123 if (j_aux>2) j_aux -= 3;
1128 partition_father_nodes(0,0)=
i;
1129 partition_father_nodes(0,1)=
i;
1130 partition_father_nodes(1,0)=aux_nodes_father_nodes(
i,0);
1131 partition_father_nodes(1,1)=aux_nodes_father_nodes(
i,1);
1132 partition_father_nodes(2,0)=aux_nodes_father_nodes(j_aux,0);
1133 partition_father_nodes(2,1)=aux_nodes_father_nodes(j_aux,1);
1135 coord_subdomain(0,0)=rPoints(
i,0);
1136 coord_subdomain(0,1)=rPoints(
i,1);
1137 coord_subdomain(1,0)=aux_points(
i,0);
1138 coord_subdomain(1,1)=aux_points(
i,1);
1139 coord_subdomain(2,0)=aux_points(j_aux,0);
1140 coord_subdomain(2,1)=aux_points(j_aux,1);
1145 partition_father_nodes=aux_nodes_father_nodes;
1146 coord_subdomain=aux_points;
1151 CalculateGeometryData(coord_subdomain, DN_DX_subdomain, temp_area);
1152 if (temp_area > 1.0e-20)
1154 rVolumes(partition_number)=temp_area;
1156 double x_GP_partition = one_third * ( coord_subdomain(0,0) + coord_subdomain(1,0) + coord_subdomain(2,0) );
1157 double y_GP_partition = one_third * ( coord_subdomain(0,1) + coord_subdomain(1,1) + coord_subdomain(2,1) );
1158 double z_GP_partition = 0.0;
1160 coord_subdomain = rPoints;
1162 CalculatePosition ( coord_subdomain , x_GP_partition ,y_GP_partition ,z_GP_partition ,
N);
1164 const double partition_sign = (
N(0)*rDistances(0) +
N(1)*rDistances(1) +
N(2)*rDistances(2))/fabs(
N(0)*rDistances(0) +
N(1)*rDistances(1) +
N(2)*rDistances(2));
1167 rGPShapeFunctionValues(partition_number,0)=
N(0);
1168 rGPShapeFunctionValues(partition_number,1)=
N(1);
1169 rGPShapeFunctionValues(partition_number,2)=
N(2);
1173 double abs_dist = 0.0;
1174 for (
int j = 0;
j < 3;
j++)
1176 dist += rGPShapeFunctionValues(partition_number,
j) * exact_distance[
j];
1177 abs_dist += rGPShapeFunctionValues(partition_number,
j) * abs_distance[
j];
1180 if (partition_sign < 0.0)
1181 rPartitionsSign[partition_number] = -1.0;
1183 rPartitionsSign[partition_number] = 1.0;
1186 NEnriched(partition_number, 0) = 0.5/max_aux_dist_on_cut * (abs_dist - rPartitionsSign[partition_number] *
dist);
1187 for (
int j = 0;
j < 2;
j++)
1189 rGradientsValue[partition_number](0,
j) = (0.5/max_aux_dist_on_cut) * (abs_distance_gradient[
j] - rPartitionsSign[partition_number] * exact_distance_gradient[
j]);
1193 if (rPartitionsSign[partition_number]*most_common_sign > 0.0)
1195 NEnriched(partition_number, 1) = -1.0*rPartitionsSign[partition_number]*NEnriched(partition_number, 0) ;
1196 for (
int j = 0;
j < 2;
j++)
1198 rGradientsValue[partition_number](1,
j) = -1.0*rPartitionsSign[partition_number]*rGradientsValue[partition_number](0,
j);
1205 NEnriched(partition_number, 1) = rPartitionsSign[partition_number]*( 1.0*NEnriched(partition_number, 0) - 0.6666666666666666666666666666 ) ;
1206 for (
int j = 0;
j < 2;
j++)
1208 rGradientsValue[partition_number](1,
j) = (rPartitionsSign[partition_number]*1.0*rGradientsValue[partition_number](0,
j) - exact_distance_gradient[
j]*1.0/(abs_distance[
i]));
1217 found_empty_partition=
true;
1220 if (found_empty_partition==
false)
1232 array_1d<
double,(3*(2-1))>& rPartitionsSign, std::vector<Matrix>& rGradientsValue,
BoundedMatrix<
double,3*(2-1), (4)>& NEnriched)
1236 const double one_third=1.0/3.0;
1241 double most_common_sign=0;
1243 rGPShapeFunctionValues(0,0)=one_third;
1244 rGPShapeFunctionValues(0,1)=one_third;
1245 rGPShapeFunctionValues(0,2)=one_third;
1246 Area = CalculateVolume2D( rPoints );
1252 if( (rDistances(0)*rDistances(1))>0.0 && (rDistances(0)*rDistances(2))>0.0 )
1255 rGPShapeFunctionValues(0,0)=one_third;
1256 rGPShapeFunctionValues(0,1)=one_third;
1257 rGPShapeFunctionValues(0,2)=one_third;
1258 NEnriched(0,0) = 0.0;
1260 for (
int j = 0;
j < 2;
j++)
1261 rGradientsValue[0](0,
j) = 0.0;
1262 if (rDistances(0) < 0.0) rPartitionsSign[0] = -1.0;
1263 else rPartitionsSign[0] = 1.0;
1285 if ((rDistances(0)*rDistances(1))<0.0)
1289 if ((rDistances(1)*rDistances(2))<0.0)
1293 if ((rDistances(2)*rDistances(0))<0.0)
1300 const double unsigned_distance0=fabs(rDistances(0));
1301 const double unsigned_distance1=fabs(rDistances(1));
1302 const double unsigned_distance2=fabs(rDistances(2));
1304 double longest_distance=fabs(unsigned_distance0);
1305 if (unsigned_distance1>longest_distance)
1306 longest_distance=unsigned_distance1;
1307 if (unsigned_distance2>longest_distance)
1308 longest_distance=unsigned_distance2;
1310 const double tolerable_distance =longest_distance*0.001;
1312 if (unsigned_distance0<tolerable_distance)
1313 rDistances[0]=tolerable_distance*(rDistances[0]/fabs(rDistances[0]));
1314 if (unsigned_distance1<tolerable_distance)
1315 rDistances[1]=tolerable_distance*(rDistances[1]/fabs(rDistances[1]));
1316 if (unsigned_distance2<tolerable_distance)
1317 rDistances[2]=tolerable_distance*(rDistances[2]/fabs(rDistances[2]));
1329 int shape_function_id=0;
1331 for (
unsigned int i=0;
i<3;
i++)
1333 int edge_begin_node=
i;
1334 int edge_end_node=
i+1;
1335 if (edge_end_node==3) edge_end_node=0;
1337 if(cut_edges(
i)==
true)
1339 aux_nodes_relative_locations(
i)=fabs(rDistances(edge_end_node)/(rDistances(edge_end_node)-rDistances(edge_begin_node) ) ) ;
1340 aux_nodes_father_nodes(
i,0)=edge_begin_node;
1341 aux_nodes_father_nodes(
i,1)=edge_end_node;
1343 aux_node_enrichment_shape_function_index(
i)=shape_function_id;
1344 shape_function_id++;
1348 if(fabs(rDistances(edge_end_node))>fabs(rDistances(edge_begin_node)))
1350 aux_nodes_relative_locations(
i)=0.0;
1351 aux_nodes_father_nodes(
i,0)=edge_end_node;
1352 aux_nodes_father_nodes(
i,1)=edge_end_node;
1356 aux_nodes_relative_locations(
i)=1.0;
1357 aux_nodes_father_nodes(
i,0)=edge_begin_node;
1358 aux_nodes_father_nodes(
i,1)=edge_begin_node;
1361 aux_node_enrichment_shape_function_index(
i)=-1;
1365 for (
unsigned int j=0;
j<2;
j++)
1366 aux_points(
i,
j)= rPoints(edge_begin_node,
j) * aux_nodes_relative_locations(
i) + rPoints(edge_end_node,
j) * (1.0- aux_nodes_relative_locations(
i));
1371 if (cut_edges(0)==
true)
1373 base_point[0] = aux_points(0,0);
1374 base_point[1] = aux_points(0,1);
1378 base_point[0] = aux_points(1,0);
1379 base_point[1] = aux_points(1,1);
1382 for (
int i_node = 0; i_node < 3; i_node++)
1384 double d = (rPoints(i_node,0) - base_point[0]) * grad_d[0] +
1385 (rPoints(i_node,1) - base_point[1]) * grad_d[1] ;
1386 abs_distance[i_node] = fabs(
d);
1390 for (
int i = 0;
i < 3;
i++)
1392 if (rDistances[
i] < 0.0)
1394 exact_distance[
i] = -abs_distance[
i];
1399 exact_distance[
i] = abs_distance[
i];
1412 double max_aux_dist_on_cut = -1;
1413 for (
int edge = 0; edge < 3; edge++)
1418 if (rDistances[
i] * rDistances[
j] < 0.0)
1420 const double tmp = fabs(rDistances[
i]) / (fabs(rDistances[
i]) + fabs(rDistances[
j]));
1422 double abs_dist_on_cut = abs_distance[
i] *
tmp + abs_distance[
j] * (1.00 -
tmp);
1423 if(abs_dist_on_cut > max_aux_dist_on_cut) max_aux_dist_on_cut = abs_dist_on_cut;
1438 unsigned int partition_number=0;
1441 bool found_empty_partition=
false;
1448 for (
unsigned int i=0;
i<4;
i++)
1452 active_node_in_enrichment_shape_function(0)=-1;
1453 active_node_in_enrichment_shape_function(1)=-1;
1456 active_node_in_replacement_shape_function(0)=-1;
1457 active_node_in_replacement_shape_function(1)=-1;
1458 active_node_in_replacement_shape_function(2)=-1;
1460 unsigned int j_aux =
i + 2;
1461 if (j_aux>2) j_aux -= 3;
1466 partition_father_nodes(0,0)=
i;
1467 partition_father_nodes(0,1)=
i;
1468 partition_father_nodes(1,0)=aux_nodes_father_nodes(
i,0);
1469 partition_father_nodes(1,1)=aux_nodes_father_nodes(
i,1);
1470 partition_father_nodes(2,0)=aux_nodes_father_nodes(j_aux,0);
1471 partition_father_nodes(2,1)=aux_nodes_father_nodes(j_aux,1);
1473 coord_subdomain(0,0)=rPoints(
i,0);
1474 coord_subdomain(0,1)=rPoints(
i,1);
1475 coord_subdomain(1,0)=aux_points(
i,0);
1476 coord_subdomain(1,1)=aux_points(
i,1);
1477 coord_subdomain(2,0)=aux_points(j_aux,0);
1478 coord_subdomain(2,1)=aux_points(j_aux,1);
1481 if (aux_node_enrichment_shape_function_index(
i)> -1)
1482 active_node_in_enrichment_shape_function( aux_node_enrichment_shape_function_index(
i) )=1;
1486 if (aux_node_enrichment_shape_function_index(j_aux)> -1)
1487 active_node_in_enrichment_shape_function( aux_node_enrichment_shape_function_index(j_aux) )=2;
1490 active_node_in_replacement_shape_function(
i)=0;
1492 if (aux_nodes_father_nodes(
i,0)==aux_nodes_father_nodes(
i,1))
1493 active_node_in_replacement_shape_function(aux_nodes_father_nodes(
i,0))=1;
1494 if (aux_nodes_father_nodes(j_aux,0)==aux_nodes_father_nodes(j_aux,1))
1495 active_node_in_replacement_shape_function(aux_nodes_father_nodes(j_aux,0))=2;
1501 partition_father_nodes=aux_nodes_father_nodes;
1502 coord_subdomain=aux_points;
1505 for (
int j = 0;
j < 3;
j++)
1507 if (aux_node_enrichment_shape_function_index(
j)> -1)
1508 active_node_in_enrichment_shape_function( aux_node_enrichment_shape_function_index(
j) ) =
j;
1511 if (aux_nodes_father_nodes(
j,0)==aux_nodes_father_nodes(
j,1))
1512 active_node_in_replacement_shape_function(aux_nodes_father_nodes(
j,0))=
j;
1519 CalculateGeometryData(coord_subdomain, DN_DX_subdomain, temp_area);
1520 if (temp_area > 1.0e-20)
1522 rVolumes(partition_number)=temp_area;
1524 double x_GP_partition = one_third * ( coord_subdomain(0,0) + coord_subdomain(1,0) + coord_subdomain(2,0) );
1525 double y_GP_partition = one_third * ( coord_subdomain(0,1) + coord_subdomain(1,1) + coord_subdomain(2,1) );
1526 double z_GP_partition = 0.0;
1528 coord_subdomain = rPoints;
1530 CalculatePosition ( coord_subdomain , x_GP_partition ,y_GP_partition ,z_GP_partition ,
N);
1532 const double partition_sign = (
N(0)*rDistances(0) +
N(1)*rDistances(1) +
N(2)*rDistances(2))/fabs(
N(0)*rDistances(0) +
N(1)*rDistances(1) +
N(2)*rDistances(2));
1535 rGPShapeFunctionValues(partition_number,0)=
N(0);
1536 rGPShapeFunctionValues(partition_number,1)=
N(1);
1537 rGPShapeFunctionValues(partition_number,2)=
N(2);
1548 if (partition_sign < 0.0)
1549 rPartitionsSign[partition_number] = -1.0;
1551 rPartitionsSign[partition_number] = 1.0;
1555 for (
int index_shape_function = 0; index_shape_function < 2; index_shape_function++)
1557 if (active_node_in_enrichment_shape_function(index_shape_function) > -1)
1559 NEnriched(partition_number, index_shape_function ) = one_third ;
1561 for (
int j = 0;
j < 2;
j++)
1563 rGradientsValue[partition_number](index_shape_function,
j) = DN_DX_subdomain(active_node_in_enrichment_shape_function(index_shape_function),
j);
1570 NEnriched(partition_number, index_shape_function ) = 0.0;
1572 for (
int j = 0;
j < 2;
j++)
1574 rGradientsValue[partition_number](index_shape_function,
j) = 0.0;
1583 unsigned int number_of_real_nodes=0;
1584 for (
int index_shape_function = 0; index_shape_function < 3; index_shape_function++)
1586 if (active_node_in_replacement_shape_function(index_shape_function) > -1)
1587 number_of_real_nodes++;
1590 if (number_of_real_nodes==2)
1592 for (
int index_shape_function = 0; index_shape_function < 2; index_shape_function++)
1594 if (active_node_in_enrichment_shape_function(index_shape_function) > -1)
1596 NEnriched(partition_number, 2 ) = one_third*rPartitionsSign[partition_number] ;
1597 NEnriched(partition_number, 3 ) = one_third;
1598 for (
int j = 0;
j < 2;
j++)
1600 rGradientsValue[partition_number](2,
j) = DN_DX_subdomain(active_node_in_enrichment_shape_function(index_shape_function),
j)*rPartitionsSign[partition_number];
1601 rGradientsValue[partition_number](3,
j) = DN_DX_subdomain(active_node_in_enrichment_shape_function(index_shape_function),
j);
1609 for (
int index_shape_function = 0; index_shape_function < 3; index_shape_function++)
1611 if (active_node_in_replacement_shape_function(index_shape_function) > -1)
1613 NEnriched(partition_number, 2 ) = one_third*rPartitionsSign[partition_number]*2.0 ;
1614 NEnriched(partition_number, 3 ) = one_third*2.0 ;
1615 for (
int j = 0;
j < 2;
j++)
1617 rGradientsValue[partition_number](2,
j) = - DN_DX_subdomain(active_node_in_replacement_shape_function(index_shape_function),
j)*rPartitionsSign[partition_number];
1618 rGradientsValue[partition_number](3,
j) = - DN_DX_subdomain(active_node_in_replacement_shape_function(index_shape_function),
j);
1628 found_empty_partition=
true;
1630 if (found_empty_partition==
false)
1643 array_1d<
double,(3*(2-1))>& rPartitionsSign, std::vector<Matrix>& rGradientsValue,
BoundedMatrix<
double,3*(2-1), (2)>& NEnriched,
1645 array_1d<
double,(3)>& rGPShapeFunctionValues_in_interfase,
array_1d<
double,(3)>& NEnriched_in_interfase,
double & InterfaseArea)
1649 const double one_third=1.0/3.0;
1654 double most_common_sign=0;
1656 rGPShapeFunctionValues(0,0)=one_third;
1657 rGPShapeFunctionValues(0,1)=one_third;
1658 rGPShapeFunctionValues(0,2)=one_third;
1659 Area = CalculateVolume2D( rPoints );
1665 if( (rDistances(0)*rDistances(1))>0.0 && (rDistances(0)*rDistances(2))>0.0 )
1668 rGPShapeFunctionValues(0,0)=one_third;
1669 rGPShapeFunctionValues(0,1)=one_third;
1670 rGPShapeFunctionValues(0,2)=one_third;
1671 NEnriched(0,0) = 0.0;
1673 for (
int j = 0;
j < 3;
j++)
1674 rGradientsValue[0](0,
j) = 0.0;
1675 if (rDistances(0) < 0.0) rPartitionsSign[0] = -1.0;
1676 else rPartitionsSign[0] = 1.0;
1698 if ((rDistances(0)*rDistances(1))<0.0)
1702 if ((rDistances(1)*rDistances(2))<0.0)
1706 if ((rDistances(2)*rDistances(0))<0.0)
1713 const double unsigned_distance0=fabs(rDistances(0));
1714 const double unsigned_distance1=fabs(rDistances(1));
1715 const double unsigned_distance2=fabs(rDistances(2));
1717 double longest_distance=fabs(unsigned_distance0);
1718 if (unsigned_distance1>longest_distance)
1719 longest_distance=unsigned_distance1;
1720 if (unsigned_distance2>longest_distance)
1721 longest_distance=unsigned_distance2;
1723 const double tolerable_distance =longest_distance*0.001;
1725 if (unsigned_distance0<tolerable_distance)
1726 rDistances[0]=tolerable_distance*(rDistances[0]/fabs(rDistances[0]));
1727 if (unsigned_distance1<tolerable_distance)
1728 rDistances[1]=tolerable_distance*(rDistances[1]/fabs(rDistances[1]));
1729 if (unsigned_distance2<tolerable_distance)
1730 rDistances[2]=tolerable_distance*(rDistances[2]/fabs(rDistances[2]));
1736 for (
unsigned int i=0;
i<3;
i++)
1738 int edge_begin_node=
i;
1739 int edge_end_node=
i+1;
1740 if (edge_end_node==3) edge_end_node=0;
1742 if(cut_edges(
i)==
true)
1744 aux_nodes_relative_locations(
i)=fabs(rDistances(edge_end_node)/(rDistances(edge_end_node)-rDistances(edge_begin_node) ) ) ;
1745 aux_nodes_father_nodes(
i,0)=edge_begin_node;
1746 aux_nodes_father_nodes(
i,1)=edge_end_node;
1750 if(fabs(rDistances(edge_end_node))>fabs(rDistances(edge_begin_node)))
1752 aux_nodes_relative_locations(
i)=0.0;
1753 aux_nodes_father_nodes(
i,0)=edge_end_node;
1754 aux_nodes_father_nodes(
i,1)=edge_end_node;
1758 aux_nodes_relative_locations(
i)=1.0;
1759 aux_nodes_father_nodes(
i,0)=edge_begin_node;
1760 aux_nodes_father_nodes(
i,1)=edge_begin_node;
1765 for (
unsigned int j=0;
j<2;
j++)
1766 aux_points(
i,
j)= rPoints(edge_begin_node,
j) * aux_nodes_relative_locations(
i) + rPoints(edge_end_node,
j) * (1.0- aux_nodes_relative_locations(
i));
1771 if (cut_edges(0)==
true)
1773 base_point[0] = aux_points(0,0);
1774 base_point[1] = aux_points(0,1);
1779 base_point[0] = aux_points(1,0);
1780 base_point[1] = aux_points(1,1);
1783 for (
int i_node = 0; i_node < 3; i_node++)
1785 double d = (rPoints(i_node,0) - base_point[0]) * grad_d[0] +
1786 (rPoints(i_node,1) - base_point[1]) * grad_d[1] ;
1787 abs_distance[i_node] = fabs(
d);
1791 for (
int i = 0;
i < 3;
i++)
1793 if (rDistances[
i] < 0.0)
1795 exact_distance[
i] = -abs_distance[
i];
1800 exact_distance[
i] = abs_distance[
i];
1817 double max_aux_dist_on_cut = -1;
1818 for (
int edge = 0; edge < 3; edge++)
1823 if (rDistances[
i] * rDistances[
j] < 0.0)
1825 const double tmp = fabs(rDistances[
i]) / (fabs(rDistances[
i]) + fabs(rDistances[
j]));
1827 double abs_dist_on_cut = abs_distance[
i] *
tmp + abs_distance[
j] * (1.00 -
tmp);
1828 if(abs_dist_on_cut > max_aux_dist_on_cut) max_aux_dist_on_cut = abs_dist_on_cut;
1843 unsigned int partition_number=0;
1846 bool found_empty_partition=
false;
1847 for (
unsigned int i=0;
i<4;
i++)
1849 unsigned int j_aux =
i + 2;
1850 if (j_aux>2) j_aux -= 3;
1855 partition_father_nodes(0,0)=
i;
1856 partition_father_nodes(0,1)=
i;
1857 partition_father_nodes(1,0)=aux_nodes_father_nodes(
i,0);
1858 partition_father_nodes(1,1)=aux_nodes_father_nodes(
i,1);
1859 partition_father_nodes(2,0)=aux_nodes_father_nodes(j_aux,0);
1860 partition_father_nodes(2,1)=aux_nodes_father_nodes(j_aux,1);
1862 coord_subdomain(0,0)=rPoints(
i,0);
1863 coord_subdomain(0,1)=rPoints(
i,1);
1864 coord_subdomain(1,0)=aux_points(
i,0);
1865 coord_subdomain(1,1)=aux_points(
i,1);
1866 coord_subdomain(2,0)=aux_points(j_aux,0);
1867 coord_subdomain(2,1)=aux_points(j_aux,1);
1872 partition_father_nodes=aux_nodes_father_nodes;
1873 coord_subdomain=aux_points;
1878 CalculateGeometryData(coord_subdomain, DN_DX_subdomain, temp_area);
1879 if (temp_area > 1.0e-20)
1881 rVolumes(partition_number)=temp_area;
1883 double x_GP_partition = one_third * ( coord_subdomain(0,0) + coord_subdomain(1,0) + coord_subdomain(2,0) );
1884 double y_GP_partition = one_third * ( coord_subdomain(0,1) + coord_subdomain(1,1) + coord_subdomain(2,1) );
1885 double z_GP_partition = 0.0;
1887 coord_subdomain = rPoints;
1889 CalculatePosition ( coord_subdomain , x_GP_partition ,y_GP_partition ,z_GP_partition ,
N);
1891 const double partition_sign = (
N(0)*rDistances(0) +
N(1)*rDistances(1) +
N(2)*rDistances(2))/fabs(
N(0)*rDistances(0) +
N(1)*rDistances(1) +
N(2)*rDistances(2));
1894 rGPShapeFunctionValues(partition_number,0)=
N(0);
1895 rGPShapeFunctionValues(partition_number,1)=
N(1);
1896 rGPShapeFunctionValues(partition_number,2)=
N(2);
1900 double abs_dist = 0.0;
1901 for (
int j = 0;
j < 3;
j++)
1903 dist += rGPShapeFunctionValues(partition_number,
j) * exact_distance[
j];
1904 abs_dist += rGPShapeFunctionValues(partition_number,
j) * abs_distance[
j];
1907 if (partition_sign < 0.0)
1908 rPartitionsSign[partition_number] = -1.0;
1910 rPartitionsSign[partition_number] = 1.0;
1913 NEnriched(partition_number, 0) = 0.5/max_aux_dist_on_cut * (abs_dist - rPartitionsSign[partition_number] *
dist);
1914 for (
int j = 0;
j < 2;
j++)
1916 rGradientsValue[partition_number](0,
j) = (0.5/max_aux_dist_on_cut) * (abs_distance_gradient[
j] - rPartitionsSign[partition_number] * exact_distance_gradient[
j]);
1920 if (rPartitionsSign[partition_number]*most_common_sign > 0.0)
1922 NEnriched(partition_number, 1) = -1.0*rPartitionsSign[partition_number]*NEnriched(partition_number, 0) ;
1923 for (
int j = 0;
j < 2;
j++)
1925 rGradientsValue[partition_number](1,
j) = -1.0*rPartitionsSign[partition_number]*rGradientsValue[partition_number](0,
j);
1932 NEnriched(partition_number, 1) = rPartitionsSign[partition_number]*( 1.0*NEnriched(partition_number, 0) - 0.6666666666666666666666666666 ) ;
1933 for (
int j = 0;
j < 2;
j++)
1935 rGradientsValue[partition_number](1,
j) = (rPartitionsSign[partition_number]*1.0*rGradientsValue[partition_number](0,
j) - exact_distance_gradient[
j]*1.0/(abs_distance[
i]));
1945 found_empty_partition=
true;
1948 if (found_empty_partition==
false)
1956 InterfaseArea = sqrt(pow(aux_points(0,0)-aux_points(1,0),2)+pow(aux_points(0,1)-aux_points(1,1),2));
1957 base_point[0] = (aux_points(0,0)+aux_points(1,0))*0.5;
1958 base_point[1] = (aux_points(0,1)+aux_points(1,1))*0.5;
1959 CalculatePosition ( rPoints , base_point[0] ,base_point[1] , 0.0 , rGPShapeFunctionValues_in_interfase);
1960 double abs_dist_on_interfase = 0.0;
1961 for (
int j = 0;
j < 3;
j++)
1962 abs_dist_on_interfase += rGPShapeFunctionValues_in_interfase (
j) * abs_distance[
j];
1963 NEnriched_in_interfase(0) = 0.5/max_aux_dist_on_cut * abs_dist_on_interfase;
1967 InterfaseArea= sqrt(pow(aux_points(0,0)-aux_points(2,0),2)+pow(aux_points(0,1)-aux_points(2,1),2));
1968 base_point[0] = (aux_points(0,0)+aux_points(2,0))*0.5;
1969 base_point[1] = (aux_points(0,1)+aux_points(2,1))*0.5;
1970 CalculatePosition ( rPoints , base_point[0] ,base_point[1] , 0.0 , rGPShapeFunctionValues_in_interfase);
1971 double abs_dist_on_interfase = 0.0;
1972 for (
int j = 0;
j < 3;
j++)
1973 abs_dist_on_interfase += rGPShapeFunctionValues_in_interfase (
j) * abs_distance[
j];
1974 NEnriched_in_interfase(0) = 0.5/max_aux_dist_on_cut * abs_dist_on_interfase;
1979 InterfaseArea= sqrt(pow(aux_points(2,0)-aux_points(1,0),2)+pow(aux_points(2,1)-aux_points(1,1),2));
1980 base_point[0] = (aux_points(2,0)+aux_points(1,0))*0.5;
1981 base_point[1] = (aux_points(2,1)+aux_points(1,1))*0.5;
1982 CalculatePosition ( rPoints , base_point[0] ,base_point[1] , 0.0 , rGPShapeFunctionValues_in_interfase);
1983 double abs_dist_on_interfase = 0.0;
1984 for (
int j = 0;
j < 3;
j++)
1985 abs_dist_on_interfase += rGPShapeFunctionValues_in_interfase (
j) * abs_distance[
j];
1986 NEnriched_in_interfase(0) = 0.5/max_aux_dist_on_cut * abs_dist_on_interfase;
2001 array_1d<
double,(3*(2-1))>& rPartitionsSign, std::vector<Matrix>& rGradientsValue,
BoundedMatrix<
double,3*(2-1), (2)>& NEnriched,
BoundedMatrix<
double,(2), 2 >& rRotationMatrix,
BoundedMatrix<
double, (2+1), 2 > & DN_DX_in_local_axis)
2006 const double one_third=1.0/3.0;
2013 double most_common_sign=0;
2015 rGPShapeFunctionValues(0,0)=one_third;
2016 rGPShapeFunctionValues(0,1)=one_third;
2017 rGPShapeFunctionValues(0,2)=one_third;
2018 Area = CalculateVolume2D( rOriginalPoints );
2024 if( (rDistances(0)*rDistances(1))>0.0 && (rDistances(0)*rDistances(2))>0.0 )
2027 rGPShapeFunctionValues(0,0)=one_third;
2028 rGPShapeFunctionValues(0,1)=one_third;
2029 rGPShapeFunctionValues(0,2)=one_third;
2030 NEnriched(0,0) = 0.0;
2032 for (
int j = 0;
j < 3;
j++)
2033 rGradientsValue[0](0,
j) = 0.0;
2034 if (rDistances(0) < 0.0) rPartitionsSign[0] = -1.0;
2035 else rPartitionsSign[0] = 1.0;
2055 if ((rDistances(0)*rDistances(1))<0.0)
2059 if ((rDistances(1)*rDistances(2))<0.0)
2063 if ((rDistances(2)*rDistances(0))<0.0)
2072 const double unsigned_distance0=fabs(rDistances(0));
2073 const double unsigned_distance1=fabs(rDistances(1));
2074 const double unsigned_distance2=fabs(rDistances(2));
2076 double longest_distance=fabs(unsigned_distance0);
2077 if (unsigned_distance1>longest_distance)
2078 longest_distance=unsigned_distance1;
2079 if (unsigned_distance2>longest_distance)
2080 longest_distance=unsigned_distance2;
2082 const double tolerable_distance =longest_distance*0.001;
2084 if (unsigned_distance0<tolerable_distance)
2085 rDistances[0]=tolerable_distance*(rDistances[0]/fabs(rDistances[0]));
2086 if (unsigned_distance1<tolerable_distance)
2087 rDistances[1]=tolerable_distance*(rDistances[1]/fabs(rDistances[1]));
2088 if (unsigned_distance2<tolerable_distance)
2089 rDistances[2]=tolerable_distance*(rDistances[2]/fabs(rDistances[2]));
2095 for (
unsigned int i=0;
i<3;
i++)
2097 int edge_begin_node=
i;
2098 int edge_end_node=
i+1;
2099 if (edge_end_node==3) edge_end_node=0;
2101 if(cut_edges(
i)==
true)
2103 aux_nodes_relative_locations(
i)=fabs(rDistances(edge_end_node)/(rDistances(edge_end_node)-rDistances(edge_begin_node) ) ) ;
2104 aux_nodes_father_nodes(
i,0)=edge_begin_node;
2105 aux_nodes_father_nodes(
i,1)=edge_end_node;
2109 if(fabs(rDistances(edge_end_node))>fabs(rDistances(edge_begin_node)))
2111 aux_nodes_relative_locations(
i)=0.0;
2112 aux_nodes_father_nodes(
i,0)=edge_end_node;
2113 aux_nodes_father_nodes(
i,1)=edge_end_node;
2117 aux_nodes_relative_locations(
i)=1.0;
2118 aux_nodes_father_nodes(
i,0)=edge_begin_node;
2119 aux_nodes_father_nodes(
i,1)=edge_begin_node;
2124 for (
unsigned int j=0;
j<2;
j++)
2125 aux_points(
i,
j)= rOriginalPoints(edge_begin_node,
j) * aux_nodes_relative_locations(
i) + rOriginalPoints(edge_end_node,
j) * (1.0- aux_nodes_relative_locations(
i));
2129 double x_reference=aux_points(0,0);
2130 double y_reference=aux_points(0,1);
2133 if (cut_edges[0]==
false)
2135 x_reference=aux_points(1,0);
2136 y_reference=aux_points(1,1);
2137 const double one_over_interfase_lenght = 1.0/sqrt( pow((aux_points(2,0) - x_reference),2) + pow((aux_points(2,1) - y_reference),2));
2138 cosinus = (aux_points(2,0) - x_reference)*one_over_interfase_lenght;
2139 sinus = - (aux_points(2,1) - y_reference)*one_over_interfase_lenght;
2141 else if(cut_edges[1]==
true)
2143 const double one_over_interfase_lenght = 1.0/sqrt( pow((aux_points(1,0) - x_reference),2) + pow((aux_points(1,1) - y_reference),2));
2144 cosinus = (aux_points(1,0) - x_reference)*one_over_interfase_lenght;
2145 sinus = - (aux_points(1,1) - y_reference)*one_over_interfase_lenght;
2149 const double one_over_interfase_lenght = 1.0/sqrt( pow((aux_points(2,0) - x_reference),2) + pow((aux_points(2,1) - y_reference),2));
2150 cosinus = (aux_points(2,0) - x_reference)*one_over_interfase_lenght;
2151 sinus = - (aux_points(2,1) - y_reference)*one_over_interfase_lenght;
2154 for (
unsigned int i=0;
i<3;
i++)
2156 rRotatedPoints(
i,0)= cosinus * (rOriginalPoints(
i,0)-x_reference) - sinus * (rOriginalPoints(
i,1)-y_reference);
2157 rRotatedPoints(
i,1)= cosinus * (rOriginalPoints(
i,1)-y_reference) + sinus * (rOriginalPoints(
i,0)-x_reference);
2160 double aux_x_coord=aux_points(
i,0);
2161 aux_points(
i,0)= cosinus * (aux_x_coord-x_reference) - sinus * (aux_points(
i,1)-y_reference);
2162 aux_points(
i,1)= cosinus * (aux_points(
i,1)-y_reference) + sinus * (aux_x_coord-x_reference);
2165 rRotationMatrix(0,0)=cosinus;
2166 rRotationMatrix(0,1)= sinus;
2167 rRotationMatrix(1,0)= -sinus;
2168 rRotationMatrix(1,1)=cosinus;
2172 CalculateGeometryData(rRotatedPoints, DN_DX_in_local_axis, temp_area);
2184 if (cut_edges(0)==
true)
2186 base_point[0] = aux_points(0,0);
2187 base_point[1] = aux_points(0,1);
2191 base_point[0] = aux_points(1,0);
2192 base_point[1] = aux_points(1,1);
2195 for (
int i_node = 0; i_node < 3; i_node++)
2197 double d = (rRotatedPoints(i_node,0) - base_point[0]) * grad_d[0] +
2198 (rRotatedPoints(i_node,1) - base_point[1]) * grad_d[1] ;
2199 abs_distance[i_node] = fabs(
d);
2203 for (
int i = 0;
i < 3;
i++)
2205 if (rDistances[
i] < 0.0)
2207 exact_distance[
i] = -abs_distance[
i];
2212 exact_distance[
i] = abs_distance[
i];
2220 noalias(exact_distance_gradient) =
prod(
trans(DN_DX_in_local_axis), exact_distance);
2223 noalias(abs_distance_gradient) =
prod(
trans(DN_DX_in_local_axis), abs_distance);
2226 double max_aux_dist_on_cut = -1;
2227 for (
int edge = 0; edge < 3; edge++)
2232 if (rDistances[
i] * rDistances[
j] < 0.0)
2234 const double tmp = fabs(rDistances[
i]) / (fabs(rDistances[
i]) + fabs(rDistances[
j]));
2236 double abs_dist_on_cut = abs_distance[
i] *
tmp + abs_distance[
j] * (1.00 -
tmp);
2237 if(abs_dist_on_cut > max_aux_dist_on_cut) max_aux_dist_on_cut = abs_dist_on_cut;
2252 unsigned int partition_number=0;
2255 bool found_empty_partition=
false;
2256 for (
unsigned int i=0;
i<4;
i++)
2258 unsigned int j_aux =
i + 2;
2259 if (j_aux>2) j_aux -= 3;
2264 partition_father_nodes(0,0)=
i;
2265 partition_father_nodes(0,1)=
i;
2266 partition_father_nodes(1,0)=aux_nodes_father_nodes(
i,0);
2267 partition_father_nodes(1,1)=aux_nodes_father_nodes(
i,1);
2268 partition_father_nodes(2,0)=aux_nodes_father_nodes(j_aux,0);
2269 partition_father_nodes(2,1)=aux_nodes_father_nodes(j_aux,1);
2271 coord_subdomain(0,0)=rRotatedPoints(
i,0);
2272 coord_subdomain(0,1)=rRotatedPoints(
i,1);
2273 coord_subdomain(1,0)=aux_points(
i,0);
2274 coord_subdomain(1,1)=aux_points(
i,1);
2275 coord_subdomain(2,0)=aux_points(j_aux,0);
2276 coord_subdomain(2,1)=aux_points(j_aux,1);
2281 partition_father_nodes=aux_nodes_father_nodes;
2282 coord_subdomain=aux_points;
2287 CalculateGeometryData(coord_subdomain, DN_DX_subdomain, temp_area);
2288 if (temp_area > 1.0e-20)
2290 rVolumes(partition_number)=temp_area;
2292 double x_GP_partition = one_third * ( coord_subdomain(0,0) + coord_subdomain(1,0) + coord_subdomain(2,0) );
2293 double y_GP_partition = one_third * ( coord_subdomain(0,1) + coord_subdomain(1,1) + coord_subdomain(2,1) );
2294 double z_GP_partition = 0.0;
2296 coord_subdomain = rRotatedPoints;
2298 CalculatePosition ( coord_subdomain , x_GP_partition ,y_GP_partition ,z_GP_partition ,
N);
2300 const double partition_sign = (
N(0)*rDistances(0) +
N(1)*rDistances(1) +
N(2)*rDistances(2))/fabs(
N(0)*rDistances(0) +
N(1)*rDistances(1) +
N(2)*rDistances(2));
2303 rGPShapeFunctionValues(partition_number,0)=
N(0);
2304 rGPShapeFunctionValues(partition_number,1)=
N(1);
2305 rGPShapeFunctionValues(partition_number,2)=
N(2);
2309 double abs_dist = 0.0;
2310 for (
int j = 0;
j < 3;
j++)
2312 dist += rGPShapeFunctionValues(partition_number,
j) * exact_distance[
j];
2313 abs_dist += rGPShapeFunctionValues(partition_number,
j) * abs_distance[
j];
2316 if (partition_sign < 0.0)
2317 rPartitionsSign[partition_number] = -1.0;
2319 rPartitionsSign[partition_number] = 1.0;
2322 NEnriched(partition_number, 0) = 0.5/max_aux_dist_on_cut * (abs_dist - rPartitionsSign[partition_number] *
dist);
2323 for (
int j = 0;
j < 2;
j++)
2325 rGradientsValue[partition_number](0,
j) = (0.5/max_aux_dist_on_cut) * (abs_distance_gradient[
j] - rPartitionsSign[partition_number] * exact_distance_gradient[
j]);
2329 if (rPartitionsSign[partition_number]*most_common_sign > 0.0)
2331 NEnriched(partition_number, 1) = -1.0*rPartitionsSign[partition_number]*NEnriched(partition_number, 0) ;
2332 for (
int j = 0;
j < 2;
j++)
2334 rGradientsValue[partition_number](1,
j) = -1.0*rPartitionsSign[partition_number]*rGradientsValue[partition_number](0,
j);
2341 NEnriched(partition_number, 1) = rPartitionsSign[partition_number]*( 1.0*NEnriched(partition_number, 0) - 0.6666666666666666666666666666 ) ;
2342 for (
int j = 0;
j < 2;
j++)
2344 rGradientsValue[partition_number](1,
j) = (rPartitionsSign[partition_number]*1.0*rGradientsValue[partition_number](0,
j) - exact_distance_gradient[
j]*1.0/(abs_distance[
i]));
2352 found_empty_partition=
true;
2355 if (found_empty_partition==
false)
2365 template<
class TMatrixType>
2366 static void CopyShapeFunctionsValues(TMatrixType& rShapeFunctionValues,
int OriginId,
int DestinationId)
2370 rShapeFunctionValues(DestinationId,
i) = rShapeFunctionValues(OriginId,
i);
2373 template<
class TMatrixType,
class TVectorType>
2374 static void Divide1To2(array_1d<double, 6 >
const& EdgeDivisionI, array_1d<double, 6 >
const& EdgeDivisionJ,
int Edge,
2375 int Volume1Id,
int Volume2Id,
double Volume, TMatrixType& rShapeFunctionValues, TVectorType& rVolumes)
2377 const int edge_i[] = {0, 0, 0, 1, 1, 2};
2378 const int edge_j[] = {1, 2, 3, 2, 3, 3};
2380 const double division_i = EdgeDivisionI[Edge];
2381 const double division_j = EdgeDivisionJ[Edge];
2383 rVolumes[Volume1Id] = division_i * Volume;
2384 rVolumes[Volume2Id] = division_j * Volume;
2386 const int i = edge_i[Edge];
2387 const int j = edge_j[Edge];
2394 double delta1 = rShapeFunctionValues(Volume1Id,
i) * (1.00 - division_i);
2395 rShapeFunctionValues(Volume1Id,
i) += delta1;
2396 rShapeFunctionValues(Volume1Id,
j) -= delta1;
2398 double delta2 = rShapeFunctionValues(Volume2Id,
i) * (1.00 - division_j);
2399 rShapeFunctionValues(Volume2Id,
j) += delta2;
2400 rShapeFunctionValues(Volume2Id,
i) -= delta2;
2420 static double ComputeSubTetraVolumeAndCenter(
const BoundedMatrix<double, 3, 8 > & aux_coordinates,
2421 array_1d<double, 3 > & center_position,
2422 const int i0,
const int i1,
const int i2,
const int i3)
2424 double x10 = aux_coordinates(i1, 0) - aux_coordinates(i0, 0);
2425 double y10 = aux_coordinates(i1, 1) - aux_coordinates(i0, 1);
2426 double z10 = aux_coordinates(i1, 2) - aux_coordinates(i0, 2);
2428 double x20 = aux_coordinates(i2, 0) - aux_coordinates(i0, 0);
2429 double y20 = aux_coordinates(i2, 1) - aux_coordinates(i0, 1);
2430 double z20 = aux_coordinates(i2, 2) - aux_coordinates(i0, 2);
2432 double x30 = aux_coordinates(i3, 0) - aux_coordinates(i0, 0);
2433 double y30 = aux_coordinates(i3, 1) - aux_coordinates(i0, 1);
2434 double z30 = aux_coordinates(i3, 2) - aux_coordinates(i0, 2);
2436 double detJ = x10 * y20 * z30 - x10 * y30 * z20 + y10 * z20 * x30 - y10 * x20 * z30 + z10 * x20 * y30 - z10 * y20 * x30;
2437 double vol = detJ * 0.1666666666666666666667;
2439 for (
unsigned int i = 0;
i < 3;
i++)
2441 center_position[
i] = aux_coordinates(i0,
i) + aux_coordinates(i1,
i) + aux_coordinates(i2,
i) + aux_coordinates(i3,
i);
2443 center_position *= 0.25;
2448 template<
class TMatrixType>
2449 static void ComputeElementCoordinates(array_1d<double, 4 > &
N,
const array_1d<double, 3 > & center_position,
const TMatrixType& rPoints,
const double vol)
2451 double x0 = rPoints(0, 0);
2452 double y0 = rPoints(0, 1);
2453 double z0 = rPoints(0, 2);
2454 double x1 = rPoints(1, 0);
2455 double y1 = rPoints(1, 1);
2456 double z1 = rPoints(1, 2);
2457 double x2 = rPoints(2, 0);
2458 double y2 = rPoints(2, 1);
2459 double z2 = rPoints(2, 2);
2460 double x3 = rPoints(3, 0);
2461 double y3 = rPoints(3, 1);
2462 double z3 = rPoints(3, 2);
2464 double xc = center_position[0];
2465 double yc = center_position[1];
2466 double zc = center_position[2];
2468 double inv_vol = 1.0 / vol;
2473 N[0] = CalculateVol(
x1, y1, z1, x3, y3, z3,
x2, y2, z2,
xc,
yc, zc) * inv_vol;
2474 N[1] = CalculateVol(x0, y0, z0,
x2, y2, z2, x3, y3, z3,
xc,
yc, zc) * inv_vol;
2475 N[2] = CalculateVol(x3, y3, z3,
x1, y1, z1, x0, y0, z0,
xc,
yc, zc) * inv_vol;
2476 N[3] = CalculateVol(
x1, y1, z1,
x2, y2, z2, x0, y0, z0,
xc,
yc, zc) * inv_vol;
2480 static inline double CalculateVol(
const double x0,
const double y0,
const double z0,
2481 const double x1,
const double y1,
const double z1,
2482 const double x2,
const double y2,
const double z2,
2483 const double x3,
const double y3,
const double z3
2486 double x10 =
x1 - x0;
2487 double y10 = y1 - y0;
2488 double z10 = z1 - z0;
2490 double x20 =
x2 - x0;
2491 double y20 = y2 - y0;
2492 double z20 = z2 - z0;
2494 double x30 = x3 - x0;
2495 double y30 = y3 - y0;
2496 double z30 = z3 - z0;
2498 double detJ = x10 * y20 * z30 - x10 * y30 * z20 + y10 * z20 * x30 - y10 * x20 * z30 + z10 * x20 * y30 - z10 * y20 * x30;
2499 return detJ * 0.1666666666666666666667;
2503 static inline void CalculateGeometryData(
2504 const BoundedMatrix<double, 3, 3 > & coordinates,
2505 BoundedMatrix<double,3,2>& DN_DX,
2506 array_1d<double,3>&
N,
2509 double x10 = coordinates(1,0) - coordinates(0,0);
2510 double y10 = coordinates(1,1) - coordinates(0,1);
2512 double x20 = coordinates(2,0) - coordinates(0,0);
2513 double y20 = coordinates(2,1) - coordinates (0,1);
2521 double detJ = x10 * y20-y10 * x20;
2523 DN_DX(0,0) = -y20 + y10;
2524 DN_DX(0,1) = x20 - x10;
2531 N[0] = 0.333333333333333;
2532 N[1] = 0.333333333333333;
2533 N[2] = 0.333333333333333;
2539 static inline double CalculateVolume2D(
2540 const BoundedMatrix<double, 3, 3 > & coordinates)
2542 double x10 = coordinates(1,0) - coordinates(0,0);
2543 double y10 = coordinates(1,1) - coordinates(0,1);
2545 double x20 = coordinates(2,0) - coordinates(0,0);
2546 double y20 = coordinates(2,1) - coordinates (0,1);
2547 double detJ = x10 * y20-y10 * x20;
2551 static inline bool CalculatePosition(
const BoundedMatrix<double, 3, 3 > & coordinates,
2552 const double xc,
const double yc,
const double zc,
2553 array_1d<double, 3 > &
N
2556 double x0 = coordinates(0,0);
2557 double y0 = coordinates(0,1);
2558 double x1 = coordinates(1,0);
2559 double y1 = coordinates(1,1);
2560 double x2 = coordinates(2,0);
2561 double y2 = coordinates(2,1);
2563 double area = CalculateVol(x0, y0,
x1, y1,
x2, y2);
2564 double inv_area = 0.0;
2571 inv_area = 1.0 / area;
2575 N[0] = CalculateVol(
x1, y1,
x2, y2,
xc,
yc) * inv_area;
2576 N[1] = CalculateVol(
x2, y2, x0, y0,
xc,
yc) * inv_area;
2577 N[2] = CalculateVol(x0, y0,
x1, y1,
xc,
yc) * inv_area;
2580 if (
N[0] >= 0.0 &&
N[1] >= 0.0 &&
N[2] >= 0.0 &&
N[0] <= 1.0 &&
N[1] <= 1.0 &&
N[2] <= 1.0)
2586 static inline double CalculateVol(
const double x0,
const double y0,
2587 const double x1,
const double y1,
2588 const double x2,
const double y2
2591 return 0.5 * ((
x1 - x0)*(y2 - y0)- (y1 - y0)*(
x2 - x0));
2594 static inline void CalculateGeometryData(
2595 const BoundedMatrix<double, 3, 3 > & coordinates,
2596 BoundedMatrix<double,3,2>& DN_DX,
2599 double x10 = coordinates(1,0) - coordinates(0,0);
2600 double y10 = coordinates(1,1) - coordinates(0,1);
2602 double x20 = coordinates(2,0) - coordinates(0,0);
2603 double y20 = coordinates(2,1) - coordinates (0,1);
2611 double detJ = x10 * y20-y10 * x20;
2613 DN_DX(0,0) = -y20 + y10;
2614 DN_DX(0,1) = x20 - x10;
2627 static void AddToEdgeAreas(array_1d<
double, (TDim-1)*3 >& edge_areas,
2628 const array_1d<double, TDim+1 >& exact_distance,
2629 const array_1d<double, TDim+1 >& indices,
2630 const double sub_volume)
2634 unsigned int ncut=0, pos=0, positive_pos=0;
2635 for(
unsigned int i=0;
i<TDim+1;
i++)
2637 if(indices[
i] > TDim) ncut++;
2638 else if(exact_distance[indices[
i]] > 0)
2640 positive_pos = indices[
i];
2645 if(ncut == TDim && pos==1)
2647 double edge_area = sub_volume*3.0/fabs(exact_distance[positive_pos]);
2648 edge_area /=
static_cast<double>(TDim);
2649 for(
unsigned int i=0;
i<TDim+1;
i++)
2651 if( indices[
i] > TDim)
2653 int edge_index = indices[
i] - TDim - 1;
2654 edge_areas[edge_index] += edge_area;
Definition: enrichment_utilities.h:43
static int CalculateEnrichedShapeFuncions(BoundedMatrix< double,(2+1), 2 > &rPoints, BoundedMatrix< double,(2+1), 2 > &DN_DX, array_1d< double,(2+1)> &rDistances, array_1d< double,(3 *(2-1))> &rVolumes, BoundedMatrix< double, 3 *(2-1),(2+1) > &rGPShapeFunctionValues, array_1d< double,(3 *(2-1))> &rPartitionsSign, std::vector< Matrix > &rGradientsValue, BoundedMatrix< double, 3 *(2-1),(2)> &NEnriched, array_1d< double,(3)> &rGPShapeFunctionValues_in_interfase, array_1d< double,(3)> &NEnriched_in_interfase, double &InterfaseArea)
Definition: enrichment_utilities.h:1641
static int CalculateEnrichedShapeFuncionsExtended(BoundedMatrix< double,(2+1), 2 > &rPoints, BoundedMatrix< double,(2+1), 2 > &DN_DX, array_1d< double,(2+1)> &rDistances, array_1d< double,(3 *(2-1))> &rVolumes, BoundedMatrix< double, 3 *(2-1),(2+1) > &rGPShapeFunctionValues, array_1d< double,(3 *(2-1))> &rPartitionsSign, std::vector< Matrix > &rGradientsValue, BoundedMatrix< double, 3 *(2-1),(4)> &NEnriched)
Definition: enrichment_utilities.h:1230
static int CalculateEnrichedShapeFuncions(BoundedMatrix< double, 3, 2 > &rPoints, BoundedMatrix< double, 3, 2 > &DN_DX, array_1d< double, 3 > &rDistances, array_1d< double, 3 > &rVolumes, BoundedMatrix< double, 3, 3 > &rGPShapeFunctionValues, array_1d< double, 3 > &rPartitionsSign, std::vector< Matrix > &rGradientsValue, BoundedMatrix< double, 3, 2 > &NEnriched)
Definition: enrichment_utilities.h:911
static int CalculateEnrichedShapeFuncionsInLocalAxis(BoundedMatrix< double,(2+1), 2 > &rOriginalPoints, BoundedMatrix< double,(2+1), 2 > &DN_DX_original, array_1d< double,(2+1)> &rDistances, array_1d< double,(3 *(2-1))> &rVolumes, BoundedMatrix< double, 3 *(2-1),(2+1) > &rGPShapeFunctionValues, array_1d< double,(3 *(2-1))> &rPartitionsSign, std::vector< Matrix > &rGradientsValue, BoundedMatrix< double, 3 *(2-1),(2)> &NEnriched, BoundedMatrix< double,(2), 2 > &rRotationMatrix, BoundedMatrix< double,(2+1), 2 > &DN_DX_in_local_axis)
Definition: enrichment_utilities.h:1999
static int CalculateTetrahedraEnrichedShapeFuncions(TMatrixType const &rPoints, TGradientType const &DN_DX, TVectorType rDistances, TVectorType &rVolumes, TMatrixType &rShapeFunctionValues, TVectorType &rPartitionsSign, std::vector< TMatrixType > &rGradientsValue, TMatrixType &NEnriched, array_1d< double, 6 > &edge_areas)
Definition: enrichment_utilities.h:69
static int CalculateEnrichedShapeFuncions(BoundedMatrix< double, 4, 3 > &rPoints, BoundedMatrix< double, 4, 3 > &DN_DX, array_1d< double, 4 > &rDistances, array_1d< double, 6 > &rVolumes, BoundedMatrix< double, 6, 4 > &rShapeFunctionValues, array_1d< double, 6 > &rPartitionsSign, std::vector< Matrix > &rGradientsValue, BoundedMatrix< double, 6, 2 > &NEnriched)
Definition: enrichment_utilities.h:500
Definition: amatrix_interface.h:41
static int Split_Tetrahedra(const int edges[6], int t[56], int *nel, int *splitted_edges, int *nint)
Function to split a tetrahedron For a given edges splitting pattern, this function computes the inter...
Definition: split_tetrahedra.h:177
static void TetrahedraGetNewConnectivityGID(const int tetra_index, const int t[56], const int aux_ids[11], int *id0, int *id1, int *id2, int *id3)
Returns the ids of a subtetra Provided the splitting connectivities array and the array containing th...
Definition: split_tetrahedra.h:150
static void TetrahedraSplitMode(int aux_ids[11], int edge_ids[6])
Returns the edges vector filled with the splitting pattern. Provided the array of nodal ids,...
Definition: split_tetrahedra.h:91
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_WATCH(variable)
Definition: define.h:806
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
AMatrix::TransposeMatrix< const T > trans(const T &TheMatrix)
Definition: amatrix_interface.h:486
TABLE_NUMBER_ANGULAR_VELOCITY TABLE_NUMBER_MOMENT I33 BEAM_INERTIA_ROT_UNIT_LENGHT_Y KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, BEAM_INERTIA_ROT_UNIT_LENGHT_Z) typedef std double
Definition: DEM_application_variables.h:182
float dist
Definition: edgebased_PureConvection.py:89
x2
Definition: generate_frictional_mortar_condition.py:122
x1
Definition: generate_frictional_mortar_condition.py:121
tuple tmp
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:98
int n_nodes
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:15
int t
Definition: ode_solve.py:392
int d
Definition: ode_solve.py:397
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
float xc
Definition: rotating_cone.py:77
float yc
Definition: rotating_cone.py:78
N
Definition: sensitivityMatrix.py:29
volume
Definition: sp_statistics.py:15
number_of_partitions
Definition: square_domain.py:61
integer i
Definition: TensorModule.f:17
integer l
Definition: TensorModule.f:17
e
Definition: run_cpp_mpi_tests.py:31