      subroutine gtminv( rminv )
c---------------------------------------------------------------------
c this routine returns the inverse of the local mass matrix, 
c     minv = Inverse[ Integrate[ N_a * N_b ] ].
c
c---------------------------------------------------------------------
      include "common.h"
      
      dimension rminv(nshape,nshape)
c
c.... mass matrix inverse for quadratic tets
c
      if (nshape == 10) then 
         rminv(1,1) = 600.00000000000d0
         rminv(1,2) = 60.000000000000d0
         rminv(1,3) = 60.000000000000d0
         rminv(1,4) = 60.000000000000d0
         rminv(1,5) = 630.00000000000d0
         rminv(1,6) = 0.0d0
         rminv(1,7) = 630.00000000000d0
         rminv(1,8) = 630.00000000000d0
         rminv(1,9) = 0.0d0
         rminv(1,10) = 0.0d0
         rminv(2,1) = 60.000000000000d0
         rminv(2,2) = 600.00000000000d0
         rminv(2,3) = 60.000000000000d0
         rminv(2,4) = 60.000000000000d0
         rminv(2,5) = 630.00000000000d0
         rminv(2,6) = 630.00000000000d0
         rminv(2,7) = 0.d0
         rminv(2,8) = 0.d0
         rminv(2,9) = 630.000000000000d0
         rminv(2,10) = 0.0d0
         rminv(3,1) = 60.000000000000d0
         rminv(3,2) = 60.000000000000d0
         rminv(3,3) = 600.000000000000d0
         rminv(3,4) = 60.000000000000d0
         rminv(3,5) = 0.0d0
         rminv(3,6) = 630.00000000000d0
         rminv(3,7) = 630.00000000000d0
         rminv(3,8) = 0.0d0
         rminv(3,9) = 0.0d0
         rminv(3,10) = 630.00000000000d0
         rminv(4,1) = 60.000000000000d0
         rminv(4,2) = 60.000000000000d0
         rminv(4,3) = 60.000000000000d0
         rminv(4,4) = 600.00000000000d0
         rminv(4,5) = 0.d0
         rminv(4,6) = 0.d0
         rminv(4,7) = 0.d0
         rminv(4,8) = 630.000000000000d0
         rminv(4,9) = 630.00000000000d0
         rminv(4,10) = 630.00000000000d0
         rminv(5,1) = 630.00000000000d0
         rminv(5,2) = 630.00000000000d0
         rminv(5,3) = 0.0d0
         rminv(5,4) = 0.0d0
         rminv(5,5) = 1890.00000000000d0
         rminv(5,6) = 315.00000000000d0
         rminv(5,7) = 315.00000000000d0
         rminv(5,8) = 315.00000000000d0
         rminv(5,9) = 315.00000000000d0
         rminv(5,10) = 0.0d0
         rminv(6,1) = 0.0d0
         rminv(6,2) = 630.000000000000d0
         rminv(6,3) = 630.000000000000d0
         rminv(6,4) = 0.0d0
         rminv(6,5) = 315.00000000000d0
         rminv(6,6) = 1890.0d0
         rminv(6,7) = 315.00000000000d0
         rminv(6,8) = 0.0d0
         rminv(6,9) = 315.000000000000d0
         rminv(6,10) = 315.000000000000d0
         rminv(7,1) = 630.000000000000d0
         rminv(7,2) = 0.0d0
         rminv(7,3) = 630.00000000000d0
         rminv(7,4) = 0.0d0
         rminv(7,5) = 315.00000000000d0
         rminv(7,6) = 315.00000000000d0
         rminv(7,7) = 1890.0000000000d0
         rminv(7,8) = 315.00000000000d0
         rminv(7,9) = 0.0d0
         rminv(7,10) = 315.00000000000d0
         rminv(8,1) = 630.00000000000d0
         rminv(8,2) = 0.0d0
         rminv(8,3) = 0.0d0
         rminv(8,4) = 630.000000000000d0
         rminv(8,5) = 315.00000000000d0
         rminv(8,6) = 0.0d0
         rminv(8,7) = 315.00000000000d0
         rminv(8,8) = 1890.0000000000d0
         rminv(8,9) = 315.00000000000d0
         rminv(8,10) = 315.00000000000d0
         rminv(9,1) = 0.0d0
         rminv(9,2) = 630.000000000000d0
         rminv(9,3) = 0.0d0
         rminv(9,4) = 630.00000000000d0
         rminv(9,5) = 315.00000000000d0
         rminv(9,6) = 315.00000000000d0
         rminv(9,7) = 0.0d0
         rminv(9,8) = 315.00000000000d0
         rminv(9,9) = 1890.00000000000d0
         rminv(9,10) = 315.00000000000d0
         rminv(10,1) = 0.0d0
         rminv(10,2) = 0.0d0
         rminv(10,3) = 630.00000000000d0
         rminv(10,4) = 630.00000000000d0
         rminv(10,5) = 0.0d0
         rminv(10,6) = 315.00000000000d0
         rminv(10,7) = 315.00000000000d0
         rminv(10,8) = 315.00000000000d0
         rminv(10,9) = 315.00000000000d0
         rminv(10,10) = 1890.0000000000d0
      else if (nshape == 20) then
