This commit is contained in:
@@ -22,9 +22,11 @@ contains
|
||||
integer :: nen
|
||||
integer :: face_nodes(MAX_FACE_NODES)
|
||||
integer :: edge_nodes(MAX_FACE_NODES)
|
||||
character(len=16) :: canonical
|
||||
|
||||
if (element_num_nodes('C3D4') .ne. 4) stop 1
|
||||
if (element_num_nodes('C3D8') .ne. 8) stop 2
|
||||
if (element_num_nodes('C3D8R') .ne. 8) stop 108
|
||||
if (element_num_nodes('C3D10') .ne. 10) stop 3
|
||||
if (element_num_nodes('C3D20') .ne. 20) stop 4
|
||||
if (element_num_nodes('S3') .ne. 3) stop 5
|
||||
@@ -34,37 +36,59 @@ contains
|
||||
if (element_num_nodes('UNKNOWN') .ne. 0) stop 9
|
||||
|
||||
if (.not. element_is_solid('C3D20')) stop 10
|
||||
if (.not. element_is_solid('c3d8r')) stop 109
|
||||
if (.not. element_is_shell('S8')) stop 11
|
||||
if (element_is_supported('B31')) stop 12
|
||||
if (.not. element_is_shell(' s4 ')) stop 90
|
||||
if (element_num_nodes('c3d20') .ne. 20) stop 91
|
||||
call element_canonical_name(' c3d8 ', canonical, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) stop 92
|
||||
if (trim(canonical) .ne. 'C3D8') stop 93
|
||||
call element_canonical_name('C3D8R', canonical, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) stop 94
|
||||
if (trim(canonical) .ne. 'C3D8R') stop 95
|
||||
if (element_num_nodes('S4R') .ne. 4) stop 96
|
||||
if (.not. element_is_shell('s4r')) stop 97
|
||||
call element_canonical_name(' s4r ', canonical, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) stop 98
|
||||
if (trim(canonical) .ne. 'S4R') stop 99
|
||||
|
||||
if (element_num_faces('C3D4') .ne. 4) stop 13
|
||||
if (element_num_faces('C3D8') .ne. 6) stop 14
|
||||
if (element_num_faces('C3D8R') .ne. 6) stop 110
|
||||
if (element_num_faces('C3D10') .ne. 4) stop 15
|
||||
if (element_num_faces('C3D20') .ne. 6) stop 16
|
||||
if (element_num_faces('S4') .ne. 1) stop 17
|
||||
if (element_num_faces('S4R') .ne. 1) stop 36
|
||||
|
||||
if (element_num_edges('C3D4') .ne. 6) stop 71
|
||||
if (element_num_edges('C3D8') .ne. 12) stop 72
|
||||
if (element_num_edges('C3D8R') .ne. 12) stop 111
|
||||
if (element_num_edges('C3D10') .ne. 6) stop 73
|
||||
if (element_num_edges('C3D20') .ne. 12) stop 74
|
||||
if (element_num_edges('S3') .ne. 3) stop 75
|
||||
if (element_num_edges('S4') .ne. 4) stop 76
|
||||
if (element_num_edges('S6') .ne. 3) stop 77
|
||||
if (element_num_edges('S8') .ne. 4) stop 78
|
||||
if (element_num_edges('S4R') .ne. 4) stop 106
|
||||
|
||||
if (element_num_integration_points('C3D4') .ne. 1) stop 18
|
||||
if (element_num_integration_points('C3D8') .ne. 8) stop 19
|
||||
if (element_num_integration_points('C3D8R') .ne. 1) stop 112
|
||||
if (element_num_integration_points('C3D10') .ne. 4) stop 20
|
||||
if (element_num_integration_points('C3D20') .ne. 27) stop 21
|
||||
if (element_num_integration_points('S3') .ne. 1) stop 22
|
||||
if (element_num_integration_points('S4') .ne. 4) stop 23
|
||||
if (element_num_integration_points('S6') .ne. 3) stop 24
|
||||
if (element_num_integration_points('S8') .ne. 9) stop 25
|
||||
if (element_num_integration_points('S4R') .ne. 1) stop 107
|
||||
|
||||
call element_validate_node_count('C3D8', 8, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) stop 26
|
||||
call element_validate_node_count('C3D8', 4, ierr)
|
||||
if (ierr .eq. FEM_SUCCESS) stop 27
|
||||
call element_validate_node_count('C3D8R', 8, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) stop 113
|
||||
|
||||
call element_face_nodes('C3D20', 6, nfn, face_nodes, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) stop 28
|
||||
@@ -89,23 +113,69 @@ contains
|
||||
if (edge_nodes(2) .ne. 8) stop 83
|
||||
if (edge_nodes(3) .ne. 20) stop 84
|
||||
|
||||
call element_face_nodes('C3D8R', 6, nfn, face_nodes, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) stop 114
|
||||
if (nfn .ne. 4) stop 115
|
||||
if (face_nodes(1) .ne. 4 .or. face_nodes(4) .ne. 8) stop 116
|
||||
call element_edge_nodes('C3D8R', 12, nen, edge_nodes, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) stop 117
|
||||
if (nen .ne. 2) stop 118
|
||||
if (edge_nodes(1) .ne. 4 .or. edge_nodes(2) .ne. 8) stop 119
|
||||
|
||||
call element_edge_nodes('S8', 4, nen, edge_nodes, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) stop 85
|
||||
if (nen .ne. 3) stop 86
|
||||
if (edge_nodes(1) .ne. 4) stop 87
|
||||
if (edge_nodes(2) .ne. 1) stop 88
|
||||
if (edge_nodes(3) .ne. 8) stop 89
|
||||
|
||||
call element_face_nodes('S4R', 1, nfn, face_nodes, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) stop 100
|
||||
if (nfn .ne. 4) stop 101
|
||||
if (face_nodes(4) .ne. 4) stop 102
|
||||
call element_edge_nodes('S4R', 4, nen, edge_nodes, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) stop 103
|
||||
if (nen .ne. 2) stop 104
|
||||
if (edge_nodes(1) .ne. 4 .or. edge_nodes(2) .ne. 1) stop 105
|
||||
end subroutine test_topology
|
||||
|
||||
subroutine test_quadrature()
|
||||
call check_rule('C3D4', 1, ONE / 6.0_rk, 101)
|
||||
call check_rule('C3D8', 8, 8.0_rk, 110)
|
||||
call check_rule('C3D8R', 1, 8.0_rk, 115)
|
||||
call check_rule('C3D10', 4, ONE / 6.0_rk, 120)
|
||||
call check_rule('C3D20', 27, 8.0_rk, 130)
|
||||
call check_rule('S3', 1, HALF, 140)
|
||||
call check_rule('S4', 4, 4.0_rk, 150)
|
||||
call check_rule('S4R', 1, 4.0_rk, 155)
|
||||
call check_rule('S6', 3, HALF, 160)
|
||||
call check_rule('S8', 9, 4.0_rk, 170)
|
||||
call check_descriptor('C3D8', QUAD_FAMILY_GAUSS_LEGENDRE, &
|
||||
QUAD_DOMAIN_HEXAHEDRON, 2, 8, 180)
|
||||
call check_descriptor('C3D8R', QUAD_FAMILY_GAUSS_LEGENDRE, &
|
||||
QUAD_DOMAIN_HEXAHEDRON, 1, 1, 400)
|
||||
call check_descriptor('S4', QUAD_FAMILY_GAUSS_LEGENDRE, &
|
||||
QUAD_DOMAIN_QUADRILATERAL, 2, 4, 190)
|
||||
call check_descriptor('S4R', QUAD_FAMILY_GAUSS_LEGENDRE, &
|
||||
QUAD_DOMAIN_QUADRILATERAL, 1, 1, 200)
|
||||
call check_descriptor('C3D10', QUAD_FAMILY_SIMPLEX_SYMMETRIC, &
|
||||
QUAD_DOMAIN_TETRAHEDRON, 4, 4, 210)
|
||||
call check_tensor_rule(QUAD_FAMILY_GAUSS_LOBATTO, &
|
||||
QUAD_DOMAIN_QUADRILATERAL, 2, 4, 4.0_rk, 2, 220)
|
||||
call check_tensor_rule(QUAD_FAMILY_GAUSS_LOBATTO, &
|
||||
QUAD_DOMAIN_QUADRILATERAL, 3, 9, 4.0_rk, 2, 230)
|
||||
call check_tensor_rule(QUAD_FAMILY_GAUSS_LOBATTO, &
|
||||
QUAD_DOMAIN_HEXAHEDRON, 2, 8, 8.0_rk, 3, 240)
|
||||
call check_tensor_rule(QUAD_FAMILY_GAUSS_LOBATTO, &
|
||||
QUAD_DOMAIN_HEXAHEDRON, 3, 27, 8.0_rk, 3, 250)
|
||||
call check_tensor_rule(QUAD_FAMILY_NEWTON_COTES_CLOSED, &
|
||||
QUAD_DOMAIN_QUADRILATERAL, 2, 4, 4.0_rk, 2, 260)
|
||||
call check_tensor_rule(QUAD_FAMILY_NEWTON_COTES_CLOSED, &
|
||||
QUAD_DOMAIN_QUADRILATERAL, 3, 9, 4.0_rk, 2, 270)
|
||||
call check_tensor_rule(QUAD_FAMILY_NEWTON_COTES_CLOSED, &
|
||||
QUAD_DOMAIN_HEXAHEDRON, 2, 8, 8.0_rk, 3, 280)
|
||||
call check_tensor_rule(QUAD_FAMILY_NEWTON_COTES_CLOSED, &
|
||||
QUAD_DOMAIN_HEXAHEDRON, 3, 27, 8.0_rk, 3, 290)
|
||||
end subroutine test_quadrature
|
||||
|
||||
subroutine check_rule(etype, expected_points, expected_weight, stop_base)
|
||||
@@ -128,13 +198,82 @@ contains
|
||||
if (abs(sum(weight(1:npoint)) - expected_weight) .gt. TOL) call fail(stop_base + 4)
|
||||
end subroutine check_rule
|
||||
|
||||
subroutine check_descriptor(etype, expected_family, expected_domain, &
|
||||
expected_order, expected_points, stop_base)
|
||||
character(len=*), intent(in) :: etype
|
||||
integer, intent(in) :: expected_family
|
||||
integer, intent(in) :: expected_domain
|
||||
integer, intent(in) :: expected_order
|
||||
integer, intent(in) :: expected_points
|
||||
integer, intent(in) :: stop_base
|
||||
integer :: ierr
|
||||
integer :: family
|
||||
integer :: domain
|
||||
integer :: order
|
||||
integer :: npoint
|
||||
integer :: direct_npoint
|
||||
real(rk) :: xi(NDIM,32)
|
||||
real(rk) :: weight(32)
|
||||
real(rk) :: direct_xi(NDIM,32)
|
||||
real(rk) :: direct_weight(32)
|
||||
|
||||
call quadrature_get_descriptor(etype, family, domain, order, npoint, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(stop_base)
|
||||
if (family .ne. expected_family) call fail(stop_base + 1)
|
||||
if (domain .ne. expected_domain) call fail(stop_base + 2)
|
||||
if (order .ne. expected_order) call fail(stop_base + 3)
|
||||
if (npoint .ne. expected_points) call fail(stop_base + 4)
|
||||
|
||||
call quadrature_get_rule(etype, 32, npoint, xi, weight, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(stop_base + 5)
|
||||
call quadrature_get_desc_rule(family, domain, order, 32, &
|
||||
direct_npoint, direct_xi, direct_weight, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(stop_base + 6)
|
||||
if (direct_npoint .ne. npoint) call fail(stop_base + 7)
|
||||
if (maxval(abs(direct_xi(:,1:npoint) - xi(:,1:npoint))) .gt. TOL) &
|
||||
call fail(stop_base + 8)
|
||||
if (maxval(abs(direct_weight(1:npoint) - weight(1:npoint))) .gt. TOL) &
|
||||
call fail(stop_base + 9)
|
||||
end subroutine check_descriptor
|
||||
|
||||
subroutine check_tensor_rule(family, domain, order, expected_points, &
|
||||
expected_weight, ndim_used, stop_base)
|
||||
integer, intent(in) :: family
|
||||
integer, intent(in) :: domain
|
||||
integer, intent(in) :: order
|
||||
integer, intent(in) :: expected_points
|
||||
real(rk), intent(in) :: expected_weight
|
||||
integer, intent(in) :: ndim_used
|
||||
integer, intent(in) :: stop_base
|
||||
integer :: ierr
|
||||
integer :: npoint
|
||||
integer :: dim
|
||||
real(rk) :: xi(NDIM,32)
|
||||
real(rk) :: weight(32)
|
||||
|
||||
call quadrature_get_desc_rule(family, domain, order, 32, npoint, xi, weight, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(stop_base)
|
||||
if (npoint .ne. expected_points) call fail(stop_base + 1)
|
||||
if (abs(sum(weight(1:npoint)) - expected_weight) .gt. TOL) &
|
||||
call fail(stop_base + 2)
|
||||
do dim = 1, ndim_used
|
||||
if (abs(sum(xi(dim,1:npoint))) .gt. TOL) call fail(stop_base + 3)
|
||||
end do
|
||||
if (ndim_used .lt. NDIM) then
|
||||
if (maxval(abs(xi(ndim_used+1:NDIM,1:npoint))) .gt. TOL) &
|
||||
call fail(stop_base + 4)
|
||||
end if
|
||||
end subroutine check_tensor_rule
|
||||
|
||||
subroutine test_shapes()
|
||||
call check_shape('C3D4', 4, 201)
|
||||
call check_shape('C3D8', 8, 220)
|
||||
call check_shape('C3D8R', 8, 230)
|
||||
call check_shape('C3D10', 10, 240)
|
||||
call check_shape('C3D20', 20, 260)
|
||||
call check_shape('S3', 3, 300)
|
||||
call check_shape('S4', 4, 320)
|
||||
call check_shape('S4R', 4, 330)
|
||||
call check_shape('S6', 6, 340)
|
||||
call check_shape('S8', 8, 360)
|
||||
end subroutine test_shapes
|
||||
@@ -178,7 +317,8 @@ contains
|
||||
natural = (/ 0.20_rk, 0.30_rk, ZERO /)
|
||||
case default
|
||||
natural = (/ 0.20_rk, -0.30_rk, 0.40_rk /)
|
||||
if (trim(etype) .eq. 'S4' .or. trim(etype) .eq. 'S8') natural(3) = ZERO
|
||||
if (trim(etype) .eq. 'S4' .or. trim(etype) .eq. 'S4R' .or. &
|
||||
trim(etype) .eq. 'S8') natural(3) = ZERO
|
||||
end select
|
||||
end subroutine sample_natural
|
||||
|
||||
@@ -193,7 +333,7 @@ contains
|
||||
node_nat(:,2) = (/ ONE, ZERO, ZERO /)
|
||||
node_nat(:,3) = (/ ZERO, ONE, ZERO /)
|
||||
node_nat(:,4) = (/ ZERO, ZERO, ONE /)
|
||||
case ('C3D8')
|
||||
case ('C3D8', 'C3D8R')
|
||||
call fill_hex8_nodes(node_nat)
|
||||
case ('C3D10')
|
||||
node_nat(:,1) = (/ ZERO, ZERO, ZERO /)
|
||||
@@ -212,7 +352,7 @@ contains
|
||||
node_nat(:,1) = (/ ZERO, ZERO, ZERO /)
|
||||
node_nat(:,2) = (/ ONE, ZERO, ZERO /)
|
||||
node_nat(:,3) = (/ ZERO, ONE, ZERO /)
|
||||
case ('S4')
|
||||
case ('S4', 'S4R')
|
||||
node_nat(:,1) = (/ -ONE, -ONE, ZERO /)
|
||||
node_nat(:,2) = (/ ONE, -ONE, ZERO /)
|
||||
node_nat(:,3) = (/ ONE, ONE, ZERO /)
|
||||
|
||||
Reference in New Issue
Block a user