program main !*****************************************************************************80 ! !! fem3d_pack_test() tests fem3d_pack(). ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 02 March 2010 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) call timestamp ( ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'fem3d_pack_test():' write ( *, '(a)' ) ' FORTRAN90 version' write ( *, '(a)' ) ' Test fem3d_pack().' call basis_mn_tet4_test ( ) call basis_mn_tet10_test ( ) call basis_brick8_test ( ) call basis_brick20_test ( ) call basis_brick27_test ( ) call test03 ( ) ! ! Terminate. ! write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'fem3d_pack_test():' write ( *, '(a)' ) ' Normal end of execution.' write ( *, '(a)' ) ' ' call timestamp ( ) stop 0 end subroutine test03 ( ) !*****************************************************************************80 ! !! TEST03 tests PHYSICAL_TO_REFERENCE_TET4 and REFERENCE_TO_PHYSICAL_TET4. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 10 August 2009 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer, parameter :: n = 10 integer j real ( kind = rk ) phy(3,n) real ( kind = rk ) ref(3,n) real ( kind = rk ) ref2(3,n) real ( kind = rk ), dimension(3,4) :: t = reshape ( (/ & 1.0D+00, 2.0D+00, 3.0D+00, & 4.0D+00, 1.0D+00, 2.0D+00, & 2.0D+00, 4.0D+00, 4.0D+00, & 3.0D+00, 2.0D+00, 5.0D+00 /), (/ 3, 4 /) ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST03' write ( *, '(a)' ) ' For an order 4 tetrahedron,' write ( *, '(a)' ) ' PHYSICAL_TO_REFERENCE_TET4 maps a physical point to' write ( *, '(a)' ) ' a reference point.' write ( *, '(a)' ) ' REFERENCE_TO_PHYSICAL_TET4 maps a reference point to' write ( *, '(a)' ) ' a physical point.' write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' ( R S T ) ==> ( X Y Z ) ' // & '==> ( R2 S2 T2 )' write ( *, '(a)' ) ' ' call reference_tet4_uniform ( n, ref ) call reference_to_physical_tet4 ( t, n, ref, phy ) call physical_to_reference_tet4 ( t, n, phy, ref2 ) do j = 1, n write ( *, '(2x,3f8.4,2x,3f8.4,2x,3f8.4)' ) & ref(1:3,j), phy(1:3,j), ref2(1:3,j) end do return end subroutine timestamp ( ) !*****************************************************************************80 ! !! timestamp() prints the current YMDHMS date as a time stamp. ! ! Example: ! ! 31 May 2001 9:45:54.872 AM ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 06 August 2005 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! None ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) character ( len = 8 ) ampm integer d integer h integer m integer mm character ( len = 9 ), parameter, dimension(12) :: month = (/ & 'January ', 'February ', 'March ', 'April ', & 'May ', 'June ', 'July ', 'August ', & 'September', 'October ', 'November ', 'December ' /) integer n integer s integer values(8) integer y call date_and_time ( values = values ) y = values(1) m = values(2) d = values(3) h = values(5) n = values(6) s = values(7) mm = values(8) if ( h < 12 ) then ampm = 'AM' else if ( h == 12 ) then if ( n == 0 .and. s == 0 ) then ampm = 'Noon' else ampm = 'PM' end if else h = h - 12 if ( h < 12 ) then ampm = 'PM' else if ( h == 12 ) then if ( n == 0 .and. s == 0 ) then ampm = 'Midnight' else ampm = 'AM' end if end if end if write ( *, '(i2,1x,a,1x,i4,2x,i2,a1,i2.2,a1,i2.2,a1,i3.3,1x,a)' ) & d, trim ( month(m) ), y, h, ':', n, ':', s, '.', mm, trim ( ampm ) return end