27 #include "utilities/geometry_utilities.h"
207 typename PointType::Pointer pPoint2,
208 typename PointType::Pointer pPoint3,
209 typename PointType::Pointer pPoint4,
210 typename PointType::Pointer pPoint5,
211 typename PointType::Pointer pPoint6,
212 typename PointType::Pointer pPoint7,
213 typename PointType::Pointer pPoint8 )
227 :
BaseType( ThisPoints, &msGeometryData )
237 ) :
BaseType( GeometryId, rThisPoints, &msGeometryData )
244 const std::string& rGeometryName,
246 ) :
BaseType( rGeometryName, rThisPoints, &msGeometryData)
327 template<
class TOtherPo
intType>
351 return typename BaseType::Pointer(
new Hexahedra3D8( NewGeometryId, rThisPoints ) );
365 auto p_geometry =
typename BaseType::Pointer(
new Hexahedra3D8( NewGeometryId, rGeometry.
Points() ) );
366 p_geometry->SetData(rGeometry.
GetData());
451 if ( rResult.size1() != 8 || rResult.size2() != 3 )
452 rResult.
resize( 8, 3,
false );
454 rResult( 0, 0 ) = -1.0;
455 rResult( 0, 1 ) = -1.0;
456 rResult( 0, 2 ) = -1.0;
458 rResult( 1, 0 ) = 1.0;
459 rResult( 1, 1 ) = -1.0;
460 rResult( 1, 2 ) = -1.0;
462 rResult( 2, 0 ) = 1.0;
463 rResult( 2, 1 ) = 1.0;
464 rResult( 2, 2 ) = -1.0;
466 rResult( 3, 0 ) = -1.0;
467 rResult( 3, 1 ) = 1.0;
468 rResult( 3, 2 ) = -1.0;
470 rResult( 4, 0 ) = -1.0;
471 rResult( 4, 1 ) = -1.0;
472 rResult( 4, 2 ) = 1.0;
474 rResult( 5, 0 ) = 1.0;
475 rResult( 5, 1 ) = -1.0;
476 rResult( 5, 2 ) = 1.0;
478 rResult( 6, 0 ) = 1.0;
479 rResult( 6, 1 ) = 1.0;
480 rResult( 6, 2 ) = 1.0;
482 rResult( 7, 0 ) = -1.0;
483 rResult( 7, 1 ) = 1.0;
484 rResult( 7, 2 ) = 1.0;
500 const double Tolerance = std::numeric_limits<double>::epsilon()
505 if ( std::abs( rResult[0] ) <= (1.0 + Tolerance) ) {
506 if ( std::abs( rResult[1] ) <= (1.0 + Tolerance) ) {
507 if ( std::abs( rResult[2] ) <= (1.0 + Tolerance) ) {
585 const TPointType& p0 = this->
GetPoint(0);
586 const TPointType& p1 = this->
GetPoint(1);
587 const TPointType& p2 = this->
GetPoint(2);
588 const TPointType& p3 = this->
GetPoint(3);
589 const TPointType& p4 = this->
GetPoint(4);
590 const TPointType& p5 = this->
GetPoint(5);
591 const TPointType& p6 = this->
GetPoint(6);
592 const TPointType& p7 = this->
GetPoint(7);
617 double max_edge_length = 0.0;
618 for (
const auto& r_edge: edges) {
619 max_edge_length =
std::max(max_edge_length, r_edge.Length());
621 return max_edge_length;
635 for (
const auto& r_edge: edges) {
636 min_edge_length =
std::min(min_edge_length, r_edge.Length());
638 return min_edge_length;
722 if(
IsInside(rLowPoint,local_coordinates))
735 if(rSolidAngles.size() != 8) {
736 rSolidAngles.
resize(8,
false);
739 Vector dihedral_angles(24);
742 for (
unsigned int i = 0;
i < 8; ++
i) {
743 rSolidAngles[
i] = dihedral_angles[3*
i]
744 + dihedral_angles[3*
i + 1]
745 + dihedral_angles[3*
i + 2]
758 if(rDihedralAngles.size() != 24) {
759 rDihedralAngles.
resize(24,
false);
764 const std::array<unsigned int, 8> faces_0 = {0,0,0,0,5,5,5,5};
765 const std::array<unsigned int, 8> faces_1 = {1,1,3,3,1,1,3,3};
766 const std::array<unsigned int, 8> faces_2 = {4,2,2,4,4,2,2,4};
769 double dihedral_angle_0, dihedral_angle_1, dihedral_angle_2;
770 for (
unsigned int i = 0;
i < 8; ++
i) {
771 const TPointType& r_point_i = this->
GetPoint(
i);
772 noalias(normal_0) = faces[faces_0[
i]].UnitNormal(r_point_i);
773 noalias(normal_1) = faces[faces_1[
i]].UnitNormal(r_point_i);
774 noalias(normal_2) = faces[faces_2[
i]].UnitNormal(r_point_i);
775 dihedral_angle_0 = std::acos(
inner_prod(normal_0, -normal_1));
776 dihedral_angle_1 = std::acos(
inner_prod(normal_0, -normal_2));
777 dihedral_angle_2 = std::acos(
inner_prod(normal_2, -normal_1));
778 rDihedralAngles[
i*3] = dihedral_angle_0;
779 rDihedralAngles[
i*3 + 1] = dihedral_angle_1;
780 rDihedralAngles[
i*3 + 2] = dihedral_angle_2;
792 Vector dihedral_angles(24);
794 double min_dihedral_angle = dihedral_angles[0];
795 for (
unsigned int i = 1;
i < 24;
i++) {
796 min_dihedral_angle =
std::min(dihedral_angles[
i], min_dihedral_angle);
798 return min_dihedral_angle;
809 Vector dihedral_angles(24);
811 double max_dihedral_angle = dihedral_angles[0];
812 for (
unsigned int i = 1;
i < 24;
i++) {
813 max_dihedral_angle =
std::max(dihedral_angles[
i], max_dihedral_angle);
815 return max_dihedral_angle;
831 double sum_squared_lengths = 0.0;
832 for (
const auto& r_edge : edges) {
833 const double length = r_edge.Length();
834 sum_squared_lengths += length*length;
837 const double rms_edge = std::sqrt(1.0/12.0 * sum_squared_lengths);
839 return Volume() / std::pow(rms_edge, 3.0);
857 for (
const auto& r_edge: edges) {
858 min_edge_length =
std::min(min_edge_length, r_edge.Length());
859 max_edge_length =
std::max(max_edge_length, r_edge.Length());
861 return min_edge_length / max_edge_length;
881 switch ( ShapeFunctionIndex )
884 return( 0.125*( 1.0 - rPoint[0] )*( 1.0 - rPoint[1] )*( 1.0 - rPoint[2] ) );
886 return( 0.125*( 1.0 + rPoint[0] )*( 1.0 - rPoint[1] )*( 1.0 - rPoint[2] ) );
888 return( 0.125*( 1.0 + rPoint[0] )*( 1.0 + rPoint[1] )*( 1.0 - rPoint[2] ) );
890 return( 0.125*( 1.0 - rPoint[0] )*( 1.0 + rPoint[1] )*( 1.0 - rPoint[2] ) );
892 return( 0.125*( 1.0 - rPoint[0] )*( 1.0 - rPoint[1] )*( 1.0 + rPoint[2] ) );
894 return( 0.125*( 1.0 + rPoint[0] )*( 1.0 - rPoint[1] )*( 1.0 + rPoint[2] ) );
896 return( 0.125*( 1.0 + rPoint[0] )*( 1.0 + rPoint[1] )*( 1.0 + rPoint[2] ) );
898 return( 0.125*( 1.0 - rPoint[0] )*( 1.0 + rPoint[1] )*( 1.0 + rPoint[2] ) );
900 KRATOS_ERROR <<
"Wrong index of shape function!" << *
this << std::endl;
919 if(rResult.size() != 8) rResult.
resize(8,
false);
920 rResult[0] = 0.125*( 1.0 - rCoordinates[0] )*( 1.0 - rCoordinates[1] )*( 1.0 - rCoordinates[2] ) ;
921 rResult[1] = 0.125*( 1.0 + rCoordinates[0] )*( 1.0 - rCoordinates[1] )*( 1.0 - rCoordinates[2] ) ;
922 rResult[2] = 0.125*( 1.0 + rCoordinates[0] )*( 1.0 + rCoordinates[1] )*( 1.0 - rCoordinates[2] ) ;
923 rResult[3] = 0.125*( 1.0 - rCoordinates[0] )*( 1.0 + rCoordinates[1] )*( 1.0 - rCoordinates[2] ) ;
924 rResult[4] = 0.125*( 1.0 - rCoordinates[0] )*( 1.0 - rCoordinates[1] )*( 1.0 + rCoordinates[2] ) ;
925 rResult[5] = 0.125*( 1.0 + rCoordinates[0] )*( 1.0 - rCoordinates[1] )*( 1.0 + rCoordinates[2] ) ;
926 rResult[6] = 0.125*( 1.0 + rCoordinates[0] )*( 1.0 + rCoordinates[1] )*( 1.0 + rCoordinates[2] ) ;
927 rResult[7] = 0.125*( 1.0 - rCoordinates[0] )*( 1.0 + rCoordinates[1] )*( 1.0 + rCoordinates[2] ) ;
941 if ( rResult.size1() != 8 || rResult.size2() != 3 )
942 rResult.
resize( 8, 3,
false );
944 rResult( 0, 0 ) = -0.125 * ( 1.0 - rPoint[1] ) * ( 1.0 - rPoint[2] );
945 rResult( 0, 1 ) = -0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 - rPoint[2] );
946 rResult( 0, 2 ) = -0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 - rPoint[1] );
947 rResult( 1, 0 ) = 0.125 * ( 1.0 - rPoint[1] ) * ( 1.0 - rPoint[2] );
948 rResult( 1, 1 ) = -0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 - rPoint[2] );
949 rResult( 1, 2 ) = -0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 - rPoint[1] );
950 rResult( 2, 0 ) = 0.125 * ( 1.0 + rPoint[1] ) * ( 1.0 - rPoint[2] );
951 rResult( 2, 1 ) = 0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 - rPoint[2] );
952 rResult( 2, 2 ) = -0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 + rPoint[1] );
953 rResult( 3, 0 ) = -0.125 * ( 1.0 + rPoint[1] ) * ( 1.0 - rPoint[2] );
954 rResult( 3, 1 ) = 0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 - rPoint[2] );
955 rResult( 3, 2 ) = -0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 + rPoint[1] );
956 rResult( 4, 0 ) = -0.125 * ( 1.0 - rPoint[1] ) * ( 1.0 + rPoint[2] );
957 rResult( 4, 1 ) = -0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 + rPoint[2] );
958 rResult( 4, 2 ) = 0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 - rPoint[1] );
959 rResult( 5, 0 ) = 0.125 * ( 1.0 - rPoint[1] ) * ( 1.0 + rPoint[2] );
960 rResult( 5, 1 ) = -0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 + rPoint[2] );
961 rResult( 5, 2 ) = 0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 - rPoint[1] );
962 rResult( 6, 0 ) = 0.125 * ( 1.0 + rPoint[1] ) * ( 1.0 + rPoint[2] );
963 rResult( 6, 1 ) = 0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 + rPoint[2] );
964 rResult( 6, 2 ) = 0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 + rPoint[1] );
965 rResult( 7, 0 ) = -0.125 * ( 1.0 + rPoint[1] ) * ( 1.0 + rPoint[2] );
966 rResult( 7, 1 ) = 0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 + rPoint[2] );
967 rResult( 7, 2 ) = 0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 + rPoint[1] );
983 if ( rResult.size() != this->PointsNumber() )
993 rResult[
i].
resize(3, 3,
false);
996 rResult[0]( 0, 0 ) = 0.0;
997 rResult[0]( 0, 1 ) = 0.125 * ( 1.0 - rPoint[2] );
998 rResult[0]( 0, 2 ) = 0.125 * ( 1.0 - rPoint[1] );
999 rResult[0]( 1, 0 ) = 0.125 * ( 1.0 - rPoint[2] );
1000 rResult[0]( 1, 1 ) = 0.0;
1001 rResult[0]( 1, 2 ) = 0.125 * ( 1.0 - rPoint[0] );
1002 rResult[0]( 2, 0 ) = 0.125 * ( 1.0 - rPoint[1] );
1003 rResult[0]( 2, 1 ) = 0.125 * ( 1.0 - rPoint[0] );
1004 rResult[0]( 2, 2 ) = 0.0;
1006 rResult[1]( 0, 0 ) = 0.0;
1007 rResult[1]( 0, 1 ) = -0.125 * ( 1.0 - rPoint[2] );
1008 rResult[1]( 0, 2 ) = -0.125 * ( 1.0 - rPoint[1] );
1009 rResult[1]( 1, 0 ) = -0.125 * ( 1.0 - rPoint[2] );
1010 rResult[1]( 1, 1 ) = 0.0;
1011 rResult[1]( 1, 2 ) = 0.125 * ( 1.0 + rPoint[0] );
1012 rResult[1]( 2, 0 ) = -0.125 * ( 1.0 - rPoint[1] );
1013 rResult[1]( 2, 1 ) = 0.125 * ( 1.0 + rPoint[0] );
1014 rResult[1]( 2, 2 ) = 0.0;
1016 rResult[2]( 0, 0 ) = 0.0;
1017 rResult[2]( 0, 1 ) = 0.125 * ( 1.0 - rPoint[2] );
1018 rResult[2]( 0, 2 ) = -0.125 * ( 1.0 + rPoint[1] );
1019 rResult[2]( 1, 0 ) = 0.125 * ( 1.0 - rPoint[2] );
1020 rResult[2]( 1, 1 ) = 0.0;
1021 rResult[2]( 1, 2 ) = -0.125 * ( 1.0 + rPoint[0] );
1022 rResult[2]( 2, 0 ) = -0.125 * ( 1.0 + rPoint[1] );
1023 rResult[2]( 2, 1 ) = -0.125 * ( 1.0 + rPoint[0] );
1024 rResult[2]( 2, 2 ) = 0.0;
1026 rResult[3]( 0, 0 ) = 0.0;
1027 rResult[3]( 0, 1 ) = -0.125 * ( 1.0 - rPoint[2] );
1028 rResult[3]( 0, 2 ) = 0.125 * ( 1.0 + rPoint[1] );
1029 rResult[3]( 1, 0 ) = -0.125 * ( 1.0 - rPoint[2] );
1030 rResult[3]( 1, 1 ) = 0.0;
1031 rResult[3]( 1, 2 ) = -0.125 * ( 1.0 - rPoint[0] );
1032 rResult[3]( 2, 0 ) = 0.125 * ( 1.0 + rPoint[1] );
1033 rResult[3]( 2, 1 ) = -0.125 * ( 1.0 - rPoint[0] );
1034 rResult[3]( 2, 2 ) = 0.0;
1036 rResult[4]( 0, 0 ) = 0.0;
1037 rResult[4]( 0, 1 ) = 0.125 * ( 1.0 + rPoint[2] );
1038 rResult[4]( 0, 2 ) = -0.125 * ( 1.0 - rPoint[1] );
1039 rResult[4]( 1, 0 ) = 0.125 * ( 1.0 + rPoint[2] );
1040 rResult[4]( 1, 1 ) = 0.0;
1041 rResult[4]( 1, 2 ) = -0.125 * ( 1.0 - rPoint[0] );
1042 rResult[4]( 2, 0 ) = -0.125 * ( 1.0 - rPoint[1] );
1043 rResult[4]( 2, 1 ) = -0.125 * ( 1.0 - rPoint[0] );
1044 rResult[4]( 2, 2 ) = 0.0;
1046 rResult[5]( 0, 0 ) = 0.0;
1047 rResult[5]( 0, 1 ) = -0.125 * ( 1.0 + rPoint[2] );
1048 rResult[5]( 0, 2 ) = 0.125 * ( 1.0 - rPoint[1] );
1049 rResult[5]( 1, 0 ) = -0.125 * ( 1.0 + rPoint[2] );
1050 rResult[5]( 1, 1 ) = 0.0;
1051 rResult[5]( 1, 2 ) = -0.125 * ( 1.0 + rPoint[0] );
1052 rResult[5]( 2, 0 ) = 0.125 * ( 1.0 - rPoint[1] );
1053 rResult[5]( 2, 1 ) = -0.125 * ( 1.0 + rPoint[0] );
1054 rResult[5]( 2, 2 ) = 0.0;
1056 rResult[6]( 0, 0 ) = 0.0;
1057 rResult[6]( 0, 1 ) = 0.125 * ( 1.0 + rPoint[2] );
1058 rResult[6]( 0, 2 ) = 0.125 * ( 1.0 + rPoint[1] );
1059 rResult[6]( 1, 0 ) = 0.125 * ( 1.0 + rPoint[2] );
1060 rResult[6]( 1, 1 ) = 0.0;
1061 rResult[6]( 1, 2 ) = 0.125 * ( 1.0 + rPoint[0] );
1062 rResult[6]( 2, 0 ) = 0.125 * ( 1.0 + rPoint[1] );
1063 rResult[6]( 2, 1 ) = 0.125 * ( 1.0 + rPoint[0] );
1064 rResult[6]( 2, 2 ) = 0.0;
1066 rResult[7]( 0, 0 ) = 0.0;
1067 rResult[7]( 0, 1 ) = -0.125 * ( 1.0 + rPoint[2] );
1068 rResult[7]( 0, 2 ) = -0.125 * ( 1.0 + rPoint[1] );
1069 rResult[7]( 1, 0 ) = -0.125 * ( 1.0 + rPoint[2] );
1070 rResult[7]( 1, 1 ) = 0.0;
1071 rResult[7]( 1, 2 ) = 0.125 * ( 1.0 - rPoint[0] );
1072 rResult[7]( 2, 0 ) = -0.125 * ( 1.0 + rPoint[1] );
1073 rResult[7]( 2, 1 ) = 0.125 * ( 1.0 - rPoint[0] );
1074 rResult[7]( 2, 2 ) = 0.0;
1097 const double Tolerance = std::numeric_limits<double>::epsilon()
1101 const Point point(rPointGlobalCoordinates);
1105 if (this->
IsInside(rPointGlobalCoordinates, aux_coordinates, Tolerance)) {
1110 std::array<double, 6> distances;
1117 const auto min = std::min_element(distances.begin(), distances.end());
1134 return "3 dimensional hexahedra with eight nodes in 3D space";
1146 rOStream <<
"3 dimensional hexahedra with eight nodes in 3D space";
1162 std::cout << std::endl;
1168 rOStream <<
" Jacobian in the origin\t : " << jacobian;
1194 void save(
Serializer& rSerializer )
const override
1224 result( 0, 0 ) = -0.125 * ( 1.0 - rPoint[1] ) * ( 1.0 - rPoint[2] );
1225 result( 0, 1 ) = -0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 - rPoint[2] );
1226 result( 0, 2 ) = -0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 - rPoint[1] );
1227 result( 1, 0 ) = 0.125 * ( 1.0 - rPoint[1] ) * ( 1.0 - rPoint[2] );
1228 result( 1, 1 ) = -0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 - rPoint[2] );
1229 result( 1, 2 ) = -0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 - rPoint[1] );
1230 result( 2, 0 ) = 0.125 * ( 1.0 + rPoint[1] ) * ( 1.0 - rPoint[2] );
1231 result( 2, 1 ) = 0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 - rPoint[2] );
1232 result( 2, 2 ) = -0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 + rPoint[1] );
1233 result( 3, 0 ) = -0.125 * ( 1.0 + rPoint[1] ) * ( 1.0 - rPoint[2] );
1234 result( 3, 1 ) = 0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 - rPoint[2] );
1235 result( 3, 2 ) = -0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 + rPoint[1] );
1236 result( 4, 0 ) = -0.125 * ( 1.0 - rPoint[1] ) * ( 1.0 + rPoint[2] );
1237 result( 4, 1 ) = -0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 + rPoint[2] );
1238 result( 4, 2 ) = 0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 - rPoint[1] );
1239 result( 5, 0 ) = 0.125 * ( 1.0 - rPoint[1] ) * ( 1.0 + rPoint[2] );
1240 result( 5, 1 ) = -0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 + rPoint[2] );
1241 result( 5, 2 ) = 0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 - rPoint[1] );
1242 result( 6, 0 ) = 0.125 * ( 1.0 + rPoint[1] ) * ( 1.0 + rPoint[2] );
1243 result( 6, 1 ) = 0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 + rPoint[2] );
1244 result( 6, 2 ) = 0.125 * ( 1.0 + rPoint[0] ) * ( 1.0 + rPoint[1] );
1245 result( 7, 0 ) = -0.125 * ( 1.0 + rPoint[1] ) * ( 1.0 + rPoint[2] );
1246 result( 7, 1 ) = 0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 + rPoint[2] );
1247 result( 7, 2 ) = 0.125 * ( 1.0 - rPoint[0] ) * ( 1.0 + rPoint[1] );
1263 static Matrix CalculateShapeFunctionsIntegrationPointsValues(
1270 const int integration_points_number = integration_points.size();
1272 const int points_number = 8;
1274 Matrix shape_function_values( integration_points_number, points_number );
1277 for (
int pnt = 0; pnt < integration_points_number; pnt++ )
1279 shape_function_values( pnt, 0 ) =
1280 0.125 * ( 1.0 - integration_points[pnt].X() )
1281 * ( 1.0 - integration_points[pnt].
Y() )
1282 * ( 1.0 - integration_points[pnt].
Z() );
1283 shape_function_values( pnt, 1 ) =
1284 0.125 * ( 1.0 + integration_points[pnt].X() )
1285 * ( 1.0 - integration_points[pnt].
Y() )
1286 * ( 1.0 - integration_points[pnt].
Z() );
1287 shape_function_values( pnt, 2 ) =
1288 0.125 * ( 1.0 + integration_points[pnt].X() )
1289 * ( 1.0 + integration_points[pnt].
Y() )
1290 * ( 1.0 - integration_points[pnt].
Z() );
1291 shape_function_values( pnt, 3 ) =
1292 0.125 * ( 1.0 - integration_points[pnt].X() )
1293 * ( 1.0 + integration_points[pnt].
Y() )
1294 * ( 1.0 - integration_points[pnt].
Z() );
1295 shape_function_values( pnt, 4 ) =
1296 0.125 * ( 1.0 - integration_points[pnt].X() )
1297 * ( 1.0 - integration_points[pnt].
Y() )
1298 * ( 1.0 + integration_points[pnt].
Z() );
1299 shape_function_values( pnt, 5 ) =
1300 0.125 * ( 1.0 + integration_points[pnt].X() )
1301 * ( 1.0 - integration_points[pnt].
Y() )
1302 * ( 1.0 + integration_points[pnt].
Z() );
1303 shape_function_values( pnt, 6 ) =
1304 0.125 * ( 1.0 + integration_points[pnt].X() )
1305 * ( 1.0 + integration_points[pnt].
Y() )
1306 * ( 1.0 + integration_points[pnt].
Z() );
1307 shape_function_values( pnt, 7 ) =
1308 0.125 * ( 1.0 - integration_points[pnt].X() )
1309 * ( 1.0 + integration_points[pnt].
Y() )
1310 * ( 1.0 + integration_points[pnt].
Z() );
1313 return shape_function_values;
1329 CalculateShapeFunctionsIntegrationPointsLocalGradients(
1333 AllIntegrationPoints();
1336 const int integration_points_number = integration_points.size();
1341 for (
int pnt = 0; pnt < integration_points_number; pnt++ )
1343 Matrix& result = d_shape_f_values[pnt];
1346 -0.125 * ( 1.0 - integration_points[pnt].Y() )
1347 * ( 1.0 - integration_points[pnt].
Z() );
1349 -0.125 * ( 1.0 - integration_points[pnt].X() )
1350 * ( 1.0 - integration_points[pnt].
Z() );
1352 -0.125 * ( 1.0 - integration_points[pnt].X() )
1353 * ( 1.0 - integration_points[pnt].
Y() );
1355 0.125 * ( 1.0 - integration_points[pnt].Y() )
1356 * ( 1.0 - integration_points[pnt].
Z() );
1358 -0.125 * ( 1.0 + integration_points[pnt].X() )
1359 * ( 1.0 - integration_points[pnt].
Z() );
1361 -0.125 * ( 1.0 + integration_points[pnt].X() )
1362 * ( 1.0 - integration_points[pnt].
Y() );
1364 0.125 * ( 1.0 + integration_points[pnt].Y() )
1365 * ( 1.0 - integration_points[pnt].
Z() );
1367 0.125 * ( 1.0 + integration_points[pnt].X() )
1368 * ( 1.0 - integration_points[pnt].
Z() );
1370 -0.125 * ( 1.0 + integration_points[pnt].X() )
1371 * ( 1.0 + integration_points[pnt].
Y() );
1373 -0.125 * ( 1.0 + integration_points[pnt].Y() )
1374 * ( 1.0 - integration_points[pnt].
Z() );
1376 0.125 * ( 1.0 - integration_points[pnt].X() )
1377 * ( 1.0 - integration_points[pnt].
Z() );
1379 -0.125 * ( 1.0 - integration_points[pnt].X() )
1380 * ( 1.0 + integration_points[pnt].
Y() );
1382 -0.125 * ( 1.0 - integration_points[pnt].Y() )
1383 * ( 1.0 + integration_points[pnt].
Z() );
1385 -0.125 * ( 1.0 - integration_points[pnt].X() )
1386 * ( 1.0 + integration_points[pnt].
Z() );
1388 0.125 * ( 1.0 - integration_points[pnt].X() )
1389 * ( 1.0 - integration_points[pnt].
Y() );
1391 0.125 * ( 1.0 - integration_points[pnt].Y() )
1392 * ( 1.0 + integration_points[pnt].
Z() );
1394 -0.125 * ( 1.0 + integration_points[pnt].X() )
1395 * ( 1.0 + integration_points[pnt].
Z() );
1397 0.125 * ( 1.0 + integration_points[pnt].X() )
1398 * ( 1.0 - integration_points[pnt].
Y() );
1400 0.125 * ( 1.0 + integration_points[pnt].Y() )
1401 * ( 1.0 + integration_points[pnt].
Z() );
1403 0.125 * ( 1.0 + integration_points[pnt].X() )
1404 * ( 1.0 + integration_points[pnt].
Z() );
1406 0.125 * ( 1.0 + integration_points[pnt].X() )
1407 * ( 1.0 + integration_points[pnt].
Y() );
1409 -0.125 * ( 1.0 + integration_points[pnt].Y() )
1410 * ( 1.0 + integration_points[pnt].
Z() );
1412 0.125 * ( 1.0 - integration_points[pnt].X() )
1413 * ( 1.0 + integration_points[pnt].
Z() );
1415 0.125 * ( 1.0 - integration_points[pnt].X() )
1416 * ( 1.0 + integration_points[pnt].
Y() );
1419 return d_shape_f_values;
1427 Quadrature < HexahedronGaussLegendreIntegrationPoints1, 3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1428 Quadrature < HexahedronGaussLegendreIntegrationPoints2, 3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1429 Quadrature < HexahedronGaussLegendreIntegrationPoints3, 3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1430 Quadrature < HexahedronGaussLegendreIntegrationPoints4, 3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1431 Quadrature < HexahedronGaussLegendreIntegrationPoints5, 3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1432 Quadrature < HexahedronGaussLobattoIntegrationPoints1, 3, IntegrationPoint<3> >::GenerateIntegrationPoints(),
1433 Quadrature < HexahedronGaussLobattoIntegrationPoints2, 3, IntegrationPoint<3> >::GenerateIntegrationPoints()
1436 return integration_points;
1453 return shape_functions_values;
1460 AllShapeFunctionsLocalGradients()
1474 return shape_functions_local_gradients;
1509 rOStream << std::endl;
1516 template<
class TPo
intType>
const
1517 GeometryData Hexahedra3D8<TPointType>::msGeometryData(
1520 Hexahedra3D8<TPointType>::AllIntegrationPoints(),
1521 Hexahedra3D8<TPointType>::AllShapeFunctionsValues(),
1522 AllShapeFunctionsLocalGradients()
1525 template<
class TPo
intType>
const
Definition: geometry_data.h:60
KratosGeometryType
Definition: geometry_data.h:110
IntegrationMethod
Definition: geometry_data.h:76
KratosGeometryFamily
Definition: geometry_data.h:91
Definition: geometry_dimension.h:42
Geometry base class.
Definition: geometry.h:71
SizeType PointsNumber() const
Definition: geometry.h:528
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: geometry.h:3834
Geometry & operator=(const Geometry &rOther)
Definition: geometry.h:400
std::vector< IntegrationPointType > IntegrationPointsArrayType
Definition: geometry.h:161
DataValueContainer & GetData()
Definition: geometry.h:591
std::size_t SizeType
Definition: geometry.h:144
const TPointType::Pointer pGetPoint(const int Index) const
Definition: geometry.h:1790
std::size_t IndexType
Definition: geometry.h:137
std::array< Matrix, static_cast< int >GeometryData::IntegrationMethod::NumberOfIntegrationMethods)> ShapeFunctionsValuesContainerType
Definition: geometry.h:172
Vector & DeterminantOfJacobian(Vector &rResult) const
Definition: geometry.h:3154
virtual CoordinatesArrayType & PointLocalCoordinates(CoordinatesArrayType &rResult, const CoordinatesArrayType &rPoint) const
Returns the local coordinates of a given arbitrary point.
Definition: geometry.h:1854
const PointsArrayType & Points() const
Definition: geometry.h:1768
bool AllPointsAreValid() const
Checks if the geometry points are valid Checks if the geometry points are valid from the pointer valu...
Definition: geometry.h:4093
std::array< IntegrationPointsArrayType, static_cast< int >GeometryData::IntegrationMethod::NumberOfIntegrationMethods)> IntegrationPointsContainerType
Definition: geometry.h:167
const ShapeFunctionsGradientsType & ShapeFunctionsLocalGradients() const
Definition: geometry.h:3539
JacobiansType & Jacobian(JacobiansType &rResult) const
Definition: geometry.h:2901
TPointType const & GetPoint(const int Index) const
Definition: geometry.h:1816
GeometryData::ShapeFunctionsLocalGradientsContainerType ShapeFunctionsLocalGradientsContainerType
Definition: geometry.h:177
GeometryData::IntegrationMethod IntegrationMethod
Definition: geometry.h:122
static double PointDistanceToQuadrilateral3D(const Point &rQuadrilateralPoint1, const Point &rQuadrilateralPoint2, const Point &rQuadrilateralPoint3, const Point &rQuadrilateralPoint4, const Point &rPoint)
This function calculates the distance of a 3D point to a 3D quadrilateral.
Definition: geometry_utilities.cpp:376
An eight node hexahedra geometry with linear shape functions.
Definition: hexahedra_3d_8.h:55
GeometryData::KratosGeometryFamily GetGeometryFamily() const override
Definition: hexahedra_3d_8.h:285
double MinEdgeLength() const override
Definition: hexahedra_3d_8.h:632
Line3D2< TPointType > EdgeType
Definition: hexahedra_3d_8.h:69
double ShortestToLongestEdgeQuality() const override
Calculates the shortest to longest edge quality metric. Calculates the shortest to longest edge quali...
Definition: hexahedra_3d_8.h:853
double Length() const override
Definition: hexahedra_3d_8.h:389
Matrix MatrixType
Definition: hexahedra_3d_8.h:184
Geometry< TPointType > BaseType
Definition: hexahedra_3d_8.h:64
Quadrilateral3D4< TPointType > FaceType
Definition: hexahedra_3d_8.h:70
BaseType::CoordinatesArrayType CoordinatesArrayType
Definition: hexahedra_3d_8.h:179
double Area() const override
Definition: hexahedra_3d_8.h:408
void ComputeDihedralAngles(Vector &rDihedralAngles) const override
Implements the calculus of the 24 dihedral angles of the hexa.
Definition: hexahedra_3d_8.h:756
Hexahedra3D8(Hexahedra3D8 const &rOther)
Definition: hexahedra_3d_8.h:260
Hexahedra3D8(const IndexType GeometryId, const PointsArrayType &rThisPoints)
Constructor with Geometry Id.
Definition: hexahedra_3d_8.h:234
double Volume() const override
This method calculate and return volume of this geometry.
Definition: hexahedra_3d_8.h:421
BaseType::IntegrationPointsContainerType IntegrationPointsContainerType
Definition: hexahedra_3d_8.h:134
friend class Hexahedra3D8
Definition: hexahedra_3d_8.h:1482
BaseType::ShapeFunctionsSecondDerivativesType ShapeFunctionsSecondDerivativesType
Definition: hexahedra_3d_8.h:169
BaseType::NormalType NormalType
Definition: hexahedra_3d_8.h:174
void PrintInfo(std::ostream &rOStream) const override
Definition: hexahedra_3d_8.h:1144
BaseType::ShapeFunctionsValuesContainerType ShapeFunctionsValuesContainerType
Definition: hexahedra_3d_8.h:141
Hexahedra3D8(const PointType &Point1, const PointType &Point2, const PointType &Point3, const PointType &Point4, const PointType &Point5, const PointType &Point6, const PointType &Point7, const PointType &Point8)
Definition: hexahedra_3d_8.h:190
double MaxDihedralAngle() const override
Calculates the max dihedral angle quality metric.
Definition: hexahedra_3d_8.h:808
TPointType PointType
Definition: hexahedra_3d_8.h:91
BaseType::JacobiansType JacobiansType
Definition: hexahedra_3d_8.h:155
double MinDihedralAngle() const override
Calculates the min dihedral angle quality metric.
Definition: hexahedra_3d_8.h:791
double VolumeToRMSEdgeLength() const override
Calculates the volume to average edge length quality metric.
Definition: hexahedra_3d_8.h:829
Hexahedra3D8(Hexahedra3D8< TOtherPointType > const &rOther)
Definition: hexahedra_3d_8.h:277
double AverageEdgeLength() const override
Definition: hexahedra_3d_8.h:583
BaseType::Pointer Create(const IndexType NewGeometryId, PointsArrayType const &rThisPoints) const override
Creates a new geometry pointer.
Definition: hexahedra_3d_8.h:346
BaseType::IntegrationPointType IntegrationPointType
Definition: hexahedra_3d_8.h:119
BaseType::SizeType SizeType
Definition: hexahedra_3d_8.h:106
BaseType::IntegrationPointsArrayType IntegrationPointsArrayType
Definition: hexahedra_3d_8.h:127
BaseType::Pointer Create(const IndexType NewGeometryId, const BaseType &rGeometry) const override
Creates a new geometry pointer.
Definition: hexahedra_3d_8.h:360
ShapeFunctionsSecondDerivativesType & ShapeFunctionsSecondDerivatives(ShapeFunctionsSecondDerivativesType &rResult, const CoordinatesArrayType &rPoint) const override
Definition: hexahedra_3d_8.h:981
BaseType::ShapeFunctionsLocalGradientsContainerType ShapeFunctionsLocalGradientsContainerType
Definition: hexahedra_3d_8.h:148
Vector & ShapeFunctionsValues(Vector &rResult, const CoordinatesArrayType &rCoordinates) const override
Definition: hexahedra_3d_8.h:917
Hexahedra3D8(typename PointType::Pointer pPoint1, typename PointType::Pointer pPoint2, typename PointType::Pointer pPoint3, typename PointType::Pointer pPoint4, typename PointType::Pointer pPoint5, typename PointType::Pointer pPoint6, typename PointType::Pointer pPoint7, typename PointType::Pointer pPoint8)
Definition: hexahedra_3d_8.h:206
Matrix & ShapeFunctionsLocalGradients(Matrix &rResult, const CoordinatesArrayType &rPoint) const override
Definition: hexahedra_3d_8.h:939
BaseType::PointsArrayType PointsArrayType
Definition: hexahedra_3d_8.h:112
bool IsInside(const CoordinatesArrayType &rPoint, CoordinatesArrayType &rResult, const double Tolerance=std::numeric_limits< double >::epsilon()) const override
Returns whether given arbitrary point is inside the Geometry and the respective local point for the g...
Definition: hexahedra_3d_8.h:497
double DomainSize() const override
Definition: hexahedra_3d_8.h:439
GeometriesArrayType GenerateFaces() const override
Returns all faces of the current geometry.
Definition: hexahedra_3d_8.h:665
double MaxEdgeLength() const override
Definition: hexahedra_3d_8.h:615
Hexahedra3D8(const PointsArrayType &ThisPoints)
Definition: hexahedra_3d_8.h:226
Hexahedra3D8 & operator=(Hexahedra3D8< TOtherPointType > const &rOther)
Definition: hexahedra_3d_8.h:328
GeometryData::IntegrationMethod IntegrationMethod
Definition: hexahedra_3d_8.h:80
std::string Info() const override
Definition: hexahedra_3d_8.h:1132
BaseType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: hexahedra_3d_8.h:162
SizeType FacesNumber() const override
Returns the number of faces of the current geometry.
Definition: hexahedra_3d_8.h:652
void ComputeSolidAngles(Vector &rSolidAngles) const override
Implements the calculus of the 8 solid angles of the hexa.
Definition: hexahedra_3d_8.h:733
bool HasIntersection(const Point &rLowPoint, const Point &rHighPoint) const override
Definition: hexahedra_3d_8.h:703
GeometryData::KratosGeometryType GetGeometryType() const override
Definition: hexahedra_3d_8.h:290
void PrintData(std::ostream &rOStream) const override
Definition: hexahedra_3d_8.h:1158
GeometriesArrayType GenerateEdges() const override
Definition: hexahedra_3d_8.h:535
Matrix & PointsLocalCoordinates(Matrix &rResult) const override
Definition: hexahedra_3d_8.h:449
SizeType EdgesNumber() const override
Definition: hexahedra_3d_8.h:524
Hexahedra3D8(const std::string &rGeometryName, const PointsArrayType &rThisPoints)
Constructor with Geometry Name.
Definition: hexahedra_3d_8.h:243
~Hexahedra3D8() override
Destructor. Does nothing!!!
Definition: hexahedra_3d_8.h:283
Hexahedra3D8 & operator=(const Hexahedra3D8 &rOther)
Definition: hexahedra_3d_8.h:310
BaseType::GeometriesArrayType GeometriesArrayType
Definition: hexahedra_3d_8.h:86
KRATOS_CLASS_POINTER_DEFINITION(Hexahedra3D8)
double CalculateDistance(const CoordinatesArrayType &rPointGlobalCoordinates, const double Tolerance=std::numeric_limits< double >::epsilon()) const override
Computes the distance between an point in global coordinates and the closest point of this geometry....
Definition: hexahedra_3d_8.h:1095
BaseType::IndexType IndexType
Definition: hexahedra_3d_8.h:98
double ShapeFunctionValue(IndexType ShapeFunctionIndex, const CoordinatesArrayType &rPoint) const override
Definition: hexahedra_3d_8.h:878
Short class definition.
Definition: integration_point.h:52
static double ComputeVolume3DGeometry(const Geometry< TPointType > &rGeometry)
This method calculates and returns the volume of the geometry from a 3D geometry.
Definition: integration_utilities.h:168
Definition: amatrix_interface.h:41
void swap(Matrix &Other)
Definition: amatrix_interface.h:289
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
An two node 3D line geometry with linear shape functions.
Definition: line_3d_2.h:64
Various mathematical utilitiy functions.
Definition: math_utils.h:62
This class defines the node.
Definition: node.h:65
Point class.
Definition: point.h:59
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
void push_back(const TPointerType &x)
Definition: pointer_vector.h:270
A four node 3D quadrilateral geometry with bi-linear shape functions.
Definition: quadrilateral_3d_4.h:76
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Short class definition.
Definition: array_1d.h:61
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
static double max(double a, double b)
Definition: GeometryFunctions.h:79
static double min(double a, double b)
Definition: GeometryFunctions.h:71
constexpr double Pi
Definition: global_variables.h:25
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
const GeometryData BrepCurve< TContainerPointType, TContainerPointEmbeddedType >::msGeometryData & msGeometryDimension
Definition: brep_curve.h:483
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
const GeometryData Hexahedra3D8< TPointType >::msGeometryData & msGeometryDimension(), Hexahedra3D8< TPointType >::AllShapeFunctionsValues(), AllShapeFunctionsLocalGradients()
Definition: brep_curve.h:483
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
def load(f)
Definition: ode_solve.py:307
float temp
Definition: rotating_cone.py:85
integer i
Definition: TensorModule.f:17