1!
2!     CalculiX - A 3-dimensional finite element program
3!              Copyright (C) 1998-2021 Guido Dhondt
4!
5!     This program is free software; you can redistribute it and/or
6!     modify it under the terms of the GNU General Public License as
7!     published by the Free Software Foundation(version 2);
8!
9!
10!     This program is distributed in the hope that it will be useful,
11!     but WITHOUT ANY WARRANTY; without even the implied warranty of
12!     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13!     GNU General Public License for more details.
14!
15!     You should have received a copy of the GNU General Public License
16!     along with this program; if not, write to the Free Software
17!     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18!
19      subroutine linscal10(scal,konl,scall,idim,shp)
20!
21!     calculates a linear approximation to the quadratic interpolation
22!     of the temperatures in a C3D10 element. A
23!     quadratic interpolation of the temperatures leads to quadratic
24!     thermal stresses, which cannot be handled by the elements
25!     displacement functions (which lead to linear stresses). Thus,
26!     the temperatures are approximated by a linear function.
27!
28      implicit none
29!
30      integer konl(*),idim
31!
32      real*8 scal(0:idim,*),scall,shp(4,*)
33!
34      scall=
35     &    (shp(4,1)+(shp(4,5)+shp(4,7)+shp(4,8))/2.d0)*scal(0,konl(1))
36     &    +(shp(4,2)+(shp(4,5)+shp(4,6)+shp(4,9))/2.d0)*scal(0,konl(2))
37     &    +(shp(4,3)+(shp(4,6)+shp(4,7)+shp(4,10))/2.d0)*scal(0,konl(3))
38     &    +(shp(4,4)+(shp(4,8)+shp(4,9)+shp(4,10))/2.d0)*scal(0,konl(4))
39!
40      return
41      end
42