SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HexTricubicHmtScaleFactorsEdges.h
Go to the documentation of this file.
1 //
2 // For more information, please see: http://software.sci.utah.edu
3 //
4 // The MIT License
5 //
6 // Copyright (c) 2009 Scientific Computing and Imaging Institute,
7 // University of Utah.
8 //
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
16 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 // DEALINGS IN THE SOFTWARE.
27 //
28 /// @file HexTricubicHmtScaleFactorsEdges.h
29 /// @author Martin Cole, Frank B. Sachse
30 /// @date Nov 5 2005
31 
32 #ifndef CORE_BASIS_HEXTRICUBICHMTSCALEFACTORSEDGES_H
33 #define CORE_BASIS_HEXTRICUBICHMTSCALEFACTORSEDGES_H 1
34 
37 
38 namespace SCIRun {
39 namespace Core {
40 namespace Basis {
41 
42 /// Class for describing unit geometry of HexTricubicHmtScaleFactorsEdges
45 public:
48 
49  static int dofs() { return 64; } ///< return degrees of freedom
50 };
51 
52 
53 /// Class for handling of element of type hexahedron with
54 /// tricubic hermitian interpolation with scale factors
55 template <class T>
57  public HexApprox,
58  public HexGaussian3<double>,
59  public HexSamplingSchemes,
61  public HexElementWeights
62 {
63 public:
64  typedef T value_type;
65 
68 
69  static int polynomial_order() { return 3; }
70 
71 
72  template<class VECTOR>
73  inline void get_weights(const VECTOR& coords, double *w) const
74  { get_cubic_weights(coords,w); }
75 
76  template<class VECTOR>
77  inline void get_derivate_weights(const VECTOR& coords, double *w) const
78  { get_cubic_derivate_weights(coords,w); }
79 
80  /// get value at parametric coordinate
81  template <class ElemData, class VECTOR>
82  T interpolate(const VECTOR &coords, const ElemData &cd) const
83  {
84  double w[64];
85  get_cubic_weights(coords, w);
86 
87  const double sx0=this->scalefactorse_[cd.edge0_index()];
88  const double sx1=this->scalefactorse_[cd.edge0_index()];
89  const double sx2=this->scalefactorse_[cd.edge2_index()];
90  const double sx3=this->scalefactorse_[cd.edge2_index()];
91  const double sx4=this->scalefactorse_[cd.edge4_index()];
92  const double sx5=this->scalefactorse_[cd.edge4_index()];
93  const double sx6=this->scalefactorse_[cd.edge6_index()];
94  const double sx7=this->scalefactorse_[cd.edge6_index()];
95 
96  const double sy0=this->scalefactorse_[cd.edge3_index()];
97  const double sy1=this->scalefactorse_[cd.edge1_index()];
98  const double sy2=this->scalefactorse_[cd.edge1_index()];
99  const double sy3=this->scalefactorse_[cd.edge3_index()];
100  const double sy4=this->scalefactorse_[cd.edge7_index()];
101  const double sy5=this->scalefactorse_[cd.edge5_index()];
102  const double sy6=this->scalefactorse_[cd.edge5_index()];
103  const double sy7=this->scalefactorse_[cd.edge7_index()];
104 
105  const double sz0=this->scalefactorse_[cd.edge8_index()];
106  const double sz1=this->scalefactorse_[cd.edge9_index()];
107  const double sz2=this->scalefactorse_[cd.edge10_index()];
108  const double sz3=this->scalefactorse_[cd.edge11_index()];
109  const double sz4=this->scalefactorse_[cd.edge8_index()];
110  const double sz5=this->scalefactorse_[cd.edge9_index()];
111  const double sz6=this->scalefactorse_[cd.edge10_index()];
112  const double sz7=this->scalefactorse_[cd.edge11_index()];
113 
114  const T sdx0=this->derivs_[cd.node0_index()][0]*sx0;
115  const T sdx1=this->derivs_[cd.node1_index()][0]*sx1;
116  const T sdx2=this->derivs_[cd.node2_index()][0]*sx2;
117  const T sdx3=this->derivs_[cd.node3_index()][0]*sx3;
118  const T sdx4=this->derivs_[cd.node4_index()][0]*sx4;
119  const T sdx5=this->derivs_[cd.node5_index()][0]*sx5;
120  const T sdx6=this->derivs_[cd.node6_index()][0]*sx6;
121  const T sdx7=this->derivs_[cd.node7_index()][0]*sx7;
122 
123  const T sdy0=this->derivs_[cd.node0_index()][1]*sy0;
124  const T sdy1=this->derivs_[cd.node1_index()][1]*sy1;
125  const T sdy2=this->derivs_[cd.node2_index()][1]*sy2;
126  const T sdy3=this->derivs_[cd.node3_index()][1]*sy3;
127  const T sdy4=this->derivs_[cd.node4_index()][1]*sy4;
128  const T sdy5=this->derivs_[cd.node5_index()][1]*sy5;
129  const T sdy6=this->derivs_[cd.node6_index()][1]*sy6;
130  const T sdy7=this->derivs_[cd.node7_index()][1]*sy7;
131 
132  const T sdz0=this->derivs_[cd.node0_index()][2]*sz0;
133  const T sdz1=this->derivs_[cd.node1_index()][2]*sz1;
134  const T sdz2=this->derivs_[cd.node2_index()][2]*sz2;
135  const T sdz3=this->derivs_[cd.node3_index()][2]*sz3;
136  const T sdz4=this->derivs_[cd.node4_index()][2]*sz4;
137  const T sdz5=this->derivs_[cd.node5_index()][2]*sz5;
138  const T sdz6=this->derivs_[cd.node6_index()][2]*sz6;
139  const T sdz7=this->derivs_[cd.node7_index()][2]*sz7;
140 
141  const T sdxy0=this->derivs_[cd.node0_index()][3]*sx0*sy0;
142  const T sdxy1=this->derivs_[cd.node1_index()][3]*sx1*sy1;
143  const T sdxy2=this->derivs_[cd.node2_index()][3]*sx2*sy2;
144  const T sdxy3=this->derivs_[cd.node3_index()][3]*sx3*sy3;
145  const T sdxy4=this->derivs_[cd.node4_index()][3]*sx4*sy4;
146  const T sdxy5=this->derivs_[cd.node5_index()][3]*sx5*sy5;
147  const T sdxy6=this->derivs_[cd.node6_index()][3]*sx6*sy6;
148  const T sdxy7=this->derivs_[cd.node7_index()][3]*sx7*sy7;
149 
150  const T sdyz0=this->derivs_[cd.node0_index()][4]*sy0*sz0;
151  const T sdyz1=this->derivs_[cd.node1_index()][4]*sy1*sz1;
152  const T sdyz2=this->derivs_[cd.node2_index()][4]*sy2*sz2;
153  const T sdyz3=this->derivs_[cd.node3_index()][4]*sy3*sz3;
154  const T sdyz4=this->derivs_[cd.node4_index()][4]*sy4*sz4;
155  const T sdyz5=this->derivs_[cd.node5_index()][4]*sy5*sz5;
156  const T sdyz6=this->derivs_[cd.node6_index()][4]*sy6*sz6;
157  const T sdyz7=this->derivs_[cd.node7_index()][4]*sy7*sz7;
158 
159  const T sdxz0=this->derivs_[cd.node0_index()][5]*sx0*sz0;
160  const T sdxz1=this->derivs_[cd.node1_index()][5]*sx1*sz1;
161  const T sdxz2=this->derivs_[cd.node2_index()][5]*sx2*sz2;
162  const T sdxz3=this->derivs_[cd.node3_index()][5]*sx3*sz3;
163  const T sdxz4=this->derivs_[cd.node4_index()][5]*sx4*sz4;
164  const T sdxz5=this->derivs_[cd.node5_index()][5]*sx5*sz5;
165  const T sdxz6=this->derivs_[cd.node6_index()][5]*sx6*sz6;
166  const T sdxz7=this->derivs_[cd.node7_index()][5]*sx7*sz7;
167 
168  const T sdxyz0=this->derivs_[cd.node0_index()][6]*sx0*sy0*sz0;
169  const T sdxyz1=this->derivs_[cd.node1_index()][6]*sx1*sy1*sz1;
170  const T sdxyz2=this->derivs_[cd.node2_index()][6]*sx2*sy2*sz2;
171  const T sdxyz3=this->derivs_[cd.node3_index()][6]*sx3*sy3*sz3;
172  const T sdxyz4=this->derivs_[cd.node4_index()][6]*sx4*sy4*sz4;
173  const T sdxyz5=this->derivs_[cd.node5_index()][6]*sx5*sy5*sz5;
174  const T sdxyz6=this->derivs_[cd.node6_index()][6]*sx6*sy6*sz6;
175  const T sdxyz7=this->derivs_[cd.node7_index()][6]*sx7*sy7*sz7;
176 
177  return (T)(
178  w[0] * cd.node0()+
179  w[1] * sdx0 +
180  w[2] * sdy0 +
181  w[3] * sdz0 +
182  w[4] * sdxy0 +
183  w[5] * sdyz0 +
184  w[6] * sdxz0 +
185  w[7] * sdxyz0 +
186  w[8] * cd.node1()+
187  w[9] * sdx1 +
188  w[10] * sdy1 +
189  w[11] * sdz1 +
190  w[12] * sdxy1 +
191  w[13] * sdyz1 +
192  w[14] * sdxz1 +
193  w[15] * sdxyz1 +
194  w[16] * cd.node2()+
195  w[17] * sdx2 +
196  w[18] * sdy2 +
197  w[19] * sdz2 +
198  w[20] * sdxy2 +
199  w[21] * sdyz2 +
200  w[22] * sdxz2 +
201  w[23] * sdxyz2 +
202  w[24] * cd.node3()+
203  w[25] * sdx3 +
204  w[26] * sdy3 +
205  w[27] * sdz3 +
206  w[28] * sdxy3 +
207  w[29] * sdyz3 +
208  w[30] * sdxz3 +
209  w[31] * sdxyz3 +
210  w[32] * cd.node4()+
211  w[33] * sdx4 +
212  w[34] * sdy4 +
213  w[35] * sdz4 +
214  w[36] * sdxy4 +
215  w[37] * sdyz4 +
216  w[38] * sdxz4 +
217  w[39] * sdxyz4 +
218  w[40] * cd.node5()+
219  w[41] * sdx5 +
220  w[42] * sdy5 +
221  w[43] * sdz5 +
222  w[44] * sdxy5 +
223  w[45] * sdyz5 +
224  w[46] * sdxz5 +
225  w[47] * sdxyz5 +
226  w[48] * cd.node6()+
227  w[49] * sdx6 +
228  w[50] * sdy6 +
229  w[51] * sdz6 +
230  w[52] * sdxy6 +
231  w[53] * sdyz6 +
232  w[54] * sdxz6 +
233  w[55] * sdxyz6 +
234  w[56] * cd.node7()+
235  w[57] * sdx7 +
236  w[58] * sdy7 +
237  w[59] * sdz7 +
238  w[60] * sdxy7 +
239  w[61] * sdyz7 +
240  w[62] * sdxz7 +
241  w[63] * sdxyz7);
242  }
243 
244 
245  /// get first derivative at parametric coordinate
246  template <class ElemData, class VECTOR1, class VECTOR2>
247  void derivate(const VECTOR1 &coords, const ElemData &cd,
248  VECTOR2 &derivs) const
249  {
250  const double x=coords[0], y=coords[1], z=coords[2];
251  const double x2=x*x;
252  const double y2=y*y;
253  const double z2=z*z;
254  const double x12=(x-1)*(x-1);
255  const double y12=(y-1)*(y-1);
256  const double z12=(z-1)*(z-1);
257 
258  derivs.resize(3);
259 
260  const double sx0=this->scalefactorse_[cd.edge0_index()];
261  const double sx1=this->scalefactorse_[cd.edge0_index()];
262  const double sx2=this->scalefactorse_[cd.edge2_index()];
263  const double sx3=this->scalefactorse_[cd.edge2_index()];
264  const double sx4=this->scalefactorse_[cd.edge4_index()];
265  const double sx5=this->scalefactorse_[cd.edge4_index()];
266  const double sx6=this->scalefactorse_[cd.edge6_index()];
267  const double sx7=this->scalefactorse_[cd.edge6_index()];
268 
269  const double sy0=this->scalefactorse_[cd.edge3_index()];
270  const double sy1=this->scalefactorse_[cd.edge1_index()];
271  const double sy2=this->scalefactorse_[cd.edge1_index()];
272  const double sy3=this->scalefactorse_[cd.edge3_index()];
273  const double sy4=this->scalefactorse_[cd.edge7_index()];
274  const double sy5=this->scalefactorse_[cd.edge5_index()];
275  const double sy6=this->scalefactorse_[cd.edge5_index()];
276  const double sy7=this->scalefactorse_[cd.edge7_index()];
277 
278  const double sz0=this->scalefactorse_[cd.edge8_index()];
279  const double sz1=this->scalefactorse_[cd.edge9_index()];
280  const double sz2=this->scalefactorse_[cd.edge10_index()];
281  const double sz3=this->scalefactorse_[cd.edge11_index()];
282  const double sz4=this->scalefactorse_[cd.edge8_index()];
283  const double sz5=this->scalefactorse_[cd.edge9_index()];
284  const double sz6=this->scalefactorse_[cd.edge10_index()];
285  const double sz7=this->scalefactorse_[cd.edge11_index()];
286 
287  const T sdx0=this->derivs_[cd.node0_index()][0]*sx0;
288  const T sdx1=this->derivs_[cd.node1_index()][0]*sx1;
289  const T sdx2=this->derivs_[cd.node2_index()][0]*sx2;
290  const T sdx3=this->derivs_[cd.node3_index()][0]*sx3;
291  const T sdx4=this->derivs_[cd.node4_index()][0]*sx4;
292  const T sdx5=this->derivs_[cd.node5_index()][0]*sx5;
293  const T sdx6=this->derivs_[cd.node6_index()][0]*sx6;
294  const T sdx7=this->derivs_[cd.node7_index()][0]*sx7;
295 
296  const T sdy0=this->derivs_[cd.node0_index()][1]*sy0;
297  const T sdy1=this->derivs_[cd.node1_index()][1]*sy1;
298  const T sdy2=this->derivs_[cd.node2_index()][1]*sy2;
299  const T sdy3=this->derivs_[cd.node3_index()][1]*sy3;
300  const T sdy4=this->derivs_[cd.node4_index()][1]*sy4;
301  const T sdy5=this->derivs_[cd.node5_index()][1]*sy5;
302  const T sdy6=this->derivs_[cd.node6_index()][1]*sy6;
303  const T sdy7=this->derivs_[cd.node7_index()][1]*sy7;
304 
305  const T sdz0=this->derivs_[cd.node0_index()][2]*sz0;
306  const T sdz1=this->derivs_[cd.node1_index()][2]*sz1;
307  const T sdz2=this->derivs_[cd.node2_index()][2]*sz2;
308  const T sdz3=this->derivs_[cd.node3_index()][2]*sz3;
309  const T sdz4=this->derivs_[cd.node4_index()][2]*sz4;
310  const T sdz5=this->derivs_[cd.node5_index()][2]*sz5;
311  const T sdz6=this->derivs_[cd.node6_index()][2]*sz6;
312  const T sdz7=this->derivs_[cd.node7_index()][2]*sz7;
313 
314  const T sdxy0=this->derivs_[cd.node0_index()][3]*sx0*sy0;
315  const T sdxy1=this->derivs_[cd.node1_index()][3]*sx1*sy1;
316  const T sdxy2=this->derivs_[cd.node2_index()][3]*sx2*sy2;
317  const T sdxy3=this->derivs_[cd.node3_index()][3]*sx3*sy3;
318  const T sdxy4=this->derivs_[cd.node4_index()][3]*sx4*sy4;
319  const T sdxy5=this->derivs_[cd.node5_index()][3]*sx5*sy5;
320  const T sdxy6=this->derivs_[cd.node6_index()][3]*sx6*sy6;
321  const T sdxy7=this->derivs_[cd.node7_index()][3]*sx7*sy7;
322 
323  const T sdyz0=this->derivs_[cd.node0_index()][4]*sy0*sz0;
324  const T sdyz1=this->derivs_[cd.node1_index()][4]*sy1*sz1;
325  const T sdyz2=this->derivs_[cd.node2_index()][4]*sy2*sz2;
326  const T sdyz3=this->derivs_[cd.node3_index()][4]*sy3*sz3;
327  const T sdyz4=this->derivs_[cd.node4_index()][4]*sy4*sz4;
328  const T sdyz5=this->derivs_[cd.node5_index()][4]*sy5*sz5;
329  const T sdyz6=this->derivs_[cd.node6_index()][4]*sy6*sz6;
330  const T sdyz7=this->derivs_[cd.node7_index()][4]*sy7*sz7;
331 
332  const T sdxz0=this->derivs_[cd.node0_index()][5]*sx0*sz0;
333  const T sdxz1=this->derivs_[cd.node1_index()][5]*sx1*sz1;
334  const T sdxz2=this->derivs_[cd.node2_index()][5]*sx2*sz2;
335  const T sdxz3=this->derivs_[cd.node3_index()][5]*sx3*sz3;
336  const T sdxz4=this->derivs_[cd.node4_index()][5]*sx4*sz4;
337  const T sdxz5=this->derivs_[cd.node5_index()][5]*sx5*sz5;
338  const T sdxz6=this->derivs_[cd.node6_index()][5]*sx6*sz6;
339  const T sdxz7=this->derivs_[cd.node7_index()][5]*sx7*sz7;
340 
341  const T sdxyz0=this->derivs_[cd.node0_index()][6]*sx0*sy0*sz0;
342  const T sdxyz1=this->derivs_[cd.node1_index()][6]*sx1*sy1*sz1;
343  const T sdxyz2=this->derivs_[cd.node2_index()][6]*sx2*sy2*sz2;
344  const T sdxyz3=this->derivs_[cd.node3_index()][6]*sx3*sy3*sz3;
345  const T sdxyz4=this->derivs_[cd.node4_index()][6]*sx4*sy4*sz4;
346  const T sdxyz5=this->derivs_[cd.node5_index()][6]*sx5*sy5*sz5;
347  const T sdxyz6=this->derivs_[cd.node6_index()][6]*sx6*sy6*sz6;
348  const T sdxyz7=this->derivs_[cd.node7_index()][6]*sx7*sy7*sz7;
349 
350  derivs[0]=
351  static_cast<typename VECTOR2::value_type>(6*(-1 + x)*x*y12*(1 + 2*y)*z12*(1 + 2*z)*cd.node0()
352  +(1 - 4*x + 3*x2)*y12*(1 + 2*y)*z12*(1 + 2*z)*sdx0
353  +6*(-1 + x)*x*y12*y*z12*(1 + 2*z)*sdy0
354  +6*(-1 + x)*x*y12*(1 + 2*y)*z12*z*sdz0
355  +(1 - 4*x + 3*x2)*y12*y*z12*(1 + 2*z)*sdxy0
356  +6*(-1 + x)*x*y12*y*z12*z*sdyz0
357  +(1 - 4*x + 3*x2)*y12*(1 + 2*y)*z12*z*sdxz0
358  +(1 - 4*x + 3*x2)*y12*y*z12*z*sdxyz0
359  -6*(-1 + x)*x*y12*(1 + 2*y)*z12*(1 + 2*z)*cd.node1()
360  +x*(-2 + 3*x)*y12*(1 + 2*y)*z12*(1 + 2*z)*sdx1
361  -6*(-1 + x)*x*y12*y*z12*(1 + 2*z)*sdy1
362  -6*(-1 + x)*x*y12*(1 + 2*y)*z12*z*sdz1
363  +x*(-2 + 3*x)*y12*y*z12*(1 + 2*z)*sdxy1
364  -6*(-1 + x)*x*y12*y*z12*z*sdyz1
365  +x*(-2 + 3*x)*y12*(1 + 2*y)*z12*z*sdxz1
366  +x*(-2 + 3*x)*y12*y*z12*z*sdxyz1
367  +6*(-1 + x)*x*y2*(-3 + 2*y)*z12*(1 + 2*z)*cd.node2()
368  -(x*(-2 + 3*x)*y2*(-3 + 2*y)*z12*(1 + 2*z))*sdx2
369  -6*(-1 + x)*x*(-1 + y)*y2*z12*(1 + 2*z)*sdy2
370  +6*(-1 + x)*x*y2*(-3 + 2*y)*z12*z*sdz2
371  +x*(-2 + 3*x)*(-1 + y)*y2*z12*(1 + 2*z)*sdxy2
372  -6*(-1 + x)*x*(-1 + y)*y2*z12*z*sdyz2
373  -(x*(-2 + 3*x)*y2*(-3 + 2*y)*z12*z)*sdxz2
374  +x*(-2 + 3*x)*(-1 + y)*y2*z12*z*sdxyz2
375  -6*(-1 + x)*x*y2*(-3 + 2*y)*z12*(1 + 2*z)*cd.node3()
376  -((1 - 4*x + 3*x2)*y2*(-3 + 2*y)*z12*(1 + 2*z))*sdx3
377  +6*(-1 + x)*x*(-1 + y)*y2*z12*(1 + 2*z)*sdy3
378  -6*(-1 + x)*x*y2*(-3 + 2*y)*z12*z*sdz3
379  +(1 - 4*x + 3*x2)*(-1 + y)*y2*z12*(1 + 2*z)*sdxy3
380  +6*(-1 + x)*x*(-1 + y)*y2*z12*z*sdyz3
381  -((1 - 4*x + 3*x2)*y2*(-3 + 2*y)*z12*z)*sdxz3
382  +(1 - 4*x + 3*x2)*(-1 + y)*y2*z12*z*sdxyz3
383  -6*(-1 + x)*x*y12*(1 + 2*y)*z2*(-3 + 2*z)*cd.node4()
384  -((1 - 4*x + 3*x2)*y12*(1 + 2*y)*z2*(-3 + 2*z))*sdx4
385  -6*(-1 + x)*x*y12*y*z2*(-3 + 2*z)*sdy4
386  +6*(-1 + x)*x*y12*(1 + 2*y)*(-1 + z)*z2*sdz4
387  -((1 - 4*x + 3*x2)*y12*y*z2*(-3 + 2*z))*sdxy4
388  +6*(-1 + x)*x*y12*y*(-1 + z)*z2*sdyz4
389  +(1 - 4*x + 3*x2)*y12*(1 + 2*y)*(-1 + z)*z2*sdxz4
390  +(1 - 4*x + 3*x2)*y12*y*(-1 + z)*z2*sdxyz4
391  +6*(-1 + x)*x*y12*(1 + 2*y)*z2*(-3 + 2*z)*cd.node5()
392  -(x*(-2 + 3*x)*y12*(1 + 2*y)*z2*(-3 + 2*z))*sdx5
393  +6*(-1 + x)*x*y12*y*z2*(-3 + 2*z)*sdy5
394  -6*(-1 + x)*x*y12*(1 + 2*y)*(-1 + z)*z2*sdz5
395  -(x*(-2 + 3*x)*y12*y*z2*(-3 + 2*z))*sdxy5
396  -6*(-1 + x)*x*y12*y*(-1 + z)*z2*sdyz5
397  +x*(-2 + 3*x)*y12*(1 + 2*y)*(-1 + z)*z2*sdxz5
398  +x*(-2 + 3*x)*y12*y*(-1 + z)*z2*sdxyz5
399  -6*(-1 + x)*x*y2*(-3 + 2*y)*z2*(-3 + 2*z)*cd.node6()
400  +x*(-2 + 3*x)*y2*(-3 + 2*y)*z2*(-3 + 2*z)*sdx6
401  +6*(-1 + x)*x*(-1 + y)*y2*z2*(-3 + 2*z)*sdy6
402  +6*(-1 + x)*x*y2*(-3 + 2*y)*(-1 + z)*z2*sdz6
403  -(x*(-2 + 3*x)*(-1 + y)*y2*z2*(-3 + 2*z))*sdxy6
404  -6*(-1 + x)*x*(-1 + y)*y2*(-1 + z)*z2*sdyz6
405  -(x*(-2 + 3*x)*y2*(-3 + 2*y)*(-1 + z)*z2)*sdxz6
406  +x*(-2 + 3*x)*(-1 + y)*y2*(-1 + z)*z2*sdxyz6
407  +6*(-1 + x)*x*y2*(-3 + 2*y)*z2*(-3 + 2*z)*cd.node7()
408  +(1 - 4*x + 3*x2)*y2*(-3 + 2*y)*z2*(-3 + 2*z)*sdx7
409  -6*(-1 + x)*x*(-1 + y)*y2*z2*(-3 + 2*z)*sdy7
410  -6*(-1 + x)*x*y2*(-3 + 2*y)*(-1 + z)*z2*sdz7
411  -((1 - 4*x + 3*x2)*(-1 + y)*y2*z2*(-3 + 2*z))*sdxy7
412  +6*(-1 + x)*x*(-1 + y)*y2*(-1 + z)*z2*sdyz7
413  -((1 - 4*x + 3*x2)*y2*(-3 + 2*y)*(-1 + z)*z2)*sdxz7
414  +(1 - 4*x + 3*x2)*(-1 + y)*y2*(-1 + z)*z2*sdxyz7);
415 
416  derivs[1]=
417  static_cast<typename VECTOR2::value_type>(6*x12*(1 + 2*x)*(-1 + y)*y*z12*(1 + 2*z)*cd.node0()
418  +6*x12*x*(-1 + y)*y*z12*(1 + 2*z)*sdx0
419  +x12*(1 + 2*x)*(1 - 4*y + 3*y2)*z12*(1 + 2*z)*sdy0
420  +6*x12*(1 + 2*x)*(-1 + y)*y*z12*z*sdz0
421  +x12*x*(1 - 4*y + 3*y2)*z12*(1 + 2*z)*sdxy0
422  +x12*(1 + 2*x)*(1 - 4*y + 3*y2)*z12*z*sdyz0
423  +6*x12*x*(-1 + y)*y*z12*z*sdxz0
424  +x12*x*(1 - 4*y + 3*y2)*z12*z*sdxyz0
425  -6*x2*(-3 + 2*x)*(-1 + y)*y*z12*(1 + 2*z)*cd.node1()
426  +6*(-1 + x)*x2*(-1 + y)*y*z12*(1 + 2*z)*sdx1
427  -(x2*(-3 + 2*x)*(1 - 4*y + 3*y2)*z12*(1 + 2*z))*sdy1
428  -6*x2*(-3 + 2*x)*(-1 + y)*y*z12*z*sdz1
429  +(-1 + x)*x2*(1 - 4*y + 3*y2)*z12*(1 + 2*z)*sdxy1
430  -(x2*(-3 + 2*x)*(1 - 4*y + 3*y2)*z12*z)*sdyz1
431  +6*(-1 + x)*x2*(-1 + y)*y*z12*z*sdxz1
432  +(-1 + x)*x2*(1 - 4*y + 3*y2)*z12*z*sdxyz1
433  +6*x2*(-3 + 2*x)*(-1 + y)*y*z12*(1 + 2*z)*cd.node2()
434  -6*(-1 + x)*x2*(-1 + y)*y*z12*(1 + 2*z)*sdx2
435  -(x2*(-3 + 2*x)*y*(-2 + 3*y)*z12*(1 + 2*z))*sdy2
436  +6*x2*(-3 + 2*x)*(-1 + y)*y*z12*z*sdz2
437  +(-1 + x)*x2*y*(-2 + 3*y)*z12*(1 + 2*z)*sdxy2
438  -(x2*(-3 + 2*x)*y*(-2 + 3*y)*z12*z)*sdyz2
439  -6*(-1 + x)*x2*(-1 + y)*y*z12*z*sdxz2
440  +(-1 + x)*x2*y*(-2 + 3*y)*z12*z*sdxyz2
441  -6*x12*(1 + 2*x)*(-1 + y)*y*z12*(1 + 2*z)*cd.node3()
442  -6*x12*x*(-1 + y)*y*z12*(1 + 2*z)*sdx3
443  +x12*(1 + 2*x)*y*(-2 + 3*y)*z12*(1 + 2*z)*sdy3
444  -6*x12*(1 + 2*x)*(-1 + y)*y*z12*z*sdz3
445  +x12*x*y*(-2 + 3*y)*z12*(1 + 2*z)*sdxy3
446  +x12*(1 + 2*x)*y*(-2 + 3*y)*z12*z*sdyz3
447  -6*x12*x*(-1 + y)*y*z12*z*sdxz3
448  +x12*x*y*(-2 + 3*y)*z12*z*sdxyz3
449  -6*x12*(1 + 2*x)*(-1 + y)*y*z2*(-3 + 2*z)*cd.node4()
450  -6*x12*x*(-1 + y)*y*z2*(-3 + 2*z)*sdx4
451  -(x12*(1 + 2*x)*(1 - 4*y + 3*y2)*z2*(-3 + 2*z))*sdy4
452  +6*x12*(1 + 2*x)*(-1 + y)*y*(-1 + z)*z2*sdz4
453  -(x12*x*(1 - 4*y + 3*y2)*z2*(-3 + 2*z))*sdxy4
454  +x12*(1 + 2*x)*(1 - 4*y + 3*y2)*(-1 + z)*z2*sdyz4
455  +6*x12*x*(-1 + y)*y*(-1 + z)*z2*sdxz4
456  +x12*x*(1 - 4*y + 3*y2)*(-1 + z)*z2*sdxyz4
457  +6*x2*(-3 + 2*x)*(-1 + y)*y*z2*(-3 + 2*z)*cd.node5()
458  -6*(-1 + x)*x2*(-1 + y)*y*z2*(-3 + 2*z)*sdx5
459  +x2*(-3 + 2*x)*(1 - 4*y + 3*y2)*z2*(-3 + 2*z)*sdy5
460  -6*x2*(-3 + 2*x)*(-1 + y)*y*(-1 + z)*z2*sdz5
461  -((-1 + x)*x2*(1 - 4*y + 3*y2)*z2*(-3 + 2*z))*sdxy5
462  -(x2*(-3 + 2*x)*(1 - 4*y + 3*y2)*(-1 + z)*z2)*sdyz5
463  +6*(-1 + x)*x2*(-1 + y)*y*(-1 + z)*z2*sdxz5
464  +(-1 + x)*x2*(1 - 4*y + 3*y2)*(-1 + z)*z2*sdxyz5
465  -6*x2*(-3 + 2*x)*(-1 + y)*y*z2*(-3 + 2*z)*cd.node6()
466  +6*(-1 + x)*x2*(-1 + y)*y*z2*(-3 + 2*z)*sdx6
467  +x2*(-3 + 2*x)*y*(-2 + 3*y)*z2*(-3 + 2*z)*sdy6
468  +6*x2*(-3 + 2*x)*(-1 + y)*y*(-1 + z)*z2*sdz6
469  -((-1 + x)*x2*y*(-2 + 3*y)*z2*(-3 + 2*z))*sdxy6
470  -(x2*(-3 + 2*x)*y*(-2 + 3*y)*(-1 + z)*z2)*sdyz6
471  -6*(-1 + x)*x2*(-1 + y)*y*(-1 + z)*z2*sdxz6
472  +(-1 + x)*x2*y*(-2 + 3*y)*(-1 + z)*z2*sdxyz6
473  +6*x12*(1 + 2*x)*(-1 + y)*y*z2*(-3 + 2*z)*cd.node7()
474  +6*x12*x*(-1 + y)*y*z2*(-3 + 2*z)*sdx7
475  -(x12*(1 + 2*x)*y*(-2 + 3*y)*z2*(-3 + 2*z))*sdy7
476  -6*x12*(1 + 2*x)*(-1 + y)*y*(-1 + z)*z2*sdz7
477  -(x12*x*y*(-2 + 3*y)*z2*(-3 + 2*z))*sdxy7
478  +x12*(1 + 2*x)*y*(-2 + 3*y)*(-1 + z)*z2*sdyz7
479  -6*x12*x*(-1 + y)*y*(-1 + z)*z2*sdxz7
480  +x12*x*y*(-2 + 3*y)*(-1 + z)*z2*sdxyz7);
481 
482  derivs[2]=
483  static_cast<typename VECTOR2::value_type>(6*x12*(1 + 2*x)*y12*(1 + 2*y)*(-1 + z)*z*cd.node0()
484  +6*x12*x*y12*(1 + 2*y)*(-1 + z)*z*sdx0
485  +6*x12*(1 + 2*x)*y12*y*(-1 + z)*z*sdy0
486  +x12*(1 + 2*x)*y12*(1 + 2*y)*(1 - 4*z + 3*z2)*sdz0
487  +6*x12*x*y12*y*(-1 + z)*z*sdxy0
488  +x12*(1 + 2*x)*y12*y*(1 - 4*z + 3*z2)*sdyz0
489  +x12*x*y12*(1 + 2*y)*(1 - 4*z + 3*z2)*sdxz0
490  +x12*x*y12*y*(1 - 4*z + 3*z2)*sdxyz0
491  -6*x2*(-3 + 2*x)*y12*(1 + 2*y)*(-1 + z)*z*cd.node1()
492  +6*(-1 + x)*x2*y12*(1 + 2*y)*(-1 + z)*z*sdx1
493  -6*x2*(-3 + 2*x)*y12*y*(-1 + z)*z*sdy1
494  -(x2*(-3 + 2*x)*y12*(1 + 2*y)*(1 - 4*z + 3*z2))*sdz1
495  +6*(-1 + x)*x2*y12*y*(-1 + z)*z*sdxy1
496  -(x2*(-3 + 2*x)*y12*y*(1 - 4*z + 3*z2))*sdyz1
497  +(-1 + x)*x2*y12*(1 + 2*y)*(1 - 4*z + 3*z2)*sdxz1
498  +(-1 + x)*x2*y12*y*(1 - 4*z + 3*z2)*sdxyz1
499  +6*x2*(-3 + 2*x)*y2*(-3 + 2*y)*(-1 + z)*z*cd.node2()
500  -6*(-1 + x)*x2*y2*(-3 + 2*y)*(-1 + z)*z*sdx2
501  -6*x2*(-3 + 2*x)*(-1 + y)*y2*(-1 + z)*z*sdy2
502  +x2*(-3 + 2*x)*y2*(-3 + 2*y)*(1 - 4*z + 3*z2)*sdz2
503  +6*(-1 + x)*x2*(-1 + y)*y2*(-1 + z)*z*sdxy2
504  -(x2*(-3 + 2*x)*(-1 + y)*y2*(1 - 4*z + 3*z2))*sdyz2
505  -((-1 + x)*x2*y2*(-3 + 2*y)*(1 - 4*z + 3*z2))*sdxz2
506  +(-1 + x)*x2*(-1 + y)*y2*(1 - 4*z + 3*z2)*sdxyz2
507  -6*x12*(1 + 2*x)*y2*(-3 + 2*y)*(-1 + z)*z*cd.node3()
508  -6*x12*x*y2*(-3 + 2*y)*(-1 + z)*z*sdx3
509  +6*x12*(1 + 2*x)*(-1 + y)*y2*(-1 + z)*z*sdy3
510  -(x12*(1 + 2*x)*y2*(-3 + 2*y)*(1 - 4*z + 3*z2))*sdz3
511  +6*x12*x*(-1 + y)*y2*(-1 + z)*z*sdxy3
512  +x12*(1 + 2*x)*(-1 + y)*y2*(1 - 4*z + 3*z2)*sdyz3
513  -(x12*x*y2*(-3 + 2*y)*(1 - 4*z + 3*z2))*sdxz3
514  +x12*x*(-1 + y)*y2*(1 - 4*z + 3*z2)*sdxyz3
515  -6*x12*(1 + 2*x)*y12*(1 + 2*y)*(-1 + z)*z*cd.node4()
516  -6*x12*x*y12*(1 + 2*y)*(-1 + z)*z*sdx4
517  -6*x12*(1 + 2*x)*y12*y*(-1 + z)*z*sdy4
518  +x12*(1 + 2*x)*y12*(1 + 2*y)*z*(-2 + 3*z)*sdz4
519  -6*x12*x*y12*y*(-1 + z)*z*sdxy4
520  +x12*(1 + 2*x)*y12*y*z*(-2 + 3*z)*sdyz4
521  +x12*x*y12*(1 + 2*y)*z*(-2 + 3*z)*sdxz4
522  +x12*x*y12*y*z*(-2 + 3*z)*sdxyz4
523  +6*x2*(-3 + 2*x)*y12*(1 + 2*y)*(-1 + z)*z*cd.node5()
524  -6*(-1 + x)*x2*y12*(1 + 2*y)*(-1 + z)*z*sdx5
525  +6*x2*(-3 + 2*x)*y12*y*(-1 + z)*z*sdy5
526  -(x2*(-3 + 2*x)*y12*(1 + 2*y)*z*(-2 + 3*z))*sdz5
527  -6*(-1 + x)*x2*y12*y*(-1 + z)*z*sdxy5
528  -(x2*(-3 + 2*x)*y12*y*z*(-2 + 3*z))*sdyz5
529  +(-1 + x)*x2*y12*(1 + 2*y)*z*(-2 + 3*z)*sdxz5
530  +(-1 + x)*x2*y12*y*z*(-2 + 3*z)*sdxyz5
531  -6*x2*(-3 + 2*x)*y2*(-3 + 2*y)*(-1 + z)*z*cd.node6()
532  +6*(-1 + x)*x2*y2*(-3 + 2*y)*(-1 + z)*z*sdx6
533  +6*x2*(-3 + 2*x)*(-1 + y)*y2*(-1 + z)*z*sdy6
534  +x2*(-3 + 2*x)*y2*(-3 + 2*y)*z*(-2 + 3*z)*sdz6
535  -6*(-1 + x)*x2*(-1 + y)*y2*(-1 + z)*z*sdxy6
536  -(x2*(-3 + 2*x)*(-1 + y)*y2*z*(-2 + 3*z))*sdyz6
537  -((-1 + x)*x2*y2*(-3 + 2*y)*z*(-2 + 3*z))*sdxz6
538  +(-1 + x)*x2*(-1 + y)*y2*z*(-2 + 3*z)*sdxyz6
539  +6*x12*(1 + 2*x)*y2*(-3 + 2*y)*(-1 + z)*z*cd.node7()
540  +6*x12*x*y2*(-3 + 2*y)*(-1 + z)*z*sdx7
541  -6*x12*(1 + 2*x)*(-1 + y)*y2*(-1 + z)*z*sdy7
542  -(x12*(1 + 2*x)*y2*(-3 + 2*y)*z*(-2 + 3*z))*sdz7
543  -6*x12*x*(-1 + y)*y2*(-1 + z)*z*sdxy7
544  +x12*(1 + 2*x)*(-1 + y)*y2*z*(-2 + 3*z)*sdyz7
545  -(x12*x*y2*(-3 + 2*y)*z*(-2 + 3*z))*sdxz7
546  +x12*x*(-1 + y)*y2*z*(-2 + 3*z)*sdxyz7);
547  }
548 
549  /// get parametric coordinate for value within the element
550  template <class ElemData, class VECTOR>
551  bool get_coords(VECTOR &coords, const T& value,
552  const ElemData &cd) const
553  {
555  return CL.get_coords(this, coords, value, cd);
556  }
557 
558  /// get arc length for edge
559  template <class ElemData>
560  double get_arc_length(const unsigned edge, const ElemData &cd) const
561  {
562  return get_arc3d_length<CrvGaussian2<double> >(this, edge, cd);
563  }
564 
565  /// get area
566  template <class ElemData>
567  double get_area(const unsigned face, const ElemData &cd) const
568  {
569  return get_area3<QuadGaussian3<double> >(this, face, cd);
570  }
571 
572  /// get volume
573  template <class ElemData>
574  double get_volume(const ElemData & cd) const
575  {
576  return get_volume3(this, cd);
577  }
578  static const std::string type_name(int n = -1);
579 
580  virtual void io (Piostream& str);
581 
582 };
583 
584 template <class T>
585 const std::string
587 {
588  ASSERT((n >= -1) && n <= 1);
589  if (n == -1)
590  {
591  static const std::string name = TypeNameGenerator::make_template_id(type_name(0), type_name(1));
592  return name;
593  }
594  else if (n == 0)
595  {
596  static const std::string nm("HexTricubicHmtScaleFactorsEdges");
597  return nm;
598  } else {
599  return find_type_name((T *)0);
600  }
601 }
602 
603 
604 
605 
606 
607 
608 }}
609 template <class T>
610 const TypeDescription*
612 {
613  static TypeDescription* td = 0;
614  if(!td){
615  const TypeDescription *sub = get_type_description((T*)0);
617  (*subs)[0] = sub;
618  td = new TypeDescription("HexTricubicHmtScaleFactorsEdges",
619  subs,
620  std::string(__FILE__),
621  "SCIRun",
623  }
624  return td;
625 }
626 
628 template <class T>
629 void
631 {
632  stream.begin_class(get_type_description(this)->get_name(),
634  Pio(stream, this->derivs_);
635  Pio(stream, this->scalefactorse_);
636  stream.end_class();
637 }
638 }
639 
640 #endif
virtual ~HexTricubicHmtScaleFactorsEdgesUnitElement()
Definition: HexTricubicHmtScaleFactorsEdges.h:47
void get_cubic_derivate_weights(const VECTOR &coords, unsigned int elem, double *w) const
get derivative weight factors at parametric coordinate
Definition: HexElementsWeights.h:262
const int HEXTRICUBICHMTSCALEFACTORSEDGES_VERSION
Definition: HexTricubicHmtScaleFactorsEdges.h:627
Definition: HexElementsWeights.h:36
Definition: Persistent.h:89
Class for describing unit geometry of HexTricubicHmtScaleFactorsEdges.
Definition: HexTricubicHmtScaleFactorsEdges.h:43
Definition: HexTricubicHmtScaleFactorsEdges.h:56
Definition: TypeDescription.h:45
std::vector< const TypeDescription * > td_vec
Definition: TypeDescription.h:56
Class for creating geometrical approximations of Hex meshes.
Definition: HexTrilinearLgn.h:112
#define ASSERT(condition)
Definition: Assert.h:110
void get_derivate_weights(const VECTOR &coords, double *w) const
Definition: HexTricubicHmtScaleFactorsEdges.h:77
virtual int begin_class(const std::string &name, int current_version)
Definition: Persistent.cc:143
const string find_type_name(float *)
Definition: TypeName.cc:63
Class with weights and coordinates for 3rd order Gaussian integration.
Definition: HexTrilinearLgn.h:331
T value_type
Definition: HexTricubicHmtScaleFactorsEdges.h:64
const char * name[]
Definition: BoostGraphExampleTests.cc:87
HexTricubicHmtScaleFactorsEdgesUnitElement()
Definition: HexTricubicHmtScaleFactorsEdges.h:46
Persistent i/o for STL containers.
static int dofs()
return degrees of freedom
Definition: HexTricubicHmtScaleFactorsEdges.h:49
HexTricubicHmtScaleFactorsEdges()
Definition: HexTricubicHmtScaleFactorsEdges.h:66
static const std::string make_template_id(const std::string &templateName, const std::string &templateParam)
Definition: TypeName.h:62
virtual void io(Piostream &str)
Definition: HexTricubicHmtScaleFactorsEdges.h:630
void get_cubic_weights(const VECTOR &coords, unsigned int elem, double *w) const
Definition: HexElementsWeights.h:184
void derivate(const VECTOR1 &coords, const ElemData &cd, VECTOR2 &derivs) const
get first derivative at parametric coordinate
Definition: HexTricubicHmtScaleFactorsEdges.h:247
std::vector< double > scalefactorse_
Definition: Basis.h:162
void Pio(Piostream &stream, Array1< T > &array)
Definition: Array1.h:65
std::vector< std::vector< T > > derivs_
Definition: Basis.h:160
virtual void end_class()
Definition: Persistent.cc:178
void get_weights(const VECTOR &coords, double *w) const
Definition: HexTricubicHmtScaleFactorsEdges.h:73
Definition: HexSamplingSchemes.h:43
Definition: HexTrilinearLgn.h:197
int n
Definition: eab.py:9
double get_arc_length(const unsigned edge, const ElemData &cd) const
get arc length for edge
Definition: HexTricubicHmtScaleFactorsEdges.h:560
bool get_coords(const ElemBasis *pEB, VECTOR &coords, const T &value, const ElemData &cd) const
find value in interpolation for given value
Definition: HexTrilinearLgn.h:206
double get_volume3(const ElemBasis *pEB, const ElemData &cd)
Definition: Locate.h:179
double get_area(const unsigned face, const ElemData &cd) const
get area
Definition: HexTricubicHmtScaleFactorsEdges.h:567
bool get_coords(VECTOR &coords, const T &value, const ElemData &cd) const
get parametric coordinate for value within the element
Definition: HexTricubicHmtScaleFactorsEdges.h:551
double get_volume(const ElemData &cd) const
get volume
Definition: HexTricubicHmtScaleFactorsEdges.h:574
static const std::string type_name(int n=-1)
Definition: HexTricubicHmtScaleFactorsEdges.h:586
virtual ~HexTricubicHmtScaleFactorsEdges()
Definition: HexTricubicHmtScaleFactorsEdges.h:67
static int polynomial_order()
Definition: HexTricubicHmtScaleFactorsEdges.h:69
Class for describing unit geometry of HexTrilinearLgn.
Definition: HexTrilinearLgn.h:49
Definition: TypeDescription.h:49
const TypeDescription * get_type_description(Core::Basis::ConstantBasis< T > *)
Definition: Constant.h:209
T interpolate(const VECTOR &coords, const ElemData &cd) const
get value at parametric coordinate
Definition: HexTricubicHmtScaleFactorsEdges.h:82