Intrepid2
Intrepid2_CubatureDirectLineGaussJacobi20Def.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Intrepid2 Package
4 //
5 // Copyright 2007 NTESS and the Intrepid2 contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
16 namespace Intrepid2 {
17 
18  template <typename DT, typename PT, typename WT>
20  CubatureDirectLineGaussJacobi20(const ordinal_type degree)
21  : CubatureDirect<DT,PT,WT>(degree, 1) {
22 
23  INTREPID2_TEST_FOR_EXCEPTION( degree < 0 ||
24  degree > static_cast<ordinal_type>(Parameters::MaxCubatureDegreePyr), std::out_of_range,
25  ">>> ERROR (CubatureDirectLineGaussJacobi20): No cubature rule implemented for the desired polynomial degree.");
26 
27  typedef Kokkos::DynRankView<PT,Kokkos::LayoutRight,Kokkos::HostSpace> pointViewHostType;
28  typedef Kokkos::DynRankView<WT,Kokkos::LayoutRight,Kokkos::HostSpace> weightViewHostType;
29 
31  const Kokkos::pair<ordinal_type,ordinal_type> pointRange(0, this->cubatureData_.numPoints_);
32  {
33  // src
34  const pointViewHostType points_host(const_cast<PT*>( &(cubatureDataStatic_[this->degree_].points_[0][0]) ),
35  pointRange.second,
37 
38  auto points = Kokkos::create_mirror_view(typename DT::memory_space(), points_host);
39 
40  Kokkos::deep_copy(points,points_host);
41 
42  // dst
43  this->cubatureData_.points_ = Kokkos::DynRankView<PT,DT>("CubatureDirectLineGaussJacobi20::cubatureData_::points_",
44  pointRange.second,
46  // copy
47  Kokkos::deep_copy(this->cubatureData_.points_ , points );
48  }
49  {
50  // src
51  const weightViewHostType weights(const_cast<PT*>( &(cubatureDataStatic_[this->degree_].weights_[0]) ),
52  pointRange.second);
53 
54  // dst
55  this->cubatureData_.weights_ = Kokkos::DynRankView<WT,DT>("CubatureDirectLineGaussJacobi20::cubatureData_::weights_",
56  pointRange.second);
57  // copy
58  Kokkos::deep_copy(Kokkos::subdynrankview(this->cubatureData_.weights_, Kokkos::ALL()) , Kokkos::subdynrankview(weights, Kokkos::ALL()));
59  }
60  }
61 
62 
63  //-------------------------------------------------------------------------------------//
64  // Definition of cubature templates //
65  //-------------------------------------------------------------------------------------//
66 
67  /*
68  Cubature templates for lines are defined the reference cell:
69 
70  Line -> (-1,0,0),(1,0,0)
71  */
72 
73  /*
74  This static const member contains templates for GaussJacobi20(-Legendre) rules.
75  */
76  template<typename DT, typename PT, typename WT>
79  cubatureDataStatic_[cubatureDataStaticSize] = {
80  // Collection of GaussJacobi20 rules on [-1,1]
81  // The rule with array index i is exact for polynomials up to order i
82  {
83  1,
84  {{-0.5, 0.0, 0.0}},
85  {2.66666666666666666666666666}
86  },
87  {
88  1,
89  {{-0.5, 0.0, 0.0}},
90  {2.66666666666666666666666666}
91  },
92  {
93  2,
94  {{-7.549703546891172e-1, 0.0, 0.0},
95  {8.830368802245062e-2, 0.0, 0.0}},
96  {1.860379610028064,
97  8.062870566386037e-01}
98  },
99  {
100  2,
101  {{-7.549703546891172e-1, 0.0, 0.0},
102  {8.830368802245062e-2, 0.0, 0.0}},
103  {1.860379610028064,
104  8.062870566386037e-01}
105  },
106  {
107  3,
108  {{-8.540119518537008e-01, 0.0, 0.0},
109  {-3.059924679232963e-01, 0.0, 0.0},
110  { 4.100044197769969e-01, 0.0, 0.0}},
111  {1.257090888519093e+00,
112  1.169970154078928e+00,
113  2.396056240686456e-01}
114  },
115  {
116  3,
117  {{-8.540119518537008e-01, 0.0, 0.0},
118  {-3.059924679232963e-01, 0.0, 0.0},
119  { 4.100044197769969e-01, 0.0, 0.0}},
120  {1.257090888519093e+00,
121  1.169970154078928e+00,
122  2.396056240686456e-01}
123  },
124  {
125  4,
126  {{-9.029989011060054e-01, 0.0, 0.0},
127  {-5.227985248962754e-01, 0.0, 0.0},
128  {3.409459020873505e-02, 0.0, 0.0},
129  {5.917028357935457e-01, 0.0, 0.0}},
130  {8.871073248902235e-01,
131  1.147670318393715e+00,
132  5.490710973833849e-01,
133  8.281792599934450e-02}
134  },
135  {
136  4,
137  {{-9.029989011060054e-01, 0.0, 0.0},
138  {-5.227985248962754e-01, 0.0, 0.0},
139  {3.409459020873505e-02, 0.0, 0.0},
140  {5.917028357935457e-01, 0.0, 0.0}},
141  {8.871073248902235e-01,
142  1.147670318393715e+00,
143  5.490710973833849e-01,
144  8.281792599934450e-02}
145  },
146  {
147  5,
148  {{-9.308421201635699e-01, 0.0, 0.0},
149  {-6.530393584566085e-01, 0.0, 0.0},
150  {-2.202272258689614e-01, 0.0, 0.0},
151  {2.686669452617736e-01, 0.0, 0.0},
152  {7.021084258940329e-01, 0.0, 0.0}},
153  {6.541182742861678e-01,
154  1.009591695199292e+00,
155  7.136012897727201e-01,
156  2.564448057836956e-01,
157  3.291060162479211e-02}
158  },
159  {
160  5,
161  {{-9.308421201635699e-01, 0.0, 0.0},
162  {-6.530393584566085e-01, 0.0, 0.0},
163  {-2.202272258689614e-01, 0.0, 0.0},
164  {2.686669452617736e-01, 0.0, 0.0},
165  {7.021084258940329e-01, 0.0, 0.0}},
166  {6.541182742861678e-01,
167  1.009591695199292e+00,
168  7.136012897727201e-01,
169  2.564448057836956e-01,
170  3.291060162479211e-02}
171  },
172  {
173  6,
174  {{-9.481908898126656e-01, 0.0, 0.0},
175  {-7.368721166840297e-01, 0.0, 0.0},
176  {-3.951261639542174e-01, 0.0, 0.0},
177  {1.807282632950432e-02, 0.0, 0.0},
178  {4.313622546234276e-01, 0.0, 0.0},
179  {7.736112323551237e-01, 0.0, 0.0}},
180  {5.003096218126469e-01,
181  8.590119978942462e-01,
182  7.566174939883307e-01,
183  4.103165690369299e-01,
184  1.257623774795603e-01,
185  1.464860645495425e-02}
186  },
187  {
188  6,
189  {{-9.481908898126656e-01, 0.0, 0.0},
190  {-7.368721166840297e-01, 0.0, 0.0},
191  {-3.951261639542174e-01, 0.0, 0.0},
192  {1.807282632950432e-02, 0.0, 0.0},
193  {4.313622546234276e-01, 0.0, 0.0},
194  {7.736112323551237e-01, 0.0, 0.0}},
195  {5.003096218126469e-01,
196  8.590119978942462e-01,
197  7.566174939883307e-01,
198  4.103165690369299e-01,
199  1.257623774795603e-01,
200  1.464860645495425e-02}
201  } // end GaussJacobi20
202 
203  };
204 
205 } // end namespace Intrepid2
static constexpr ordinal_type MaxDimension
The maximum ambient space dimension.
Defines GaussJacobi20 integration rules on a line used for Pyramid only.
Kokkos::DynRankView< weightValueType, DeviceType > weights_
Array with the associated cubature weights.
CubatureDirectLineGaussJacobi20(const ordinal_type degree=0)
Constructor.
static constexpr ordinal_type MaxCubatureDegreePyr
The maximum degree of the polynomial that can be integrated exactly by a direct pyramid rule...
CubatureData cubatureData_
Cubature data on device.
ordinal_type numPoints_
Number of cubature points stored in the template.
static const CubatureDataStatic cubatureDataStatic_[cubatureDataStaticSize]
Complete set of data defining line Gauss(-Legendre) rules.
Defines direct cubature (integration) rules in Intrepid.
Cubature data is defined on the host space and is static.
Kokkos::DynRankView< pointValueType, DeviceType > points_
Array with the (X,Y,Z) coordinates of the cubature points.
ordinal_type numPoints_
Number of cubature points stored in the template.
ordinal_type degree_
The degree of polynomials that are integrated exactly by this cubature rule.