*deck,usermatth      USERDISTRIB  parallel                                phu
      subroutine usermatth(matId, elemId, kDomIntPt, kLayer, kSectPt,
     &                     ldstep, isubst, keycut, ncomp, nStatev,nProp,
     &                     Time, dTime, Temp, dTemp, tgrad, 
     &                     ustatev, prop, coords, 
     &                     dudt,dudg,flux,dfdt,dfdg, 
     &                     cutFactor,hgen, var1, var2, var3, var4,
     &                     var5, var6, var7)
c*************************************************************************
c     *** primary function ***
c
c           user defined thermal material constitutive model
c
c     Attention:
c           User must define material constitutive behavior properly
c
c
c       The following demonstrates a USERMATTH subroutine for 
c       a regular conductive heat transfer.
c       See "ANSYS user material subroutine USERMATTH" for detailed
c       description of how to write a USERMATTH routine.
c
c
c*************************************************************************
c Copyright ANSYS.  All Rights Reserved.
c
c     input arguments
c     ===============
c      matId     (int,sc,i)               material #
c      elemId    (int,sc,i)               element #
c      kDomIntPt (int,sc,i)               "k"th domain integration point
c      kLayer    (int,sc,i)               "k"th layer
c      kSectPt   (int,sc,i)               "k"th Section point
c      ldstep    (int,sc,i)               load step number
c      isubst    (int,sc,i)               substep number
c      ncomp     (int,sc,i)               # of components
c      nStatev   (int,sc,i)               Number of state variables
c      nProp     (int,sc,i)               Number of material constants
c
c      Temp      (dp,sc,in)               temperature at beginning of
c                                         time increment
c      dTemp     (dp,sc,in)               temperature increment 
c      Time      (dp,sc,in)               time at beginning of increment (t)
c      dTime     (dp,sc,in)               current time increment (dt)
c
c      prop      (dp,ar(nprop),i)         Material constants defined by TB,USER
c      coords    (dp,ar(3),i)             current coordinates
c
c      tgrad     (dp,ar(ncomp),i)         Current values of the spatial gradients of temperature
c
c
c     input output arguments              
c     ======================             
c      ustatev   (dp,ar(nstatev),io)      user state variables
c      hgen      (dp,sr,io)               heat generation rate per unit mass
c      var?      (dp,sc,io)               not used, they are reserved arguments 
c                                         for further development
c
c     output arguments
c     ================
c      keycut    (int,sc,o)               loading bisect/cut control
c                                         0 - no bisect/cut
c                                         1 - bisect/cut
c                                         (factor will be determined by ANSYS solution control)
c 
c      cutFactor (dp,sc,o)                time step size cut-back factor
c                                         define it if a smaller step size is wished 
c                                         recommended value is 0~1
c
c      dudt      (dp,sr,o)                unit mass internal energy variation with respect to 
c                                         temperature      
c      dudg      (dp,ar(ncomp),o)         unit mass internal thermal energy variation  with 
c                                         respect to the spatial gradients of temperature
c      flux      (dp,ar(ncomp),o)         heat flux vector      
c      dfdt      (dp,ar(ncomp),o)         heat flux vector variation with respect to temperature
c      dfdg      (dp,ar(ncomp,ncomp),o)   heat flux vector variation with respect to the spatial 
c                                         gradients of temperature
c
c*************************************************************************
c
c      ncomp   3   for 3D
c      ncomp   2   for 2D
c      ncomp   1   for 1D
c
c
c*************************************************************************
#include "impcom.inc"
c
      INTEGER          matId, elemId,
     &                 kDomIntPt, kLayer, kSectPt,
     &                 ldstep,isubst,keycut,
     &                 ncomp,nStatev,nProp

      DOUBLE PRECISION Time,dTime,Temp,dTemp

      DOUBLE PRECISION ustatev(nStatev),prop(nProp),coords(ncomp)       

      DOUBLE PRECISION dudt,dudg(ncomp),tgrad(ncomp),flux(ncomp),
     &                 dfdt(ncomp),dfdg(ncomp,ncomp),cutFactor,hgen

c

      DOUBLE PRECISION var1, var2, var3, var4, var5,
     &                 var6, var7
c
c*************************************************************************
c
    

      double precision cond, specht
      integer i,j

      keycut = 0
      cutFactor = 0.d0  
      cond = prop(1)
      specht = prop(2)
      dudt = specht

      do i=1,ncomp
        dudg(i) = 0.d0
        dfdt(i) = 0.d0
        do j=1,ncomp
          dfdg(i,j) = 0.d0
        enddo
      enddo    

      do i=1,ncomp
        flux(i) = cond*tgrad(i)
        dfdg(i,i) = cond
      enddo         

      return
      end
