SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HexTricubicHmtScaleFactors.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 HexTricubicHmtScaleFactors.h
29 /// @author Martin Cole, Frank B. Sachse
30 /// @date Mar 1 2005
31 
32 #ifndef CORE_BASIS_HEXTRICUBICHMTSCALEFACTORS_H
33 #define CORE_BASIS_HEXTRICUBICHMTSCALEFACTORS_H 1
34 
37 
38 namespace SCIRun {
39 namespace Core {
40 namespace Basis {
41 
42 /// Class for describing unit geometry of HexTricubicHmtScaleFactors
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  template<class VECTOR>
72  inline void get_weights(const VECTOR& coords, double *w) const
73  { get_cubic_weights(coords,w); }
74 
75  template<class VECTOR>
76  inline void get_derivate_weights(const VECTOR& coords, double *w) const
77  { get_cubic_derivate_weights(coords,w); }
78 
79  /// get value at parametric coordinate
80  template <class ElemData, class VECTOR>
81  T interpolate(const VECTOR &coords, const ElemData &cd) const
82  {
83  double w[64];
84  get_cubic_weights(coords, w);
85 
86  const double &sx0=this->scalefactors_[cd.node0_index()][0];
87  const double &sx1=this->scalefactors_[cd.node1_index()][0];
88  const double &sx2=this->scalefactors_[cd.node2_index()][0];
89  const double &sx3=this->scalefactors_[cd.node3_index()][0];
90  const double &sx4=this->scalefactors_[cd.node4_index()][0];
91  const double &sx5=this->scalefactors_[cd.node5_index()][0];
92  const double &sx6=this->scalefactors_[cd.node6_index()][0];
93  const double &sx7=this->scalefactors_[cd.node7_index()][0];
94 
95  const double &sy0=this->scalefactors_[cd.node0_index()][1];
96  const double &sy1=this->scalefactors_[cd.node1_index()][1];
97  const double &sy2=this->scalefactors_[cd.node2_index()][1];
98  const double &sy3=this->scalefactors_[cd.node3_index()][1];
99  const double &sy4=this->scalefactors_[cd.node4_index()][1];
100  const double &sy5=this->scalefactors_[cd.node5_index()][1];
101  const double &sy6=this->scalefactors_[cd.node6_index()][1];
102  const double &sy7=this->scalefactors_[cd.node7_index()][1];
103 
104  const double &sz0=this->scalefactors_[cd.node0_index()][2];
105  const double &sz1=this->scalefactors_[cd.node1_index()][2];
106  const double &sz2=this->scalefactors_[cd.node2_index()][2];
107  const double &sz3=this->scalefactors_[cd.node3_index()][2];
108  const double &sz4=this->scalefactors_[cd.node4_index()][2];
109  const double &sz5=this->scalefactors_[cd.node5_index()][2];
110  const double &sz6=this->scalefactors_[cd.node6_index()][2];
111  const double &sz7=this->scalefactors_[cd.node7_index()][2];
112 
113  const T sdx0=this->derivs_[cd.node0_index()][0]*sx0;
114  const T sdx1=this->derivs_[cd.node1_index()][0]*sx1;
115  const T sdx2=this->derivs_[cd.node2_index()][0]*sx2;
116  const T sdx3=this->derivs_[cd.node3_index()][0]*sx3;
117  const T sdx4=this->derivs_[cd.node4_index()][0]*sx4;
118  const T sdx5=this->derivs_[cd.node5_index()][0]*sx5;
119  const T sdx6=this->derivs_[cd.node6_index()][0]*sx6;
120  const T sdx7=this->derivs_[cd.node7_index()][0]*sx7;
121 
122  const T sdy0=this->derivs_[cd.node0_index()][1]*sy0;
123  const T sdy1=this->derivs_[cd.node1_index()][1]*sy1;
124  const T sdy2=this->derivs_[cd.node2_index()][1]*sy2;
125  const T sdy3=this->derivs_[cd.node3_index()][1]*sy3;
126  const T sdy4=this->derivs_[cd.node4_index()][1]*sy4;
127  const T sdy5=this->derivs_[cd.node5_index()][1]*sy5;
128  const T sdy6=this->derivs_[cd.node6_index()][1]*sy6;
129  const T sdy7=this->derivs_[cd.node7_index()][1]*sy7;
130 
131  const T sdz0=this->derivs_[cd.node0_index()][2]*sz0;
132  const T sdz1=this->derivs_[cd.node1_index()][2]*sz1;
133  const T sdz2=this->derivs_[cd.node2_index()][2]*sz2;
134  const T sdz3=this->derivs_[cd.node3_index()][2]*sz3;
135  const T sdz4=this->derivs_[cd.node4_index()][2]*sz4;
136  const T sdz5=this->derivs_[cd.node5_index()][2]*sz5;
137  const T sdz6=this->derivs_[cd.node6_index()][2]*sz6;
138  const T sdz7=this->derivs_[cd.node7_index()][2]*sz7;
139 
140  const T sdxy0=this->derivs_[cd.node0_index()][3]*sx0*sy0;
141  const T sdxy1=this->derivs_[cd.node1_index()][3]*sx1*sy1;
142  const T sdxy2=this->derivs_[cd.node2_index()][3]*sx2*sy2;
143  const T sdxy3=this->derivs_[cd.node3_index()][3]*sx3*sy3;
144  const T sdxy4=this->derivs_[cd.node4_index()][3]*sx4*sy4;
145  const T sdxy5=this->derivs_[cd.node5_index()][3]*sx5*sy5;
146  const T sdxy6=this->derivs_[cd.node6_index()][3]*sx6*sy6;
147  const T sdxy7=this->derivs_[cd.node7_index()][3]*sx7*sy7;
148 
149  const T sdyz0=this->derivs_[cd.node0_index()][4]*sy0*sz0;
150  const T sdyz1=this->derivs_[cd.node1_index()][4]*sy1*sz1;
151  const T sdyz2=this->derivs_[cd.node2_index()][4]*sy2*sz2;
152  const T sdyz3=this->derivs_[cd.node3_index()][4]*sy3*sz3;
153  const T sdyz4=this->derivs_[cd.node4_index()][4]*sy4*sz4;
154  const T sdyz5=this->derivs_[cd.node5_index()][4]*sy5*sz5;
155  const T sdyz6=this->derivs_[cd.node6_index()][4]*sy6*sz6;
156  const T sdyz7=this->derivs_[cd.node7_index()][4]*sy7*sz7;
157 
158  const T sdxz0=this->derivs_[cd.node0_index()][5]*sx0*sz0;
159  const T sdxz1=this->derivs_[cd.node1_index()][5]*sx1*sz1;
160  const T sdxz2=this->derivs_[cd.node2_index()][5]*sx2*sz2;
161  const T sdxz3=this->derivs_[cd.node3_index()][5]*sx3*sz3;
162  const T sdxz4=this->derivs_[cd.node4_index()][5]*sx4*sz4;
163  const T sdxz5=this->derivs_[cd.node5_index()][5]*sx5*sz5;
164  const T sdxz6=this->derivs_[cd.node6_index()][5]*sx6*sz6;
165  const T sdxz7=this->derivs_[cd.node7_index()][5]*sx7*sz7;
166 
167  const T sdxyz0=this->derivs_[cd.node0_index()][6]*sx0*sy0*sz0;
168  const T sdxyz1=this->derivs_[cd.node1_index()][6]*sx1*sy1*sz1;
169  const T sdxyz2=this->derivs_[cd.node2_index()][6]*sx2*sy2*sz2;
170  const T sdxyz3=this->derivs_[cd.node3_index()][6]*sx3*sy3*sz3;
171  const T sdxyz4=this->derivs_[cd.node4_index()][6]*sx4*sy4*sz4;
172  const T sdxyz5=this->derivs_[cd.node5_index()][6]*sx5*sy5*sz5;
173  const T sdxyz6=this->derivs_[cd.node6_index()][6]*sx6*sy6*sz6;
174  const T sdxyz7=this->derivs_[cd.node7_index()][6]*sx7*sy7*sz7;
175 
176  return (T)(
177  w[0] * cd.node0()+
178  w[1] * sdx0 +
179  w[2] * sdy0 +
180  w[3] * sdz0 +
181  w[4] * sdxy0 +
182  w[5] * sdyz0 +
183  w[6] * sdxz0 +
184  w[7] * sdxyz0 +
185  w[8] * cd.node1()+
186  w[9] * sdx1 +
187  w[10] * sdy1 +
188  w[11] * sdz1 +
189  w[12] * sdxy1 +
190  w[13] * sdyz1 +
191  w[14] * sdxz1 +
192  w[15] * sdxyz1 +
193  w[16] * cd.node2()+
194  w[17] * sdx2 +
195  w[18] * sdy2 +
196  w[19] * sdz2 +
197  w[20] * sdxy2 +
198  w[21] * sdyz2 +
199  w[22] * sdxz2 +
200  w[23] * sdxyz2 +
201  w[24] * cd.node3()+
202  w[25] * sdx3 +
203  w[26] * sdy3 +
204  w[27] * sdz3 +
205  w[28] * sdxy3 +
206  w[29] * sdyz3 +
207  w[30] * sdxz3 +
208  w[31] * sdxyz3 +
209  w[32] * cd.node4()+
210  w[33] * sdx4 +
211  w[34] * sdy4 +
212  w[35] * sdz4 +
213  w[36] * sdxy4 +
214  w[37] * sdyz4 +
215  w[38] * sdxz4 +
216  w[39] * sdxyz4 +
217  w[40] * cd.node5()+
218  w[41] * sdx5 +
219  w[42] * sdy5 +
220  w[43] * sdz5 +
221  w[44] * sdxy5 +
222  w[45] * sdyz5 +
223  w[46] * sdxz5 +
224  w[47] * sdxyz5 +
225  w[48] * cd.node6()+
226  w[49] * sdx6 +
227  w[50] * sdy6 +
228  w[51] * sdz6 +
229  w[52] * sdxy6 +
230  w[53] * sdyz6 +
231  w[54] * sdxz6 +
232  w[55] * sdxyz6 +
233  w[56] * cd.node7()+
234  w[57] * sdx7 +
235  w[58] * sdy7 +
236  w[59] * sdz7 +
237  w[60] * sdxy7 +
238  w[61] * sdyz7 +
239  w[62] * sdxz7 +
240  w[63] * sdxyz7);
241  }
242 
243  /// get first derivative at parametric coordinate
244  template <class ElemData, class VECTOR1, class VECTOR2>
245  void derivate(const VECTOR1 &coords, const ElemData &cd,
246  VECTOR2 &derivs) const
247  {
248  const double x=coords[0], y=coords[1], z=coords[2];
249  const double x2=x*x;
250  const double y2=y*y;
251  const double z2=z*z;
252  const double x12=(x-1)*(x-1);
253  const double y12=(y-1)*(y-1);
254  const double z12=(z-1)*(z-1);
255 
256  derivs.resize(3);
257 
258  const double &sx0=this->scalefactors_[cd.node0_index()][0];
259  const double &sx1=this->scalefactors_[cd.node1_index()][0];
260  const double &sx2=this->scalefactors_[cd.node2_index()][0];
261  const double &sx3=this->scalefactors_[cd.node3_index()][0];
262  const double &sx4=this->scalefactors_[cd.node4_index()][0];
263  const double &sx5=this->scalefactors_[cd.node5_index()][0];
264  const double &sx6=this->scalefactors_[cd.node6_index()][0];
265  const double &sx7=this->scalefactors_[cd.node7_index()][0];
266 
267  const double &sy0=this->scalefactors_[cd.node0_index()][1];
268  const double &sy1=this->scalefactors_[cd.node1_index()][1];
269  const double &sy2=this->scalefactors_[cd.node2_index()][1];
270  const double &sy3=this->scalefactors_[cd.node3_index()][1];
271  const double &sy4=this->scalefactors_[cd.node4_index()][1];
272  const double &sy5=this->scalefactors_[cd.node5_index()][1];
273  const double &sy6=this->scalefactors_[cd.node6_index()][1];
274  const double &sy7=this->scalefactors_[cd.node7_index()][1];
275 
276  const double &sz0=this->scalefactors_[cd.node0_index()][2];
277  const double &sz1=this->scalefactors_[cd.node1_index()][2];
278  const double &sz2=this->scalefactors_[cd.node2_index()][2];
279  const double &sz3=this->scalefactors_[cd.node3_index()][2];
280  const double &sz4=this->scalefactors_[cd.node4_index()][2];
281  const double &sz5=this->scalefactors_[cd.node5_index()][2];
282  const double &sz6=this->scalefactors_[cd.node6_index()][2];
283  const double &sz7=this->scalefactors_[cd.node7_index()][2];
284 
285  const T sdx0=this->derivs_[cd.node0_index()][0]*sx0;
286  const T sdx1=this->derivs_[cd.node1_index()][0]*sx1;
287  const T sdx2=this->derivs_[cd.node2_index()][0]*sx2;
288  const T sdx3=this->derivs_[cd.node3_index()][0]*sx3;
289  const T sdx4=this->derivs_[cd.node4_index()][0]*sx4;
290  const T sdx5=this->derivs_[cd.node5_index()][0]*sx5;
291  const T sdx6=this->derivs_[cd.node6_index()][0]*sx6;
292  const T sdx7=this->derivs_[cd.node7_index()][0]*sx7;
293 
294  const T sdy0=this->derivs_[cd.node0_index()][1]*sy0;
295  const T sdy1=this->derivs_[cd.node1_index()][1]*sy1;
296  const T sdy2=this->derivs_[cd.node2_index()][1]*sy2;
297  const T sdy3=this->derivs_[cd.node3_index()][1]*sy3;
298  const T sdy4=this->derivs_[cd.node4_index()][1]*sy4;
299  const T sdy5=this->derivs_[cd.node5_index()][1]*sy5;
300  const T sdy6=this->derivs_[cd.node6_index()][1]*sy6;
301  const T sdy7=this->derivs_[cd.node7_index()][1]*sy7;
302 
303  const T sdz0=this->derivs_[cd.node0_index()][2]*sz0;
304  const T sdz1=this->derivs_[cd.node1_index()][2]*sz1;
305  const T sdz2=this->derivs_[cd.node2_index()][2]*sz2;
306  const T sdz3=this->derivs_[cd.node3_index()][2]*sz3;
307  const T sdz4=this->derivs_[cd.node4_index()][2]*sz4;
308  const T sdz5=this->derivs_[cd.node5_index()][2]*sz5;
309  const T sdz6=this->derivs_[cd.node6_index()][2]*sz6;
310  const T sdz7=this->derivs_[cd.node7_index()][2]*sz7;
311 
312  const T sdxy0=this->derivs_[cd.node0_index()][3]*sx0*sy0;
313  const T sdxy1=this->derivs_[cd.node1_index()][3]*sx1*sy1;
314  const T sdxy2=this->derivs_[cd.node2_index()][3]*sx2*sy2;
315  const T sdxy3=this->derivs_[cd.node3_index()][3]*sx3*sy3;
316  const T sdxy4=this->derivs_[cd.node4_index()][3]*sx4*sy4;
317  const T sdxy5=this->derivs_[cd.node5_index()][3]*sx5*sy5;
318  const T sdxy6=this->derivs_[cd.node6_index()][3]*sx6*sy6;
319  const T sdxy7=this->derivs_[cd.node7_index()][3]*sx7*sy7;
320 
321  const T sdyz0=this->derivs_[cd.node0_index()][4]*sy0*sz0;
322  const T sdyz1=this->derivs_[cd.node1_index()][4]*sy1*sz1;
323  const T sdyz2=this->derivs_[cd.node2_index()][4]*sy2*sz2;
324  const T sdyz3=this->derivs_[cd.node3_index()][4]*sy3*sz3;
325  const T sdyz4=this->derivs_[cd.node4_index()][4]*sy4*sz4;
326  const T sdyz5=this->derivs_[cd.node5_index()][4]*sy5*sz5;
327  const T sdyz6=this->derivs_[cd.node6_index()][4]*sy6*sz6;
328  const T sdyz7=this->derivs_[cd.node7_index()][4]*sy7*sz7;
329 
330  const T sdxz0=this->derivs_[cd.node0_index()][5]*sx0*sz0;
331  const T sdxz1=this->derivs_[cd.node1_index()][5]*sx1*sz1;
332  const T sdxz2=this->derivs_[cd.node2_index()][5]*sx2*sz2;
333  const T sdxz3=this->derivs_[cd.node3_index()][5]*sx3*sz3;
334  const T sdxz4=this->derivs_[cd.node4_index()][5]*sx4*sz4;
335  const T sdxz5=this->derivs_[cd.node5_index()][5]*sx5*sz5;
336  const T sdxz6=this->derivs_[cd.node6_index()][5]*sx6*sz6;
337  const T sdxz7=this->derivs_[cd.node7_index()][5]*sx7*sz7;
338 
339  const T sdxyz0=this->derivs_[cd.node0_index()][6]*sx0*sy0*sz0;
340  const T sdxyz1=this->derivs_[cd.node1_index()][6]*sx1*sy1*sz1;
341  const T sdxyz2=this->derivs_[cd.node2_index()][6]*sx2*sy2*sz2;
342  const T sdxyz3=this->derivs_[cd.node3_index()][6]*sx3*sy3*sz3;
343  const T sdxyz4=this->derivs_[cd.node4_index()][6]*sx4*sy4*sz4;
344  const T sdxyz5=this->derivs_[cd.node5_index()][6]*sx5*sy5*sz5;
345  const T sdxyz6=this->derivs_[cd.node6_index()][6]*sx6*sy6*sz6;
346  const T sdxyz7=this->derivs_[cd.node7_index()][6]*sx7*sy7*sz7;
347 
348  derivs[0]=
349  static_cast<typename VECTOR2::value_type>(6*(-1 + x)*x*y12*(1 + 2*y)*z12*(1 + 2*z)*cd.node0()
350  +(1 - 4*x + 3*x2)*y12*(1 + 2*y)*z12*(1 + 2*z)*sdx0
351  +6*(-1 + x)*x*y12*y*z12*(1 + 2*z)*sdy0
352  +6*(-1 + x)*x*y12*(1 + 2*y)*z12*z*sdz0
353  +(1 - 4*x + 3*x2)*y12*y*z12*(1 + 2*z)*sdxy0
354  +6*(-1 + x)*x*y12*y*z12*z*sdyz0
355  +(1 - 4*x + 3*x2)*y12*(1 + 2*y)*z12*z*sdxz0
356  +(1 - 4*x + 3*x2)*y12*y*z12*z*sdxyz0
357  -6*(-1 + x)*x*y12*(1 + 2*y)*z12*(1 + 2*z)*cd.node1()
358  +x*(-2 + 3*x)*y12*(1 + 2*y)*z12*(1 + 2*z)*sdx1
359  -6*(-1 + x)*x*y12*y*z12*(1 + 2*z)*sdy1
360  -6*(-1 + x)*x*y12*(1 + 2*y)*z12*z*sdz1
361  +x*(-2 + 3*x)*y12*y*z12*(1 + 2*z)*sdxy1
362  -6*(-1 + x)*x*y12*y*z12*z*sdyz1
363  +x*(-2 + 3*x)*y12*(1 + 2*y)*z12*z*sdxz1
364  +x*(-2 + 3*x)*y12*y*z12*z*sdxyz1
365  +6*(-1 + x)*x*y2*(-3 + 2*y)*z12*(1 + 2*z)*cd.node2()
366  -(x*(-2 + 3*x)*y2*(-3 + 2*y)*z12*(1 + 2*z))*sdx2
367  -6*(-1 + x)*x*(-1 + y)*y2*z12*(1 + 2*z)*sdy2
368  +6*(-1 + x)*x*y2*(-3 + 2*y)*z12*z*sdz2
369  +x*(-2 + 3*x)*(-1 + y)*y2*z12*(1 + 2*z)*sdxy2
370  -6*(-1 + x)*x*(-1 + y)*y2*z12*z*sdyz2
371  -(x*(-2 + 3*x)*y2*(-3 + 2*y)*z12*z)*sdxz2
372  +x*(-2 + 3*x)*(-1 + y)*y2*z12*z*sdxyz2
373  -6*(-1 + x)*x*y2*(-3 + 2*y)*z12*(1 + 2*z)*cd.node3()
374  -((1 - 4*x + 3*x2)*y2*(-3 + 2*y)*z12*(1 + 2*z))*sdx3
375  +6*(-1 + x)*x*(-1 + y)*y2*z12*(1 + 2*z)*sdy3
376  -6*(-1 + x)*x*y2*(-3 + 2*y)*z12*z*sdz3
377  +(1 - 4*x + 3*x2)*(-1 + y)*y2*z12*(1 + 2*z)*sdxy3
378  +6*(-1 + x)*x*(-1 + y)*y2*z12*z*sdyz3
379  -((1 - 4*x + 3*x2)*y2*(-3 + 2*y)*z12*z)*sdxz3
380  +(1 - 4*x + 3*x2)*(-1 + y)*y2*z12*z*sdxyz3
381  -6*(-1 + x)*x*y12*(1 + 2*y)*z2*(-3 + 2*z)*cd.node4()
382  -((1 - 4*x + 3*x2)*y12*(1 + 2*y)*z2*(-3 + 2*z))*sdx4
383  -6*(-1 + x)*x*y12*y*z2*(-3 + 2*z)*sdy4
384  +6*(-1 + x)*x*y12*(1 + 2*y)*(-1 + z)*z2*sdz4
385  -((1 - 4*x + 3*x2)*y12*y*z2*(-3 + 2*z))*sdxy4
386  +6*(-1 + x)*x*y12*y*(-1 + z)*z2*sdyz4
387  +(1 - 4*x + 3*x2)*y12*(1 + 2*y)*(-1 + z)*z2*sdxz4
388  +(1 - 4*x + 3*x2)*y12*y*(-1 + z)*z2*sdxyz4
389  +6*(-1 + x)*x*y12*(1 + 2*y)*z2*(-3 + 2*z)*cd.node5()
390  -(x*(-2 + 3*x)*y12*(1 + 2*y)*z2*(-3 + 2*z))*sdx5
391  +6*(-1 + x)*x*y12*y*z2*(-3 + 2*z)*sdy5
392  -6*(-1 + x)*x*y12*(1 + 2*y)*(-1 + z)*z2*sdz5
393  -(x*(-2 + 3*x)*y12*y*z2*(-3 + 2*z))*sdxy5
394  -6*(-1 + x)*x*y12*y*(-1 + z)*z2*sdyz5
395  +x*(-2 + 3*x)*y12*(1 + 2*y)*(-1 + z)*z2*sdxz5
396  +x*(-2 + 3*x)*y12*y*(-1 + z)*z2*sdxyz5
397  -6*(-1 + x)*x*y2*(-3 + 2*y)*z2*(-3 + 2*z)*cd.node6()
398  +x*(-2 + 3*x)*y2*(-3 + 2*y)*z2*(-3 + 2*z)*sdx6
399  +6*(-1 + x)*x*(-1 + y)*y2*z2*(-3 + 2*z)*sdy6
400  +6*(-1 + x)*x*y2*(-3 + 2*y)*(-1 + z)*z2*sdz6
401  -(x*(-2 + 3*x)*(-1 + y)*y2*z2*(-3 + 2*z))*sdxy6
402  -6*(-1 + x)*x*(-1 + y)*y2*(-1 + z)*z2*sdyz6
403  -(x*(-2 + 3*x)*y2*(-3 + 2*y)*(-1 + z)*z2)*sdxz6
404  +x*(-2 + 3*x)*(-1 + y)*y2*(-1 + z)*z2*sdxyz6
405  +6*(-1 + x)*x*y2*(-3 + 2*y)*z2*(-3 + 2*z)*cd.node7()
406  +(1 - 4*x + 3*x2)*y2*(-3 + 2*y)*z2*(-3 + 2*z)*sdx7
407  -6*(-1 + x)*x*(-1 + y)*y2*z2*(-3 + 2*z)*sdy7
408  -6*(-1 + x)*x*y2*(-3 + 2*y)*(-1 + z)*z2*sdz7
409  -((1 - 4*x + 3*x2)*(-1 + y)*y2*z2*(-3 + 2*z))*sdxy7
410  +6*(-1 + x)*x*(-1 + y)*y2*(-1 + z)*z2*sdyz7
411  -((1 - 4*x + 3*x2)*y2*(-3 + 2*y)*(-1 + z)*z2)*sdxz7
412  +(1 - 4*x + 3*x2)*(-1 + y)*y2*(-1 + z)*z2*sdxyz7);
413 
414  derivs[1]=
415  static_cast<typename VECTOR2::value_type>(6*x12*(1 + 2*x)*(-1 + y)*y*z12*(1 + 2*z)*cd.node0()
416  +6*x12*x*(-1 + y)*y*z12*(1 + 2*z)*sdx0
417  +x12*(1 + 2*x)*(1 - 4*y + 3*y2)*z12*(1 + 2*z)*sdy0
418  +6*x12*(1 + 2*x)*(-1 + y)*y*z12*z*sdz0
419  +x12*x*(1 - 4*y + 3*y2)*z12*(1 + 2*z)*sdxy0
420  +x12*(1 + 2*x)*(1 - 4*y + 3*y2)*z12*z*sdyz0
421  +6*x12*x*(-1 + y)*y*z12*z*sdxz0
422  +x12*x*(1 - 4*y + 3*y2)*z12*z*sdxyz0
423  -6*x2*(-3 + 2*x)*(-1 + y)*y*z12*(1 + 2*z)*cd.node1()
424  +6*(-1 + x)*x2*(-1 + y)*y*z12*(1 + 2*z)*sdx1
425  -(x2*(-3 + 2*x)*(1 - 4*y + 3*y2)*z12*(1 + 2*z))*sdy1
426  -6*x2*(-3 + 2*x)*(-1 + y)*y*z12*z*sdz1
427  +(-1 + x)*x2*(1 - 4*y + 3*y2)*z12*(1 + 2*z)*sdxy1
428  -(x2*(-3 + 2*x)*(1 - 4*y + 3*y2)*z12*z)*sdyz1
429  +6*(-1 + x)*x2*(-1 + y)*y*z12*z*sdxz1
430  +(-1 + x)*x2*(1 - 4*y + 3*y2)*z12*z*sdxyz1
431  +6*x2*(-3 + 2*x)*(-1 + y)*y*z12*(1 + 2*z)*cd.node2()
432  -6*(-1 + x)*x2*(-1 + y)*y*z12*(1 + 2*z)*sdx2
433  -(x2*(-3 + 2*x)*y*(-2 + 3*y)*z12*(1 + 2*z))*sdy2
434  +6*x2*(-3 + 2*x)*(-1 + y)*y*z12*z*sdz2
435  +(-1 + x)*x2*y*(-2 + 3*y)*z12*(1 + 2*z)*sdxy2
436  -(x2*(-3 + 2*x)*y*(-2 + 3*y)*z12*z)*sdyz2
437  -6*(-1 + x)*x2*(-1 + y)*y*z12*z*sdxz2
438  +(-1 + x)*x2*y*(-2 + 3*y)*z12*z*sdxyz2
439  -6*x12*(1 + 2*x)*(-1 + y)*y*z12*(1 + 2*z)*cd.node3()
440  -6*x12*x*(-1 + y)*y*z12*(1 + 2*z)*sdx3
441  +x12*(1 + 2*x)*y*(-2 + 3*y)*z12*(1 + 2*z)*sdy3
442  -6*x12*(1 + 2*x)*(-1 + y)*y*z12*z*sdz3
443  +x12*x*y*(-2 + 3*y)*z12*(1 + 2*z)*sdxy3
444  +x12*(1 + 2*x)*y*(-2 + 3*y)*z12*z*sdyz3
445  -6*x12*x*(-1 + y)*y*z12*z*sdxz3
446  +x12*x*y*(-2 + 3*y)*z12*z*sdxyz3
447  -6*x12*(1 + 2*x)*(-1 + y)*y*z2*(-3 + 2*z)*cd.node4()
448  -6*x12*x*(-1 + y)*y*z2*(-3 + 2*z)*sdx4
449  -(x12*(1 + 2*x)*(1 - 4*y + 3*y2)*z2*(-3 + 2*z))*sdy4
450  +6*x12*(1 + 2*x)*(-1 + y)*y*(-1 + z)*z2*sdz4
451  -(x12*x*(1 - 4*y + 3*y2)*z2*(-3 + 2*z))*sdxy4
452  +x12*(1 + 2*x)*(1 - 4*y + 3*y2)*(-1 + z)*z2*sdyz4
453  +6*x12*x*(-1 + y)*y*(-1 + z)*z2*sdxz4
454  +x12*x*(1 - 4*y + 3*y2)*(-1 + z)*z2*sdxyz4
455  +6*x2*(-3 + 2*x)*(-1 + y)*y*z2*(-3 + 2*z)*cd.node5()
456  -6*(-1 + x)*x2*(-1 + y)*y*z2*(-3 + 2*z)*sdx5
457  +x2*(-3 + 2*x)*(1 - 4*y + 3*y2)*z2*(-3 + 2*z)*sdy5
458  -6*x2*(-3 + 2*x)*(-1 + y)*y*(-1 + z)*z2*sdz5
459  -((-1 + x)*x2*(1 - 4*y + 3*y2)*z2*(-3 + 2*z))*sdxy5
460  -(x2*(-3 + 2*x)*(1 - 4*y + 3*y2)*(-1 + z)*z2)*sdyz5
461  +6*(-1 + x)*x2*(-1 + y)*y*(-1 + z)*z2*sdxz5
462  +(-1 + x)*x2*(1 - 4*y + 3*y2)*(-1 + z)*z2*sdxyz5
463  -6*x2*(-3 + 2*x)*(-1 + y)*y*z2*(-3 + 2*z)*cd.node6()
464  +6*(-1 + x)*x2*(-1 + y)*y*z2*(-3 + 2*z)*sdx6
465  +x2*(-3 + 2*x)*y*(-2 + 3*y)*z2*(-3 + 2*z)*sdy6
466  +6*x2*(-3 + 2*x)*(-1 + y)*y*(-1 + z)*z2*sdz6
467  -((-1 + x)*x2*y*(-2 + 3*y)*z2*(-3 + 2*z))*sdxy6
468  -(x2*(-3 + 2*x)*y*(-2 + 3*y)*(-1 + z)*z2)*sdyz6
469  -6*(-1 + x)*x2*(-1 + y)*y*(-1 + z)*z2*sdxz6
470  +(-1 + x)*x2*y*(-2 + 3*y)*(-1 + z)*z2*sdxyz6
471  +6*x12*(1 + 2*x)*(-1 + y)*y*z2*(-3 + 2*z)*cd.node7()
472  +6*x12*x*(-1 + y)*y*z2*(-3 + 2*z)*sdx7
473  -(x12*(1 + 2*x)*y*(-2 + 3*y)*z2*(-3 + 2*z))*sdy7
474  -6*x12*(1 + 2*x)*(-1 + y)*y*(-1 + z)*z2*sdz7
475  -(x12*x*y*(-2 + 3*y)*z2*(-3 + 2*z))*sdxy7
476  +x12*(1 + 2*x)*y*(-2 + 3*y)*(-1 + z)*z2*sdyz7
477  -6*x12*x*(-1 + y)*y*(-1 + z)*z2*sdxz7
478  +x12*x*y*(-2 + 3*y)*(-1 + z)*z2*sdxyz7);
479 
480  derivs[2]=
481  static_cast<typename VECTOR2::value_type>(6*x12*(1 + 2*x)*y12*(1 + 2*y)*(-1 + z)*z*cd.node0()
482  +6*x12*x*y12*(1 + 2*y)*(-1 + z)*z*sdx0
483  +6*x12*(1 + 2*x)*y12*y*(-1 + z)*z*sdy0
484  +x12*(1 + 2*x)*y12*(1 + 2*y)*(1 - 4*z + 3*z2)*sdz0
485  +6*x12*x*y12*y*(-1 + z)*z*sdxy0
486  +x12*(1 + 2*x)*y12*y*(1 - 4*z + 3*z2)*sdyz0
487  +x12*x*y12*(1 + 2*y)*(1 - 4*z + 3*z2)*sdxz0
488  +x12*x*y12*y*(1 - 4*z + 3*z2)*sdxyz0
489  -6*x2*(-3 + 2*x)*y12*(1 + 2*y)*(-1 + z)*z*cd.node1()
490  +6*(-1 + x)*x2*y12*(1 + 2*y)*(-1 + z)*z*sdx1
491  -6*x2*(-3 + 2*x)*y12*y*(-1 + z)*z*sdy1
492  -(x2*(-3 + 2*x)*y12*(1 + 2*y)*(1 - 4*z + 3*z2))*sdz1
493  +6*(-1 + x)*x2*y12*y*(-1 + z)*z*sdxy1
494  -(x2*(-3 + 2*x)*y12*y*(1 - 4*z + 3*z2))*sdyz1
495  +(-1 + x)*x2*y12*(1 + 2*y)*(1 - 4*z + 3*z2)*sdxz1
496  +(-1 + x)*x2*y12*y*(1 - 4*z + 3*z2)*sdxyz1
497  +6*x2*(-3 + 2*x)*y2*(-3 + 2*y)*(-1 + z)*z*cd.node2()
498  -6*(-1 + x)*x2*y2*(-3 + 2*y)*(-1 + z)*z*sdx2
499  -6*x2*(-3 + 2*x)*(-1 + y)*y2*(-1 + z)*z*sdy2
500  +x2*(-3 + 2*x)*y2*(-3 + 2*y)*(1 - 4*z + 3*z2)*sdz2
501  +6*(-1 + x)*x2*(-1 + y)*y2*(-1 + z)*z*sdxy2
502  -(x2*(-3 + 2*x)*(-1 + y)*y2*(1 - 4*z + 3*z2))*sdyz2
503  -((-1 + x)*x2*y2*(-3 + 2*y)*(1 - 4*z + 3*z2))*sdxz2
504  +(-1 + x)*x2*(-1 + y)*y2*(1 - 4*z + 3*z2)*sdxyz2
505  -6*x12*(1 + 2*x)*y2*(-3 + 2*y)*(-1 + z)*z*cd.node3()
506  -6*x12*x*y2*(-3 + 2*y)*(-1 + z)*z*sdx3
507  +6*x12*(1 + 2*x)*(-1 + y)*y2*(-1 + z)*z*sdy3
508  -(x12*(1 + 2*x)*y2*(-3 + 2*y)*(1 - 4*z + 3*z2))*sdz3
509  +6*x12*x*(-1 + y)*y2*(-1 + z)*z*sdxy3
510  +x12*(1 + 2*x)*(-1 + y)*y2*(1 - 4*z + 3*z2)*sdyz3
511  -(x12*x*y2*(-3 + 2*y)*(1 - 4*z + 3*z2))*sdxz3
512  +x12*x*(-1 + y)*y2*(1 - 4*z + 3*z2)*sdxyz3
513  -6*x12*(1 + 2*x)*y12*(1 + 2*y)*(-1 + z)*z*cd.node4()
514  -6*x12*x*y12*(1 + 2*y)*(-1 + z)*z*sdx4
515  -6*x12*(1 + 2*x)*y12*y*(-1 + z)*z*sdy4
516  +x12*(1 + 2*x)*y12*(1 + 2*y)*z*(-2 + 3*z)*sdz4
517  -6*x12*x*y12*y*(-1 + z)*z*sdxy4
518  +x12*(1 + 2*x)*y12*y*z*(-2 + 3*z)*sdyz4
519  +x12*x*y12*(1 + 2*y)*z*(-2 + 3*z)*sdxz4
520  +x12*x*y12*y*z*(-2 + 3*z)*sdxyz4
521  +6*x2*(-3 + 2*x)*y12*(1 + 2*y)*(-1 + z)*z*cd.node5()
522  -6*(-1 + x)*x2*y12*(1 + 2*y)*(-1 + z)*z*sdx5
523  +6*x2*(-3 + 2*x)*y12*y*(-1 + z)*z*sdy5
524  -(x2*(-3 + 2*x)*y12*(1 + 2*y)*z*(-2 + 3*z))*sdz5
525  -6*(-1 + x)*x2*y12*y*(-1 + z)*z*sdxy5
526  -(x2*(-3 + 2*x)*y12*y*z*(-2 + 3*z))*sdyz5
527  +(-1 + x)*x2*y12*(1 + 2*y)*z*(-2 + 3*z)*sdxz5
528  +(-1 + x)*x2*y12*y*z*(-2 + 3*z)*sdxyz5
529  -6*x2*(-3 + 2*x)*y2*(-3 + 2*y)*(-1 + z)*z*cd.node6()
530  +6*(-1 + x)*x2*y2*(-3 + 2*y)*(-1 + z)*z*sdx6
531  +6*x2*(-3 + 2*x)*(-1 + y)*y2*(-1 + z)*z*sdy6
532  +x2*(-3 + 2*x)*y2*(-3 + 2*y)*z*(-2 + 3*z)*sdz6
533  -6*(-1 + x)*x2*(-1 + y)*y2*(-1 + z)*z*sdxy6
534  -(x2*(-3 + 2*x)*(-1 + y)*y2*z*(-2 + 3*z))*sdyz6
535  -((-1 + x)*x2*y2*(-3 + 2*y)*z*(-2 + 3*z))*sdxz6
536  +(-1 + x)*x2*(-1 + y)*y2*z*(-2 + 3*z)*sdxyz6
537  +6*x12*(1 + 2*x)*y2*(-3 + 2*y)*(-1 + z)*z*cd.node7()
538  +6*x12*x*y2*(-3 + 2*y)*(-1 + z)*z*sdx7
539  -6*x12*(1 + 2*x)*(-1 + y)*y2*(-1 + z)*z*sdy7
540  -(x12*(1 + 2*x)*y2*(-3 + 2*y)*z*(-2 + 3*z))*sdz7
541  -6*x12*x*(-1 + y)*y2*(-1 + z)*z*sdxy7
542  +x12*(1 + 2*x)*(-1 + y)*y2*z*(-2 + 3*z)*sdyz7
543  -(x12*x*y2*(-3 + 2*y)*z*(-2 + 3*z))*sdxz7
544  +x12*x*(-1 + y)*y2*z*(-2 + 3*z)*sdxyz7);
545  }
546 
547  /// get parametric coordinate for value within the element
548  template <class ElemData, class VECTOR>
549  bool get_coords(VECTOR &coords, const T& value,
550  const ElemData &cd) const
551  {
553  return CL.get_coords(this, coords, value, cd);
554  }
555 
556  /// get arc length for edge
557  template <class ElemData>
558  double get_arc_length(const unsigned edge, const ElemData &cd) const
559  {
560  return get_arc3d_length<CrvGaussian2<double> >(this, edge, cd);
561  }
562 
563  /// get area
564  template <class ElemData>
565  double get_area(const unsigned face, const ElemData &cd) const
566  {
567  return get_area3<QuadGaussian3<double> >(this, face, cd);
568  }
569 
570  /// get volume
571  template <class ElemData>
572  double get_volume(const ElemData & cd) const
573  {
574  return get_volume3(this, cd);
575  }
576  static const std::string type_name(int n = -1);
577 
578  virtual void io (Piostream& str);
579 
580 };
581 
582 
583 template <class T>
584 const std::string
586 {
587  ASSERT((n >= -1) && n <= 1);
588  if (n == -1)
589  {
590  static const std::string name = TypeNameGenerator::make_template_id(type_name(0), type_name(1));
591  return name;
592  }
593  else if (n == 0)
594  {
595  static const std::string nm("HexTricubicHmtScaleFactors");
596  return nm;
597  } else {
598  return find_type_name((T *)0);
599  }
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("HexTricubicHmtScaleFactors",
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->scalefactors_);
636  stream.end_class();
637 }
638 }
639 
640 
641 #endif
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
Definition: HexElementsWeights.h:36
Definition: Persistent.h:89
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
double get_volume(const ElemData &cd) const
get volume
Definition: HexTricubicHmtScaleFactors.h:572
#define ASSERT(condition)
Definition: Assert.h:110
virtual ~HexTricubicHmtScaleFactors()
Definition: HexTricubicHmtScaleFactors.h:67
virtual int begin_class(const std::string &name, int current_version)
Definition: Persistent.cc:143
Definition: HexTricubicHmtScaleFactors.h:56
const string find_type_name(float *)
Definition: TypeName.cc:63
void get_weights(const VECTOR &coords, double *w) const
Definition: HexTricubicHmtScaleFactors.h:72
Class for describing unit geometry of HexTricubicHmtScaleFactors.
Definition: HexTricubicHmtScaleFactors.h:43
void get_derivate_weights(const VECTOR &coords, double *w) const
Definition: HexTricubicHmtScaleFactors.h:76
Class with weights and coordinates for 3rd order Gaussian integration.
Definition: HexTrilinearLgn.h:331
const char * name[]
Definition: BoostGraphExampleTests.cc:87
T value_type
Definition: HexTricubicHmtScaleFactors.h:64
Persistent i/o for STL containers.
const int HEXTRICUBICHMTSCALEFACTORS_VERSION
Definition: HexTricubicHmtScaleFactors.h:627
std::vector< std::vector< double > > scalefactors_
Definition: Basis.h:161
T interpolate(const VECTOR &coords, const ElemData &cd) const
get value at parametric coordinate
Definition: HexTricubicHmtScaleFactors.h:81
static int polynomial_order()
Definition: HexTricubicHmtScaleFactors.h:69
void derivate(const VECTOR1 &coords, const ElemData &cd, VECTOR2 &derivs) const
get first derivative at parametric coordinate
Definition: HexTricubicHmtScaleFactors.h:245
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: HexTricubicHmtScaleFactors.h:630
void get_cubic_weights(const VECTOR &coords, unsigned int elem, double *w) const
Definition: HexElementsWeights.h:184
static const std::string type_name(int n=-1)
Definition: HexTricubicHmtScaleFactors.h:585
bool get_coords(VECTOR &coords, const T &value, const ElemData &cd) const
get parametric coordinate for value within the element
Definition: HexTricubicHmtScaleFactors.h:549
void Pio(Piostream &stream, Array1< T > &array)
Definition: Array1.h:65
double get_arc_length(const unsigned edge, const ElemData &cd) const
get arc length for edge
Definition: HexTricubicHmtScaleFactors.h:558
std::vector< std::vector< T > > derivs_
Definition: Basis.h:160
virtual void end_class()
Definition: Persistent.cc:178
double get_area(const unsigned face, const ElemData &cd) const
get area
Definition: HexTricubicHmtScaleFactors.h:565
virtual ~HexTricubicHmtScaleFactorsUnitElement()
Definition: HexTricubicHmtScaleFactors.h:47
Definition: HexSamplingSchemes.h:43
HexTricubicHmtScaleFactorsUnitElement()
Definition: HexTricubicHmtScaleFactors.h:46
Definition: HexTrilinearLgn.h:197
int n
Definition: eab.py:9
HexTricubicHmtScaleFactors()
Definition: HexTricubicHmtScaleFactors.h:66
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
static int dofs()
return degrees of freedom
Definition: HexTricubicHmtScaleFactors.h:49
double get_volume3(const ElemBasis *pEB, const ElemData &cd)
Definition: Locate.h:179
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