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 lintemp(t0,konl,nope,jj,t0l)
20!
21!     calculates a trilinear approximation to the quadratic interpolation
22!     of the temperatures in a C3D20 element (full integration). 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 trilinear function.
27!
28      implicit none
29!
30      integer konl(20),nope,jj,i1
31!
32      real*8 t0(*),t0l,a20l(20,27)
33!
34!
35!
36      a20l=reshape((
37     &/-0.088729832,-0.240369600,-0.059630393,-0.240369600,-0.240369600,
38     & -0.059630393,-0.011270159,-0.059630393, 0.524865555, 0.066666663,
39     &  0.066666663, 0.524865555, 0.066666663, 0.008467776, 0.008467776,
40     &  0.066666663, 0.524865555, 0.066666663, 0.008467776, 0.066666663,
41     & -0.164549715,-0.164549715,-0.149999995,-0.149999995,-0.149999995,
42     & -0.149999995,-0.035450279,-0.035450279, 0.524865544, 0.295766106,
43     &  0.066666668, 0.295766106, 0.066666668, 0.037567223, 0.008467777,
44     &  0.037567223, 0.295766106, 0.295766106, 0.037567223, 0.037567223,
45     & -0.240369600,-0.088729832,-0.240369600,-0.059630393,-0.059630393,
46     & -0.240369600,-0.059630393,-0.011270159, 0.524865555, 0.524865555,
47     &  0.066666663, 0.066666663, 0.066666663, 0.066666663, 0.008467776,
48     &  0.008467776, 0.066666663, 0.524865555, 0.066666663, 0.008467776,
49     & -0.164549715,-0.149999995,-0.149999995,-0.164549715,-0.149999995,
50     & -0.035450279,-0.035450279,-0.149999995, 0.295766106, 0.066666668,
51     &  0.295766106, 0.524865544, 0.037567223, 0.008467777, 0.037567223,
52     &  0.066666668, 0.295766106, 0.037567223, 0.037567223, 0.295766106,
53     & -0.157274855,-0.157274855,-0.157274855,-0.157274855,-0.092725137,
54     & -0.092725137,-0.092725137,-0.092725137, 0.295766105, 0.295766105,
55     &  0.295766105, 0.295766105, 0.037567224, 0.037567224, 0.037567224,
56     &  0.037567224, 0.166666664, 0.166666664, 0.166666664, 0.166666664,
57     & -0.149999995,-0.164549715,-0.164549715,-0.149999995,-0.035450279,
58     & -0.149999995,-0.149999995,-0.035450279, 0.295766106, 0.524865544,
59     &  0.295766106, 0.066666668, 0.037567223, 0.066666668, 0.037567223,
60     &  0.008467777, 0.037567223, 0.295766106, 0.295766106, 0.037567223,
61     & -0.240369600,-0.059630393,-0.240369600,-0.088729832,-0.059630393,
62     & -0.011270159,-0.059630393,-0.240369600, 0.066666663, 0.066666663,
63     &  0.524865555, 0.524865555, 0.008467776, 0.008467776, 0.066666663,
64     &  0.066666663, 0.066666663, 0.008467776, 0.066666663, 0.524865555,
65     & -0.149999995,-0.149999995,-0.164549715,-0.164549715,-0.035450279,
66     & -0.035450279,-0.149999995,-0.149999995, 0.066666668, 0.295766106,
67     &  0.524865544, 0.295766106, 0.008467777, 0.037567223, 0.066666668,
68     &  0.037567223, 0.037567223, 0.037567223, 0.295766106, 0.295766106,
69     & -0.059630393,-0.240369600,-0.088729832,-0.240369600,-0.011270159,
70     & -0.059630393,-0.240369600,-0.059630393, 0.066666663, 0.524865555,
71     &  0.524865555, 0.066666663, 0.008467776, 0.066666663, 0.066666663,
72     &  0.008467776, 0.008467776, 0.066666663, 0.524865555, 0.066666663,
73     & -0.164549715,-0.149999995,-0.035450279,-0.149999995,-0.164549715,
74     & -0.149999995,-0.035450279,-0.149999995, 0.295766106, 0.037567223,
75     &  0.037567223, 0.295766106, 0.295766106, 0.037567223, 0.037567223,
76     &  0.295766106, 0.524865544, 0.066666668, 0.008467777, 0.066666668,
77     & -0.157274855,-0.157274855,-0.092725137,-0.092725137,-0.157274855,
78     & -0.157274855,-0.092725137,-0.092725137, 0.295766105, 0.166666664,
79     &  0.037567224, 0.166666664, 0.295766105, 0.166666664, 0.037567224,
80     &  0.166666664, 0.295766105, 0.295766105, 0.037567224, 0.037567224,
81     & -0.149999995,-0.164549715,-0.149999995,-0.035450279,-0.149999995,
82     & -0.164549715,-0.149999995,-0.035450279, 0.295766106, 0.295766106,
83     &  0.037567223, 0.037567223, 0.295766106, 0.295766106, 0.037567223,
84     &  0.037567223, 0.066666668, 0.524865544, 0.066666668, 0.008467777,
85     & -0.157274855,-0.092725137,-0.092725137,-0.157274855,-0.157274855,
86     & -0.092725137,-0.092725137,-0.157274855, 0.166666664, 0.037567224,
87     &  0.166666664, 0.295766105, 0.166666664, 0.037567224, 0.166666664,
88     &  0.295766105, 0.295766105, 0.037567224, 0.037567224, 0.295766105,
89     & -0.124999996,-0.124999996,-0.124999996,-0.124999996,-0.124999996,
90     & -0.124999996,-0.124999996,-0.124999996, 0.166666664, 0.166666664,
91     &  0.166666664, 0.166666664, 0.166666664, 0.166666664, 0.166666664,
92     &  0.166666664, 0.166666664, 0.166666664, 0.166666664, 0.166666664,
93     & -0.092725137,-0.157274855,-0.157274855,-0.092725137,-0.092725137,
94     & -0.157274855,-0.157274855,-0.092725137, 0.166666664, 0.295766105,
95     &  0.166666664, 0.037567224, 0.166666664, 0.295766105, 0.166666664,
96     &  0.037567224, 0.037567224, 0.295766105, 0.295766105, 0.037567224,
97     & -0.149999995,-0.035450279,-0.149999995,-0.164549715,-0.149999995,
98     & -0.035450279,-0.149999995,-0.164549715, 0.037567223, 0.037567223,
99     &  0.295766106, 0.295766106, 0.037567223, 0.037567223, 0.295766106,
100     &  0.295766106, 0.066666668, 0.008467777, 0.066666668, 0.524865544,
101     & -0.092725137,-0.092725137,-0.157274855,-0.157274855,-0.092725137,
102     & -0.092725137,-0.157274855,-0.157274855, 0.037567224, 0.166666664,
103     &  0.295766105, 0.166666664, 0.037567224, 0.166666664, 0.295766105,
104     &  0.166666664, 0.037567224, 0.037567224, 0.295766105, 0.295766105,
105     & -0.035450279,-0.149999995,-0.164549715,-0.149999995,-0.035450279,
106     & -0.149999995,-0.164549715,-0.149999995, 0.037567223, 0.295766106,
107     &  0.295766106, 0.037567223, 0.037567223, 0.295766106, 0.295766106,
108     &  0.037567223, 0.008467777, 0.066666668, 0.524865544, 0.066666668,
109     & -0.240369600,-0.059630393,-0.011270159,-0.059630393,-0.088729832,
110     & -0.240369600,-0.059630393,-0.240369600, 0.066666663, 0.008467776,
111     &  0.008467776, 0.066666663, 0.524865555, 0.066666663, 0.066666663,
112     &  0.524865555, 0.524865555, 0.066666663, 0.008467776, 0.066666663,
113     & -0.149999995,-0.149999995,-0.035450279,-0.035450279,-0.164549715,
114     & -0.164549715,-0.149999995,-0.149999995, 0.066666668, 0.037567223,
115     &  0.008467777, 0.037567223, 0.524865544, 0.295766106, 0.066666668,
116     &  0.295766106, 0.295766106, 0.295766106, 0.037567223, 0.037567223,
117     & -0.059630393,-0.240369600,-0.059630393,-0.011270159,-0.240369600,
118     & -0.088729832,-0.240369600,-0.059630393, 0.066666663, 0.066666663,
119     &  0.008467776, 0.008467776, 0.524865555, 0.524865555, 0.066666663,
120     &  0.066666663, 0.066666663, 0.524865555, 0.066666663, 0.008467776,
121     & -0.149999995,-0.035450279,-0.035450279,-0.149999995,-0.164549715,
122     & -0.149999995,-0.149999995,-0.164549715, 0.037567223, 0.008467777,
123     &  0.037567223, 0.066666668, 0.295766106, 0.066666668, 0.295766106,
124     &  0.524865544, 0.295766106, 0.037567223, 0.037567223, 0.295766106,
125     & -0.092725137,-0.092725137,-0.092725137,-0.092725137,-0.157274855,
126     & -0.157274855,-0.157274855,-0.157274855, 0.037567224, 0.037567224,
127     &  0.037567224, 0.037567224, 0.295766105, 0.295766105, 0.295766105,
128     &  0.295766105, 0.166666664, 0.166666664, 0.166666664, 0.166666664,
129     & -0.035450279,-0.149999995,-0.149999995,-0.035450279,-0.149999995,
130     & -0.164549715,-0.164549715,-0.149999995, 0.037567223, 0.066666668,
131     &  0.037567223, 0.008467777, 0.295766106, 0.524865544, 0.295766106,
132     &  0.066666668, 0.037567223, 0.295766106, 0.295766106, 0.037567223,
133     & -0.059630393,-0.011270159,-0.059630393,-0.240369600,-0.240369600,
134     & -0.059630393,-0.240369600,-0.088729832, 0.008467776, 0.008467776,
135     &  0.066666663, 0.066666663, 0.066666663, 0.066666663, 0.524865555,
136     &  0.524865555, 0.066666663, 0.008467776, 0.066666663, 0.524865555,
137     & -0.035450279,-0.035450279,-0.149999995,-0.149999995,-0.149999995,
138     & -0.149999995,-0.164549715,-0.164549715, 0.008467777, 0.037567223,
139     &  0.066666668, 0.037567223, 0.066666668, 0.295766106, 0.524865544,
140     &  0.295766106, 0.037567223, 0.037567223, 0.295766106, 0.295766106,
141     & -0.011270159,-0.059630393,-0.240369600,-0.059630393,-0.059630393,
142     & -0.240369600,-0.088729832,-0.240369600, 0.008467776, 0.066666663,
143     &  0.066666663, 0.008467776, 0.066666663, 0.524865555, 0.524865555,
144     &  0.066666663, 0.008467776, 0.066666663, 0.524865555, 0.066666663/
145     &  ),(/20,27/))
146!
147      do i1=1,nope
148         t0l=t0l+a20l(i1,jj)*t0(konl(i1))
149      enddo
150!
151      return
152      end
153