c
c.... cubic tets
c
         rminv(1,1) = 2400.d0
         rminv(1,2) = -120.d0
         rminv(1,3) = -120.d0
         rminv(1,4) = -120.d0
         rminv(1,5) = 2520.d0
         rminv(1,6) = -2520.d0
         rminv(1,7) = 0.d0
         rminv(1,8) = 0.d0
         rminv(1,9) = 2520.d0
         rminv(1,10) = 2520.d0
         rminv(1,11) = 2520.d0
         rminv(1,12) = -2520.d0
         rminv(1,13) = 0.d0
         rminv(1,14) = 0.d0
         rminv(1,15) = 0.d0
         rminv(1,16) = 0.d0
         rminv(1,17) = 10080.d0
         rminv(1,18) = 10080.d0
         rminv(1,19) = 0.d0
         rminv(1,20) = 10080.d0
         rminv(2,1) = -120.d0
         rminv(2,2) = 2400.d0
         rminv(2,3) = -120.d0
         rminv(2,4) = -120.d0
         rminv(2,5) = 2520.d0
         rminv(2,6) = 2520.d0
         rminv(2,7) = 2520.d0
         rminv(2,8) = -2520.d0
         rminv(2,9) = 0.d0
         rminv(2,10) = 0.d0
         rminv(2,11) = 0.d0
         rminv(2,12) = 0.d0
         rminv(2,13) = 2520.d0
         rminv(2,14) = -2520.d0
         rminv(2,15) = 0.d0
         rminv(2,16) = 0.d0
         rminv(2,17) = 10080.d0
         rminv(2,18) = 10080.d0
         rminv(2,19) = 10080.d0
         rminv(2,20) = 0.d0
         rminv(3,1) = -120.d0
         rminv(3,2) = -120.d0
         rminv(3,3) = 2400.d0
         rminv(3,4) = -120.d0
         rminv(3,5) = 0.d0
         rminv(3,6) = 0.d0
         rminv(3,7) = 2520.d0
         rminv(3,8) = 2520.d0
         rminv(3,9) = 2520.d0
         rminv(3,10) = -2520.d0
         rminv(3,11) = 0.d0
         rminv(3,12) = 0.d0
         rminv(3,13) = 0.d0
         rminv(3,14) = 0.d0
         rminv(3,15) = 2520.d0
         rminv(3,16) = -2520.d0
         rminv(3,17) = 10080.d0
         rminv(3,18) = 0.d0
         rminv(3,19) = 10080.d0
         rminv(3,20) = 10080.d0
         rminv(4,1) = -120.d0
         rminv(4,2) = -120.d0
         rminv(4,3) = -120.d0
         rminv(4,4) = 2400.d0
         rminv(4,5) = 0.d0
         rminv(4,6) = 0.d0
         rminv(4,7) = 0.d0
         rminv(4,8) = 0.d0
         rminv(4,9) = 0.d0
         rminv(4,10) = 0.d0
         rminv(4,11) = 2520.d0
         rminv(4,12) = 2520.d0
         rminv(4,13) = 2520.d0
         rminv(4,14) = 2520.d0
         rminv(4,15) = 2520.d0
         rminv(4,16) = 2520.d0
         rminv(4,17) = 0.d0
         rminv(4,18) = 10080.d0
         rminv(4,19) = 10080.d0
         rminv(4,20) = 10080.d0
         rminv(5,1) = 2520.d0
         rminv(5,2) = 2520.d0
         rminv(5,3) = 0.d0
         rminv(5,4) = 0.d0
         rminv(5,5) = 7560.d0
         rminv(5,6) = 0.d0
         rminv(5,7) = 3150.d0
         rminv(5,8) = -1890.d0
         rminv(5,9) = 3150.d0
         rminv(5,10) = 1890.d0
         rminv(5,11) = 3150.d0
         rminv(5,12) = -1890.d0
         rminv(5,13) = 3150.d0
         rminv(5,14) = -1890.d0
         rminv(5,15) = 0.d0
         rminv(5,16) = 0.d0
         rminv(5,17) = 37800.d0
         rminv(5,18) = 37800.d0
         rminv(5,19) = 7560.d0
         rminv(5,20) = 7560.d0
         rminv(6,1) = -2520.d0
         rminv(6,2) = 2520.d0
         rminv(6,3) = 0.d0
         rminv(6,4) = 0.d0
         rminv(6,5) = 0.d0
         rminv(6,6) = 12600.d0
         rminv(6,7) = 1890.d0
         rminv(6,8) = -630.d0
         rminv(6,9) = -1890.d0
         rminv(6,10) = -630.d0
         rminv(6,11) = -1890.d0
         rminv(6,12) = 630.d0
         rminv(6,13) = 1890.d0
         rminv(6,14) = -630.d0
         rminv(6,15) = 0.d0
         rminv(6,16) = 0.d0
         rminv(6,17) = 0.d0
         rminv(6,18) = 0.d0
         rminv(6,19) = 2520.d0
         rminv(6,20) = -2520.d0
         rminv(7,1) = 0.d0
         rminv(7,2) = 2520.d0
         rminv(7,3) = 2520.d0
         rminv(7,4) = 0.d0
         rminv(7,5) = 3150.d0
         rminv(7,6) = 1890.d0
         rminv(7,7) = 7560.d0
         rminv(7,8) = 0.d0
         rminv(7,9) = 3150.d0
         rminv(7,10) = -1890.d0
         rminv(7,11) = 0.d0
         rminv(7,12) = 0.d0
         rminv(7,13) = 3150.d0
         rminv(7,14) = -1890.d0
         rminv(7,15) = 3150.d0
         rminv(7,16) = -1890.d0
         rminv(7,17) = 37800.d0
         rminv(7,18) = 7560.d0
         rminv(7,19) = 37800.d0
         rminv(7,20) = 7560.d0
         rminv(8,1) = 0.d0
         rminv(8,2) = -2520.d0
         rminv(8,3) = 2520.d0
         rminv(8,4) = 0.d0
         rminv(8,5) = -1890.d0
         rminv(8,6) = -630.d0
         rminv(8,7) = 0.d0
         rminv(8,8) = 12600.d0
         rminv(8,9) = 1890.d0
         rminv(8,10) = -630.d0
         rminv(8,11) = 0.d0
         rminv(8,12) = 0.d0
         rminv(8,13) = -1890.d0
         rminv(8,14) = 630.d0
         rminv(8,15) = 1890.d0
         rminv(8,16) = -630.d0
         rminv(8,17) = 0.d0
         rminv(8,18) = -2520.d0
         rminv(8,19) = 0.d0
         rminv(8,20) = 2520.d0
         rminv(9,1) = 2520.d0
         rminv(9,2) = 0.d0
         rminv(9,3) = 2520.d0
         rminv(9,4) = 0.d0
         rminv(9,5) = 3150.d0
         rminv(9,6) = -1890.d0
         rminv(9,7) = 3150.d0
         rminv(9,8) = 1890.d0
         rminv(9,9) = 7560.d0
         rminv(9,10) = 0.d0
         rminv(9,11) = 3150.d0
         rminv(9,12) = -1890.d0
         rminv(9,13) = 0.d0
         rminv(9,14) = 0.d0
         rminv(9,15) = 3150.d0
         rminv(9,16) = -1890.d0
         rminv(9,17) = 37800.d0
         rminv(9,18) = 7560.d0
         rminv(9,19) = 7560.d0
         rminv(9,20) = 37800.d0
         rminv(10,1) = 2520.d0
         rminv(10,2) = 0.d0
         rminv(10,3) = -2520.d0
         rminv(10,4) = 0.d0
         rminv(10,5) = 1890.d0
         rminv(10,6) = -630.d0
         rminv(10,7) = -1890.d0
         rminv(10,8) = -630.d0
         rminv(10,9) = 0.d0
         rminv(10,10) = 12600.d0
         rminv(10,11) = 1890.d0
         rminv(10,12) = -630.d0
         rminv(10,13) = 0.d0
         rminv(10,14) = 0.d0
         rminv(10,15) = -1890.d0
         rminv(10,16) = 630.d0
         rminv(10,17) = 0.d0
         rminv(10,18) = 2520.d0
         rminv(10,19) = -2520.d0
         rminv(10,20) = 0.d0
         rminv(11,1) = 2520.d0
         rminv(11,2) = 0.d0
         rminv(11,3) = 0.d0
         rminv(11,4) = 2520.d0
         rminv(11,5) = 3150.d0
         rminv(11,6) = -1890.d0
         rminv(11,7) = 0.d0
         rminv(11,8) = 0.d0
         rminv(11,9) = 3150.d0
         rminv(11,10) = 1890.d0
         rminv(11,11) = 7560.d0
         rminv(11,12) = 0.d0
         rminv(11,13) = 3150.d0
         rminv(11,14) = 1890.d0
         rminv(11,15) = 3150.d0
         rminv(11,16) = 1890.d0
         rminv(11,17) = 7560.d0
         rminv(11,18) = 37800.d0
         rminv(11,19) = 7560.d0
         rminv(11,20) = 37800.d0
         rminv(12,1) = -2520.d0
         rminv(12,2) = 0.d0
         rminv(12,3) = 0.d0
         rminv(12,4) = 2520.d0
         rminv(12,5) = -1890.d0
         rminv(12,6) = 630.d0
         rminv(12,7) = 0.d0
         rminv(12,8) = 0.d0
         rminv(12,9) = -1890.d0
         rminv(12,10) = -630.d0
         rminv(12,11) = 0.d0
         rminv(12,12) = 12600.d0
         rminv(12,13) = 1890.d0
         rminv(12,14) = 630.d0
         rminv(12,15) = 1890.d0
         rminv(12,16) = 630.d0
         rminv(12,17) = -2520.d0
         rminv(12,18) = 0.d0
         rminv(12,19) = 2520.d0
         rminv(12,20) = 0.d0
         rminv(13,1) = 0.d0
         rminv(13,2) = 2520.d0
         rminv(13,3) = 0.d0
         rminv(13,4) = 2520.d0
         rminv(13,5) = 3150.d0
         rminv(13,6) = 1890.d0
         rminv(13,7) = 3150.d0
         rminv(13,8) = -1890.d0
         rminv(13,9) = 0.d0
         rminv(13,10) = 0.d0
         rminv(13,11) = 3150.d0
         rminv(13,12) = 1890.d0
         rminv(13,13) = 7560.d0
         rminv(13,14) = 0.d0
         rminv(13,15) = 3150.d0
         rminv(13,16) = 1890.d0
         rminv(13,17) = 7560.d0
         rminv(13,18) = 37800.d0
         rminv(13,19) = 37800.d0
         rminv(13,20) = 7560.d0
         rminv(14,1) = 0.d0
         rminv(14,2) = -2520.d0
         rminv(14,3) = 0.d0
         rminv(14,4) = 2520.d0
         rminv(14,5) = -1890.d0
         rminv(14,6) = -630.d0
         rminv(14,7) = -1890.d0
         rminv(14,8) = 630.d0
         rminv(14,9) = 0.d0
         rminv(14,10) = 0.d0
         rminv(14,11) = 1890.d0
         rminv(14,12) = 630.d0
         rminv(14,13) = 0.d0
         rminv(14,14) = 12600.d0
         rminv(14,15) = 1890.d0
         rminv(14,16) = 630.d0
         rminv(14,17) = -2520.d0
         rminv(14,18) = 0.d0
         rminv(14,19) = 0.d0
         rminv(14,20) = 2520.d0
         rminv(15,1) = 0.d0
         rminv(15,2) = 0.d0
         rminv(15,3) = 2520.d0
         rminv(15,4) = 2520.d0
         rminv(15,5) = 0.d0
         rminv(15,6) = 0.d0
         rminv(15,7) = 3150.d0
         rminv(15,8) = 1890.d0
         rminv(15,9) = 3150.d0
         rminv(15,10) = -1890.d0
         rminv(15,11) = 3150.d0
         rminv(15,12) = 1890.d0
         rminv(15,13) = 3150.d0
         rminv(15,14) = 1890.d0
         rminv(15,15) = 7560.d0
         rminv(15,16) = 0.d0
         rminv(15,17) = 7560.d0
         rminv(15,18) = 7560.d0
         rminv(15,19) = 37800.d0
         rminv(15,20) = 37800.d0
         rminv(16,1) = 0.d0
         rminv(16,2) = 0.d0
         rminv(16,3) = -2520.d0
         rminv(16,4) = 2520.d0
         rminv(16,5) = 0.d0
         rminv(16,6) = 0.d0
         rminv(16,7) = -1890.d0
         rminv(16,8) = -630.d0
         rminv(16,9) = -1890.d0
         rminv(16,10) = 630.d0
         rminv(16,11) = 1890.d0
         rminv(16,12) = 630.d0
         rminv(16,13) = 1890.d0
         rminv(16,14) = 630.d0
         rminv(16,15) = 0.d0
         rminv(16,16) = 12600.d0
         rminv(16,17) = -2520.d0
         rminv(16,18) = 2520.d0
         rminv(16,19) = 0.d0
         rminv(16,20) = 0.d0
         rminv(17,1) = 10080.d0
         rminv(17,2) = 10080.d0
         rminv(17,3) = 10080.d0
         rminv(17,4) = 0.d0
         rminv(17,5) = 37800.d0
         rminv(17,6) = 0.d0
         rminv(17,7) = 37800.d0
         rminv(17,8) = 0.d0
         rminv(17,9) = 37800.d0
         rminv(17,10) = 0.d0
         rminv(17,11) = 7560.d0
         rminv(17,12) = -2520.d0
         rminv(17,13) = 7560.d0
         rminv(17,14) = -2520.d0
         rminv(17,15) = 7560.d0
         rminv(17,16) = -2520.d0
         rminv(17,17) = 529200.d0
         rminv(17,18) = 65520.d0
         rminv(17,19) = 65520.d0
         rminv(17,20) = 65520.d0
         rminv(18,1) = 10080.d0
         rminv(18,2) = 10080.d0
         rminv(18,3) = 0.d0
         rminv(18,4) = 10080.d0
         rminv(18,5) = 37800.d0
         rminv(18,6) = 0.d0
         rminv(18,7) = 7560.d0
         rminv(18,8) = -2520.d0
         rminv(18,9) = 7560.d0
         rminv(18,10) = 2520.d0
         rminv(18,11) = 37800.d0
         rminv(18,12) = 0.d0
         rminv(18,13) = 37800.d0
         rminv(18,14) = 0.d0
         rminv(18,15) = 7560.d0
         rminv(18,16) = 2520.d0
         rminv(18,17) = 65520.d0
         rminv(18,18) = 529200.d0
         rminv(18,19) = 65520.d0
         rminv(18,20) = 65520.d0
         rminv(19,1) = 0.d0
         rminv(19,2) = 10080.d0
         rminv(19,3) = 10080.d0
         rminv(19,4) = 10080.d0
         rminv(19,5) = 7560.d0
         rminv(19,6) = 2520.d0
         rminv(19,7) = 37800.d0
         rminv(19,8) = 0.d0
         rminv(19,9) = 7560.d0
         rminv(19,10) = -2520.d0
         rminv(19,11) = 7560.d0
         rminv(19,12) = 2520.d0
         rminv(19,13) = 37800.d0
         rminv(19,14) = 0.d0
         rminv(19,15) = 37800.d0
         rminv(19,16) = 0.d0
         rminv(19,17) = 65520.d0
         rminv(19,18) = 65520.d0
         rminv(19,19) = 529200.d0
         rminv(19,20) = 65520.d0
         rminv(20,1) = 10080.d0
         rminv(20,2) = 0.d0
         rminv(20,3) = 10080.d0
         rminv(20,4) = 10080.d0
         rminv(20,5) = 7560.d0
         rminv(20,6) = -2520.d0
         rminv(20,7) = 7560.d0
         rminv(20,8) = 2520.d0
         rminv(20,9) = 37800.d0
         rminv(20,10) = 0.d0
         rminv(20,11) = 37800.d0
         rminv(20,12) = 0.d0
         rminv(20,13) = 7560.d0
         rminv(20,14) = 2520.d0
         rminv(20,15) = 37800.d0
         rminv(20,16) = 0.d0
         rminv(20,17) = 65520.d0
         rminv(20,18) = 65520.d0
         rminv(20,19) = 65520.d0
         rminv(20,20) = 529200.d0
      else
         write(*,*) 'error in gtinv.f: element type not supported'
      endif
      
c
c.... return
c      
      return
      end
      

      
