Intrepid2
Intrepid2_DerivedBasis_HCURL_HEX.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ************************************************************************
3 //
4 // Intrepid2 Package
5 // Copyright (2007) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Kyungjoo Kim (kyukim@sandia.gov),
38 // Mauro Perego (mperego@sandia.gov), or
39 // Nate Roberts (nvrober@sandia.gov)
40 //
41 // ************************************************************************
42 // @HEADER
43 
54 #ifndef Intrepid2_DerivedBasis_HCURL_HEX_h
55 #define Intrepid2_DerivedBasis_HCURL_HEX_h
56 
57 #include <Kokkos_DynRankView.hpp>
58 
60 #include "Intrepid2_Sacado.hpp"
61 
64 
65 namespace Intrepid2
66 {
67  template<class HGRAD_LINE, class HVOL_LINE>
69  : public Basis_TensorBasis3<typename HGRAD_LINE::BasisBase>
70  {
71  public:
72  using OutputViewType = typename HGRAD_LINE::OutputViewType;
73  using PointViewType = typename HGRAD_LINE::PointViewType ;
74  using ScalarViewType = typename HGRAD_LINE::ScalarViewType;
75 
76  using LineGradBasis = HGRAD_LINE;
77  using LineVolBasis = HVOL_LINE;
78 
80  public:
87  Basis_Derived_HCURL_Family1_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType = POINTTYPE_DEFAULT)
88  :
89  TensorBasis3(Teuchos::rcp(new LineVolBasis (polyOrder_x-1,pointType)),
90  Teuchos::rcp(new LineGradBasis(polyOrder_y,pointType)),
91  Teuchos::rcp(new LineGradBasis(polyOrder_z,pointType)),
92  true) // true: use shards CellTopology and tags
93  {
94  this->functionSpace_ = FUNCTION_SPACE_HCURL;
95  }
96 
99  virtual OperatorTensorDecomposition getSimpleOperatorDecomposition(const EOperator &operatorType) const override
100  {
101  const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
102  const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
103 
104  if (operatorType == Intrepid2::OPERATOR_VALUE)
105  {
106  // family 1 goes in x component
107  std::vector< std::vector<EOperator> > ops(3);
108  ops[0] = std::vector<EOperator>{VALUE,VALUE,VALUE};
109  ops[1] = std::vector<EOperator>{};
110  ops[2] = std::vector<EOperator>{};
111  std::vector<double> weights {1.0, 0.0, 0.0};
112  return OperatorTensorDecomposition(ops, weights);
113  }
114  else if (operatorType == Intrepid2::OPERATOR_CURL)
115  {
116  // Family 1:
117  // x component is zero
118  // y component is d/dz: (VALUE,VALUE,GRAD), weight = 1.0
119  // z component is -d/dy: (VALUE,GRAD,VALUE), weight = -1.0
120 
121  std::vector< std::vector<EOperator> > ops(3);
122  ops[0] = std::vector<EOperator>{};
123  ops[1] = std::vector<EOperator>{VALUE,VALUE,GRAD};
124  ops[2] = std::vector<EOperator>{VALUE,GRAD,VALUE};
125 
126  std::vector<double> weights {0.0, 1.0, -1.0};
127  return OperatorTensorDecomposition(ops,weights);
128  }
129  else
130  {
131  INTREPID2_TEST_FOR_EXCEPTION(true, std::invalid_argument, "Unsupported operator type");
132  }
133  }
134 
136 
145  virtual void getValues(OutputViewType outputValues, const EOperator operatorType,
146  const PointViewType inputPoints1, const PointViewType inputPoints2, const PointViewType inputPoints3,
147  bool tensorPoints) const override
148  {
149  Intrepid2::EOperator op1, op2, op3;
150  if (operatorType == Intrepid2::OPERATOR_VALUE)
151  {
152  op1 = Intrepid2::OPERATOR_VALUE;
153  op2 = Intrepid2::OPERATOR_VALUE;
154  op3 = Intrepid2::OPERATOR_VALUE;
155 
156  // family 1 goes in the x component; 0 in the y and z components
157  auto outputValuesComponent1 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
158  auto outputValuesComponent23 = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::make_pair(1,3));
159 
160  this->TensorBasis3::getValues(outputValuesComponent1,
161  inputPoints1, op1,
162  inputPoints2, op2,
163  inputPoints3, op3, tensorPoints);
164  // place 0 in the y and z components
165  Kokkos::deep_copy(outputValuesComponent23,0.0);
166  }
167  else if (operatorType == Intrepid2::OPERATOR_CURL)
168  {
169  // family 1 is nonzero in the x component, so the curl is d/dz placed in the y component, and -d/dy placed in the z component.
170  auto outputValuesComponent_x = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
171  auto outputValuesComponent_y = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
172  auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
173 
174  // x component is zero
175  Kokkos::deep_copy(outputValuesComponent_x, 0.0);
176 
177  // y component is d/dz
178  op1 = Intrepid2::OPERATOR_VALUE;
179  op2 = Intrepid2::OPERATOR_VALUE;
180  op3 = Intrepid2::OPERATOR_GRAD; // d/dz
181 
182  double weight = 1.0; // the plus sign in front of d/dz
183  this->TensorBasis3::getValues(outputValuesComponent_y,
184  inputPoints1, op1,
185  inputPoints2, op2,
186  inputPoints3, op3, tensorPoints, weight);
187 
188  // z component is -d/dy
189  op1 = Intrepid2::OPERATOR_VALUE;
190  op2 = Intrepid2::OPERATOR_GRAD; // d/dy
191  op3 = Intrepid2::OPERATOR_VALUE;
192  weight = -1.0; // the -1 weight on d/dy
193  this->TensorBasis3::getValues(outputValuesComponent_z,
194  inputPoints1, op1,
195  inputPoints2, op2,
196  inputPoints3, op3, tensorPoints, weight);
197  }
198  else
199  {
200  INTREPID2_TEST_FOR_EXCEPTION(true,std::invalid_argument,"operator not yet supported");
201  }
202  }
203 
215  virtual void getDofCoeffs( ScalarViewType dofCoeffs ) const override {
216  auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),0);
217  auto dofCoeffs23 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),std::make_pair(1,3));
218  this->TensorBasis3::getDofCoeffs(dofCoeffs1);
219  Kokkos::deep_copy(dofCoeffs23,0.0);
220  }
221  };
222 
223  template<class HGRAD_LINE, class HVOL_LINE>
225  : public Basis_TensorBasis3<typename HGRAD_LINE::BasisBase>
226  {
227  public:
228  using OutputViewType = typename HGRAD_LINE::OutputViewType;
229  using PointViewType = typename HGRAD_LINE::PointViewType ;
230  using ScalarViewType = typename HGRAD_LINE::ScalarViewType;
231 
232  using LineGradBasis = HGRAD_LINE;
233  using LineVolBasis = HVOL_LINE;
234 
236  public:
243  Basis_Derived_HCURL_Family2_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType = POINTTYPE_DEFAULT)
244  :
245  TensorBasis3(Teuchos::rcp( new LineGradBasis(polyOrder_x,pointType)),
246  Teuchos::rcp( new LineVolBasis (polyOrder_y-1,pointType)),
247  Teuchos::rcp( new LineGradBasis(polyOrder_z,pointType)),
248  true) // true: use shards CellTopology and tags
249  {
250  this->functionSpace_ = FUNCTION_SPACE_HCURL;
251  }
252 
255  virtual OperatorTensorDecomposition getSimpleOperatorDecomposition(const EOperator &operatorType) const override
256  {
257  const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
258  const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
259  const EOperator CURL = Intrepid2::OPERATOR_CURL;
260  if (operatorType == VALUE)
261  {
262  // family 2 goes in y component
263  std::vector< std::vector<EOperator> > ops(3);
264  ops[0] = std::vector<EOperator>{};
265  ops[1] = std::vector<EOperator>{VALUE,VALUE,VALUE};
266  ops[2] = std::vector<EOperator>{};
267  std::vector<double> weights {0.0, 1.0, 0.0};
268  return OperatorTensorDecomposition(ops, weights);
269  }
270  else if (operatorType == CURL)
271  {
272  // family 2 is nonzero in the y component, so the curl is -d/dz placed in the x component, and d/dx placed in the z component.
273  // x component is -d/dz: (VALUE,VALUE,GRAD), weight = -1.0
274  // y component is zero
275  // z component is d/dx: (GRAD,VALUE,VALUE), weight = 1.0
276  std::vector< std::vector<EOperator> > ops(3);
277  ops[0] = std::vector<EOperator>{VALUE,VALUE,GRAD};
278  ops[1] = std::vector<EOperator>{};
279  ops[2] = std::vector<EOperator>{GRAD,VALUE,VALUE};
280 
281  std::vector<double> weights {-1.0, 0.0, 1.0};
282  return OperatorTensorDecomposition(ops,weights);
283  }
284  else
285  {
286  INTREPID2_TEST_FOR_EXCEPTION(true, std::invalid_argument, "Unsupported operator type");
287  }
288  }
289 
291 
300  virtual void getValues(OutputViewType outputValues, const EOperator operatorType,
301  const PointViewType inputPoints1, const PointViewType inputPoints2, const PointViewType inputPoints3,
302  bool tensorPoints) const override
303  {
304  Intrepid2::EOperator op1, op2, op3;
305  if (operatorType == Intrepid2::OPERATOR_VALUE)
306  {
307  op1 = Intrepid2::OPERATOR_VALUE;
308  op2 = Intrepid2::OPERATOR_VALUE;
309  op3 = Intrepid2::OPERATOR_VALUE;
310 
311  // family 2 goes in the y component; 0 in the x and z components
312  auto outputValuesComponent_x = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
313  auto outputValuesComponent_y = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
314  auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
315 
316  // place 0 in the x component
317  Kokkos::deep_copy(outputValuesComponent_x,0.0);
318  // evaluate y component
319  this->TensorBasis3::getValues(outputValuesComponent_y,
320  inputPoints1, op1,
321  inputPoints2, op2,
322  inputPoints3, op3, tensorPoints);
323  // place 0 in the z component
324  Kokkos::deep_copy(outputValuesComponent_z,0.0);
325  }
326  else if (operatorType == Intrepid2::OPERATOR_CURL)
327  {
328  // family 2 is nonzero in the y component, so the curl is -d/dz placed in the x component, and d/dx placed in the z component.
329  auto outputValuesComponent_x = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
330  auto outputValuesComponent_y = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
331  auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
332 
333  // x component is -d/dz
334  op1 = Intrepid2::OPERATOR_VALUE;
335  op2 = Intrepid2::OPERATOR_VALUE;
336  op3 = Intrepid2::OPERATOR_GRAD; // d/dz
337 
338  double weight = -1.0; // the minus sign in front of d/dz
339  this->TensorBasis3::getValues(outputValuesComponent_x,
340  inputPoints1, op1,
341  inputPoints2, op2,
342  inputPoints3, op3, tensorPoints, weight);
343 
344  // y component is zero
345  Kokkos::deep_copy(outputValuesComponent_y, 0.0);
346 
347  // z component is d/dx
348  op1 = Intrepid2::OPERATOR_GRAD; // d/dx
349  op2 = Intrepid2::OPERATOR_VALUE;
350  op3 = Intrepid2::OPERATOR_VALUE;
351  weight = 1.0; // the weight on d/dx
352  this->TensorBasis3::getValues(outputValuesComponent_z,
353  inputPoints1, op1,
354  inputPoints2, op2,
355  inputPoints3, op3, tensorPoints, weight);
356  }
357  else
358  {
359  INTREPID2_TEST_FOR_EXCEPTION(true,std::invalid_argument,"operator not yet supported");
360  }
361  }
362 
374  virtual void getDofCoeffs( ScalarViewType dofCoeffs ) const override {
375  auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),0);
376  auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),1);
377  auto dofCoeffs3 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),2);
378  Kokkos::deep_copy(dofCoeffs1,0.0);
379  this->TensorBasis3::getDofCoeffs(dofCoeffs2);
380  Kokkos::deep_copy(dofCoeffs3,0.0);
381  }
382 
383 
384  };
385 
386  template<class HGRAD_LINE, class HVOL_LINE>
388  : public Basis_TensorBasis3<typename HGRAD_LINE::BasisBase>
389  {
390  using OutputViewType = typename HGRAD_LINE::OutputViewType;
391  using PointViewType = typename HGRAD_LINE::PointViewType ;
392  using ScalarViewType = typename HGRAD_LINE::ScalarViewType;
393 
394  using LineGradBasis = HGRAD_LINE;
395  using LineVolBasis = HVOL_LINE;
396 
398  public:
405  Basis_Derived_HCURL_Family3_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType = POINTTYPE_DEFAULT)
406  :
407  TensorBasis3(Teuchos::rcp(new LineGradBasis(polyOrder_x,pointType)),
408  Teuchos::rcp(new LineGradBasis(polyOrder_y,pointType)),
409  Teuchos::rcp(new LineVolBasis (polyOrder_z-1,pointType)),
410  true) // true: use shards CellTopology and tags
411  {
412  this->functionSpace_ = FUNCTION_SPACE_HCURL;
413  }
414 
417  virtual OperatorTensorDecomposition getSimpleOperatorDecomposition(const EOperator &operatorType) const override
418  {
419  const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
420  const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
421  if (operatorType == Intrepid2::OPERATOR_VALUE)
422  {
423  // family 3 goes in z component
424  std::vector< std::vector<EOperator> > ops(3);
425  ops[0] = std::vector<EOperator>{};
426  ops[1] = std::vector<EOperator>{};
427  ops[2] = std::vector<EOperator>{VALUE,VALUE,VALUE};
428  std::vector<double> weights {0.0, 0.0, 1.0};
429  return OperatorTensorDecomposition(ops, weights);
430  }
431  else if (operatorType == Intrepid2::OPERATOR_CURL)
432  {
433  // family 3 is nonzero in the z component, so the curl is d/dy placed in the x component, and -d/dx placed in the y component.
434  // x component is d/dy: (VALUE,GRAD,VALUE), weight = 1.0
435  // y component is d/dx: (GRAD,VALUE,VALUE), weight = -1.0
436  // z component is zero
437  std::vector< std::vector<EOperator> > ops(3);
438  ops[0] = std::vector<EOperator>{VALUE,GRAD,VALUE};
439  ops[1] = std::vector<EOperator>{GRAD,VALUE,VALUE};
440  ops[2] = std::vector<EOperator>{};
441 
442  std::vector<double> weights {1.0, -1.0, 0.0};
443  return OperatorTensorDecomposition(ops,weights);
444  }
445  else
446  {
447  INTREPID2_TEST_FOR_EXCEPTION(true, std::invalid_argument, "Unsupported operator type");
448  }
449  }
450 
452 
461  virtual void getValues(OutputViewType outputValues, const EOperator operatorType,
462  const PointViewType inputPoints1, const PointViewType inputPoints2, const PointViewType inputPoints3,
463  bool tensorPoints) const override
464  {
465  Intrepid2::EOperator op1, op2, op3;
466  if (operatorType == Intrepid2::OPERATOR_VALUE)
467  {
468  op1 = Intrepid2::OPERATOR_VALUE;
469  op2 = Intrepid2::OPERATOR_VALUE;
470  op3 = Intrepid2::OPERATOR_VALUE;
471 
472  // family 3 goes in the z component; 0 in the x and y components
473  auto outputValuesComponent_xy = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::make_pair(0,2));
474  auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
475 
476  // place 0 in the x and y components
477  Kokkos::deep_copy(outputValuesComponent_xy,0.0);
478  // evaluate z component
479  this->TensorBasis3::getValues(outputValuesComponent_z,
480  inputPoints1, op1,
481  inputPoints2, op2,
482  inputPoints3, op3, tensorPoints);
483  }
484  else if (operatorType == Intrepid2::OPERATOR_CURL)
485  {
486  // family 3 is nonzero in the z component, so the curl is d/dy placed in the x component, and -d/dx placed in the y component.
487  auto outputValuesComponent_x = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
488  auto outputValuesComponent_y = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
489  auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
490 
491  // x component is d/dy
492  op1 = Intrepid2::OPERATOR_VALUE;
493  op2 = Intrepid2::OPERATOR_GRAD; // d/dy
494  op3 = Intrepid2::OPERATOR_VALUE;
495 
496  double weight = 1.0; // the sign in front of d/dy
497  this->TensorBasis3::getValues(outputValuesComponent_x,
498  inputPoints1, op1,
499  inputPoints2, op2,
500  inputPoints3, op3, tensorPoints, weight);
501  // y component is -d/dx
502  op1 = Intrepid2::OPERATOR_GRAD; // d/dx
503  op2 = Intrepid2::OPERATOR_VALUE;
504  op3 = Intrepid2::OPERATOR_VALUE;
505  weight = -1.0; // the weight on d/dx
506  this->TensorBasis3::getValues(outputValuesComponent_y,
507  inputPoints1, op1,
508  inputPoints2, op2,
509  inputPoints3, op3, tensorPoints, weight);
510 
511  // z component is zero
512  Kokkos::deep_copy(outputValuesComponent_z, 0.0);
513  }
514  else
515  {
516  INTREPID2_TEST_FOR_EXCEPTION(true,std::invalid_argument,"operator not yet supported");
517  }
518  }
519 
531  virtual void getDofCoeffs( ScalarViewType dofCoeffs ) const override {
532  auto dofCoeffs12 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),std::make_pair(0,2));
533  auto dofCoeffs3 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),2);
534  Kokkos::deep_copy(dofCoeffs12,0.0);
535  this->TensorBasis3::getDofCoeffs(dofCoeffs3);
536  }
537  };
538 
539  template<class HGRAD_LINE, class HVOL_LINE>
541  : public Basis_DirectSumBasis <typename HGRAD_LINE::BasisBase>
542  {
546  public:
553  Basis_Derived_HCURL_Family1_Family2_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType)
554  :
555  DirectSumBasis(Teuchos::rcp(new Family1(polyOrder_x, polyOrder_y, polyOrder_z, pointType)),
556  Teuchos::rcp(new Family2(polyOrder_x, polyOrder_y, polyOrder_z, pointType))) {}
557  };
558 
559  template<class HGRAD_LINE, class HVOL_LINE>
561  : public Basis_DirectSumBasis <typename HGRAD_LINE::BasisBase>
562  {
566 
567  std::string name_;
568  ordinal_type order_x_;
569  ordinal_type order_y_;
570  ordinal_type order_z_;
571  EPointType pointType_;
572 
573  public:
574 
575  using ExecutionSpace = typename HGRAD_LINE::ExecutionSpace;
576  using OutputValueType = typename HGRAD_LINE::OutputValueType;
577  using PointValueType = typename HGRAD_LINE::PointValueType;
578 
579  using BasisBase = typename HGRAD_LINE::BasisBase;
580 
587  Basis_Derived_HCURL_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
588  :
589  DirectSumBasis(Teuchos::rcp(new Family12(polyOrder_x, polyOrder_y, polyOrder_z, pointType)),
590  Teuchos::rcp(new Family3 (polyOrder_x, polyOrder_y, polyOrder_z, pointType))) {
591  this->functionSpace_ = FUNCTION_SPACE_HCURL;
592 
593  std::ostringstream basisName;
594  basisName << "HCURL_HEX (" << this->DirectSumBasis::getName() << ")";
595  name_ = basisName.str();
596 
597  order_x_ = polyOrder_x;
598  order_y_ = polyOrder_y;
599  order_z_ = polyOrder_z;
600  pointType_ = pointType;
601  }
602 
606  Basis_Derived_HCURL_HEX(int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT) : Basis_Derived_HCURL_HEX(polyOrder, polyOrder, polyOrder, pointType) {}
607 
610  virtual bool requireOrientation() const override {
611  return true;
612  }
613 
618  virtual
619  const char*
620  getName() const override {
621  return name_.c_str();
622  }
623 
634  Teuchos::RCP<BasisBase>
635  getSubCellRefBasis(const ordinal_type subCellDim, const ordinal_type subCellOrd) const override{
636 
637  using LineBasis = HVOL_LINE;
639 
640  if(subCellDim == 1) {
641  switch(subCellOrd) {
642  case 0:
643  case 2:
644  case 4:
645  case 6:
646  return Teuchos::rcp( new LineBasis(order_x_-1, pointType_) );
647  case 1:
648  case 3:
649  case 5:
650  case 7:
651  return Teuchos::rcp( new LineBasis(order_y_-1, pointType_) );
652  case 8:
653  case 9:
654  case 10:
655  case 11:
656  return Teuchos::rcp( new LineBasis(order_z_-1, pointType_) );
657  }
658  } else if(subCellDim == 2) {
659  switch(subCellOrd) {
660  case 0:
661  return Teuchos::rcp( new QuadBasis(order_x_, order_z_, pointType_) );
662  case 1:
663  return Teuchos::rcp( new QuadBasis(order_y_,order_z_, pointType_) );
664  case 2:
665  return Teuchos::rcp( new QuadBasis(order_x_, order_z_, pointType_) );
666  case 3:
667  return Teuchos::rcp( new QuadBasis(order_z_, order_y_, pointType_) );
668  case 4:
669  return Teuchos::rcp( new QuadBasis(order_y_, order_x_, pointType_) );
670  case 5:
671  return Teuchos::rcp( new QuadBasis(order_x_, order_y_, pointType_) );
672  }
673  }
674 
675  INTREPID2_TEST_FOR_EXCEPTION(true,std::invalid_argument,"Input parameters out of bounds");
676  }
681  virtual HostBasisPtr<OutputValueType, PointValueType>
682  getHostBasis() const override {
684 
685  auto hostBasis = Teuchos::rcp(new HostBasis(order_x_, order_y_, order_z_, pointType_));
686 
687  return hostBasis;
688  }
689  };
690 } // end namespace Intrepid2
691 
692 #endif /* Intrepid2_DerivedBasis_HCURL_HEX_h */
virtual void getDofCoeffs(ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom for Lagrangian basis on the reference cell...
Teuchos::RCP< BasisBase > getSubCellRefBasis(const ordinal_type subCellDim, const ordinal_type subCellOrd) const override
returns the basis associated to a subCell.
virtual bool requireOrientation() const override
True if orientation is required.
Basis_Derived_HCURL_Family1_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
Basis_Derived_HCURL_Family1_Family2_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType)
Constructor.
virtual const char * getName() const override
Returns basis name.
virtual OperatorTensorDecomposition getSimpleOperatorDecomposition(const EOperator &operatorType) const override
Returns a simple decomposition of the specified operator: what operator(s) should be applied to basis...
Implementation of bases that are tensor products of two or three component bases. ...
Free functions, callable from device code, that implement various polynomials useful in basis definit...
For a multi-component tensor basis, specifies the operators to be applied to the components to produc...
virtual void getValues(OutputViewType outputValues, const EOperator operatorType, const PointViewType inputPoints12, const PointViewType inputPoints3, bool tensorPoints) const override
Evaluation of a tensor FEM basis on a reference cell.
virtual OperatorTensorDecomposition getSimpleOperatorDecomposition(const EOperator &operatorType) const override
Returns a simple decomposition of the specified operator: what operator(s) should be applied to basis...
Basis_Derived_HCURL_Family2_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
Implementation of a basis that is the direct sum of two other bases.
A basis that is the direct sum of two other bases.
virtual const char * getName() const override
Returns basis name.
Basis_Derived_HCURL_Family3_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
Basis_Derived_HCURL_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
virtual void getValues(OutputViewType outputValues, const EOperator operatorType, const PointViewType inputPoints1, const PointViewType inputPoints2, const PointViewType inputPoints3, bool tensorPoints) const override
multi-component getValues() method (required/called by TensorBasis3)
virtual void getDofCoeffs(ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom for Lagrangian basis on the reference cell...
virtual void getValues(OutputViewType outputValues, const EOperator operatorType, const PointViewType inputPoints1, const PointViewType inputPoints2, const PointViewType inputPoints3, bool tensorPoints) const override
multi-component getValues() method (required/called by TensorBasis3)
Header file to include all Sacado headers that are required if using Intrepid2 with Sacado types...
virtual OperatorTensorDecomposition getSimpleOperatorDecomposition(const EOperator &operatorType) const override
Returns a simple decomposition of the specified operator: what operator(s) should be applied to basis...
virtual void getDofCoeffs(typename BasisBase::ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom on the reference cell.
virtual void getValues(OutputViewType outputValues, const EOperator operatorType, const PointViewType inputPoints1, const PointViewType inputPoints2, const PointViewType inputPoints3, bool tensorPoints) const override
multi-component getValues() method (required/called by TensorBasis3)
Basis_Derived_HCURL_HEX(int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT)
Constructor.
virtual HostBasisPtr< OutputValueType, PointValueType > getHostBasis() const override
Creates and returns a Basis object whose DeviceType template argument is Kokkos::HostSpace::device_ty...
virtual void getDofCoeffs(ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom for Lagrangian basis on the reference cell...