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_View.hpp>
58 #include <Kokkos_DynRankView.hpp>
59 
61 #include "Intrepid2_Sacado.hpp"
62 
65 
66 namespace Intrepid2
67 {
68  template<class HGRAD_LINE, class HVOL_LINE>
70  : public Basis_TensorBasis3<typename HGRAD_LINE::BasisBase>
71  {
72  public:
73  using OutputViewType = typename HGRAD_LINE::OutputViewType;
74  using PointViewType = typename HGRAD_LINE::PointViewType ;
75  using ScalarViewType = typename HGRAD_LINE::ScalarViewType;
76 
77  using LineGradBasis = HGRAD_LINE;
78  using LineVolBasis = HVOL_LINE;
79 
81  public:
88  Basis_Derived_HCURL_Family1_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType = POINTTYPE_DEFAULT)
89  :
90  TensorBasis3(Teuchos::rcp(new LineVolBasis (polyOrder_x-1,pointType)),
91  Teuchos::rcp(new LineGradBasis(polyOrder_y,pointType)),
92  Teuchos::rcp(new LineGradBasis(polyOrder_z,pointType)))
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  {
249  this->functionSpace_ = FUNCTION_SPACE_HCURL;
250  }
251 
254  virtual OperatorTensorDecomposition getSimpleOperatorDecomposition(const EOperator operatorType) const override
255  {
256  const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
257  const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
258  const EOperator CURL = Intrepid2::OPERATOR_CURL;
259  if (operatorType == VALUE)
260  {
261  // family 2 goes in y component
262  std::vector< std::vector<EOperator> > ops(3);
263  ops[0] = std::vector<EOperator>{};
264  ops[1] = std::vector<EOperator>{VALUE,VALUE,VALUE};
265  ops[2] = std::vector<EOperator>{};
266  std::vector<double> weights {0.0, 1.0, 0.0};
267  return OperatorTensorDecomposition(ops, weights);
268  }
269  else if (operatorType == CURL)
270  {
271  // 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.
272  // x component is -d/dz: (VALUE,VALUE,GRAD), weight = -1.0
273  // y component is zero
274  // z component is d/dx: (GRAD,VALUE,VALUE), weight = 1.0
275  std::vector< std::vector<EOperator> > ops(3);
276  ops[0] = std::vector<EOperator>{VALUE,VALUE,GRAD};
277  ops[1] = std::vector<EOperator>{};
278  ops[2] = std::vector<EOperator>{GRAD,VALUE,VALUE};
279 
280  std::vector<double> weights {-1.0, 0.0, 1.0};
281  return OperatorTensorDecomposition(ops,weights);
282  }
283  else
284  {
285  INTREPID2_TEST_FOR_EXCEPTION(true, std::invalid_argument, "Unsupported operator type");
286  }
287  }
288 
290 
299  virtual void getValues(OutputViewType outputValues, const EOperator operatorType,
300  const PointViewType inputPoints1, const PointViewType inputPoints2, const PointViewType inputPoints3,
301  bool tensorPoints) const override
302  {
303  Intrepid2::EOperator op1, op2, op3;
304  if (operatorType == Intrepid2::OPERATOR_VALUE)
305  {
306  op1 = Intrepid2::OPERATOR_VALUE;
307  op2 = Intrepid2::OPERATOR_VALUE;
308  op3 = Intrepid2::OPERATOR_VALUE;
309 
310  // family 2 goes in the y component; 0 in the x and z components
311  auto outputValuesComponent_x = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
312  auto outputValuesComponent_y = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
313  auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
314 
315  // place 0 in the x component
316  Kokkos::deep_copy(outputValuesComponent_x,0.0);
317  // evaluate y component
318  this->TensorBasis3::getValues(outputValuesComponent_y,
319  inputPoints1, op1,
320  inputPoints2, op2,
321  inputPoints3, op3, tensorPoints);
322  // place 0 in the z component
323  Kokkos::deep_copy(outputValuesComponent_z,0.0);
324  }
325  else if (operatorType == Intrepid2::OPERATOR_CURL)
326  {
327  // 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.
328  auto outputValuesComponent_x = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
329  auto outputValuesComponent_y = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
330  auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
331 
332  // x component is -d/dz
333  op1 = Intrepid2::OPERATOR_VALUE;
334  op2 = Intrepid2::OPERATOR_VALUE;
335  op3 = Intrepid2::OPERATOR_GRAD; // d/dz
336 
337  double weight = -1.0; // the minus sign in front of d/dz
338  this->TensorBasis3::getValues(outputValuesComponent_x,
339  inputPoints1, op1,
340  inputPoints2, op2,
341  inputPoints3, op3, tensorPoints, weight);
342 
343  // y component is zero
344  Kokkos::deep_copy(outputValuesComponent_y, 0.0);
345 
346  // z component is d/dx
347  op1 = Intrepid2::OPERATOR_GRAD; // d/dx
348  op2 = Intrepid2::OPERATOR_VALUE;
349  op3 = Intrepid2::OPERATOR_VALUE;
350  weight = 1.0; // the weight on d/dx
351  this->TensorBasis3::getValues(outputValuesComponent_z,
352  inputPoints1, op1,
353  inputPoints2, op2,
354  inputPoints3, op3, tensorPoints, weight);
355  }
356  else
357  {
358  INTREPID2_TEST_FOR_EXCEPTION(true,std::invalid_argument,"operator not yet supported");
359  }
360  }
361 
373  virtual void getDofCoeffs( ScalarViewType dofCoeffs ) const override {
374  auto dofCoeffs1 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),0);
375  auto dofCoeffs2 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),1);
376  auto dofCoeffs3 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),2);
377  Kokkos::deep_copy(dofCoeffs1,0.0);
378  this->TensorBasis3::getDofCoeffs(dofCoeffs2);
379  Kokkos::deep_copy(dofCoeffs3,0.0);
380  }
381 
382 
383  };
384 
385  template<class HGRAD_LINE, class HVOL_LINE>
387  : public Basis_TensorBasis3<typename HGRAD_LINE::BasisBase>
388  {
389  using OutputViewType = typename HGRAD_LINE::OutputViewType;
390  using PointViewType = typename HGRAD_LINE::PointViewType ;
391  using ScalarViewType = typename HGRAD_LINE::ScalarViewType;
392 
393  using LineGradBasis = HGRAD_LINE;
394  using LineVolBasis = HVOL_LINE;
395 
397  public:
404  Basis_Derived_HCURL_Family3_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType = POINTTYPE_DEFAULT)
405  :
406  TensorBasis3(Teuchos::rcp(new LineGradBasis(polyOrder_x,pointType)),
407  Teuchos::rcp(new LineGradBasis(polyOrder_y,pointType)),
408  Teuchos::rcp(new LineVolBasis (polyOrder_z-1,pointType)))
409  {}
410 
413  virtual OperatorTensorDecomposition getSimpleOperatorDecomposition(const EOperator operatorType) const override
414  {
415  const EOperator VALUE = Intrepid2::OPERATOR_VALUE;
416  const EOperator GRAD = Intrepid2::OPERATOR_GRAD;
417  if (operatorType == Intrepid2::OPERATOR_VALUE)
418  {
419  // family 3 goes in z component
420  std::vector< std::vector<EOperator> > ops(3);
421  ops[0] = std::vector<EOperator>{};
422  ops[1] = std::vector<EOperator>{};
423  ops[2] = std::vector<EOperator>{VALUE,VALUE,VALUE};
424  std::vector<double> weights {0.0, 0.0, 1.0};
425  return OperatorTensorDecomposition(ops, weights);
426  }
427  else if (operatorType == Intrepid2::OPERATOR_CURL)
428  {
429  // 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.
430  // x component is d/dy: (VALUE,GRAD,VALUE), weight = 1.0
431  // y component is d/dx: (GRAD,VALUE,VALUE), weight = -1.0
432  // z component is zero
433  std::vector< std::vector<EOperator> > ops(3);
434  ops[0] = std::vector<EOperator>{VALUE,GRAD,VALUE};
435  ops[1] = std::vector<EOperator>{GRAD,VALUE,VALUE};
436  ops[2] = std::vector<EOperator>{};
437 
438  std::vector<double> weights {1.0, -1.0, 0.0};
439  return OperatorTensorDecomposition(ops,weights);
440  }
441  else
442  {
443  INTREPID2_TEST_FOR_EXCEPTION(true, std::invalid_argument, "Unsupported operator type");
444  }
445  }
446 
448 
457  virtual void getValues(OutputViewType outputValues, const EOperator operatorType,
458  const PointViewType inputPoints1, const PointViewType inputPoints2, const PointViewType inputPoints3,
459  bool tensorPoints) const override
460  {
461  Intrepid2::EOperator op1, op2, op3;
462  if (operatorType == Intrepid2::OPERATOR_VALUE)
463  {
464  op1 = Intrepid2::OPERATOR_VALUE;
465  op2 = Intrepid2::OPERATOR_VALUE;
466  op3 = Intrepid2::OPERATOR_VALUE;
467 
468  // family 3 goes in the z component; 0 in the x and y components
469  auto outputValuesComponent_xy = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),std::make_pair(0,2));
470  auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
471 
472  // place 0 in the x and y components
473  Kokkos::deep_copy(outputValuesComponent_xy,0.0);
474  // evaluate z component
475  this->TensorBasis3::getValues(outputValuesComponent_z,
476  inputPoints1, op1,
477  inputPoints2, op2,
478  inputPoints3, op3, tensorPoints);
479  }
480  else if (operatorType == Intrepid2::OPERATOR_CURL)
481  {
482  // 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.
483  auto outputValuesComponent_x = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),0);
484  auto outputValuesComponent_y = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),1);
485  auto outputValuesComponent_z = Kokkos::subview(outputValues,Kokkos::ALL(),Kokkos::ALL(),2);
486 
487  // x component is d/dy
488  op1 = Intrepid2::OPERATOR_VALUE;
489  op2 = Intrepid2::OPERATOR_GRAD; // d/dy
490  op3 = Intrepid2::OPERATOR_VALUE;
491 
492  double weight = 1.0; // the sign in front of d/dy
493  this->TensorBasis3::getValues(outputValuesComponent_x,
494  inputPoints1, op1,
495  inputPoints2, op2,
496  inputPoints3, op3, tensorPoints, weight);
497  // y component is -d/dx
498  op1 = Intrepid2::OPERATOR_GRAD; // d/dx
499  op2 = Intrepid2::OPERATOR_VALUE;
500  op3 = Intrepid2::OPERATOR_VALUE;
501  weight = -1.0; // the weight on d/dx
502  this->TensorBasis3::getValues(outputValuesComponent_y,
503  inputPoints1, op1,
504  inputPoints2, op2,
505  inputPoints3, op3, tensorPoints, weight);
506 
507  // z component is zero
508  Kokkos::deep_copy(outputValuesComponent_z, 0.0);
509  }
510  else
511  {
512  INTREPID2_TEST_FOR_EXCEPTION(true,std::invalid_argument,"operator not yet supported");
513  }
514  }
515 
527  virtual void getDofCoeffs( ScalarViewType dofCoeffs ) const override {
528  auto dofCoeffs12 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),std::make_pair(0,2));
529  auto dofCoeffs3 = Kokkos::subview(dofCoeffs,Kokkos::ALL(),2);
530  Kokkos::deep_copy(dofCoeffs12,0.0);
531  this->TensorBasis3::getDofCoeffs(dofCoeffs3);
532  }
533  };
534 
535  template<class HGRAD_LINE, class HVOL_LINE>
537  : public Basis_DirectSumBasis <typename HGRAD_LINE::BasisBase>
538  {
542  public:
549  Basis_Derived_HCURL_Family1_Family2_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType)
550  :
551  DirectSumBasis(Teuchos::rcp(new Family1(polyOrder_x, polyOrder_y, polyOrder_z, pointType)),
552  Teuchos::rcp(new Family2(polyOrder_x, polyOrder_y, polyOrder_z, pointType))) {}
553  };
554 
555  template<class HGRAD_LINE, class HVOL_LINE>
557  : public Basis_DirectSumBasis <typename HGRAD_LINE::BasisBase>
558  {
562 
563  std::string name_;
564  ordinal_type order_x_;
565  ordinal_type order_y_;
566  ordinal_type order_z_;
567  EPointType pointType_;
568 
569  public:
570 
571  using ExecutionSpace = typename HGRAD_LINE::ExecutionSpace;
572  using OutputValueType = typename HGRAD_LINE::OutputValueType;
573  using PointValueType = typename HGRAD_LINE::PointValueType;
574 
575  using BasisBase = typename HGRAD_LINE::BasisBase;
576 
583  Basis_Derived_HCURL_HEX(int polyOrder_x, int polyOrder_y, int polyOrder_z, const EPointType pointType=POINTTYPE_DEFAULT)
584  :
585  DirectSumBasis(Teuchos::rcp(new Family12(polyOrder_x, polyOrder_y, polyOrder_z, pointType)),
586  Teuchos::rcp(new Family3 (polyOrder_x, polyOrder_y, polyOrder_z, pointType))) {
587  this->functionSpace_ = FUNCTION_SPACE_HCURL;
588 
589  std::ostringstream basisName;
590  basisName << "HCURL_HEX (" << this->DirectSumBasis::getName() << ")";
591  name_ = basisName.str();
592 
593  order_x_ = polyOrder_x;
594  order_y_ = polyOrder_y;
595  order_z_ = polyOrder_z;
596  pointType_ = pointType;
597  }
598 
602  Basis_Derived_HCURL_HEX(int polyOrder, const EPointType pointType=POINTTYPE_DEFAULT) : Basis_Derived_HCURL_HEX(polyOrder, polyOrder, polyOrder, pointType) {}
603 
606  virtual bool requireOrientation() const override {
607  return (this->getDofCount(1,0) > 0); //if it has edge DOFs, than it needs orientations
608  }
609 
614  virtual
615  const char*
616  getName() const override {
617  return name_.c_str();
618  }
619 
630  Teuchos::RCP<BasisBase>
631  getSubCellRefBasis(const ordinal_type subCellDim, const ordinal_type subCellOrd) const override{
632 
633  using LineBasis = HVOL_LINE;
635 
636  if(subCellDim == 1) {
637  switch(subCellOrd) {
638  case 0:
639  case 2:
640  case 4:
641  case 6:
642  return Teuchos::rcp( new LineBasis(order_x_-1, pointType_) );
643  case 1:
644  case 3:
645  case 5:
646  case 7:
647  return Teuchos::rcp( new LineBasis(order_y_-1, pointType_) );
648  case 8:
649  case 9:
650  case 10:
651  case 11:
652  return Teuchos::rcp( new LineBasis(order_z_-1, pointType_) );
653  }
654  } else if(subCellDim == 2) {
655  switch(subCellOrd) {
656  case 0:
657  return Teuchos::rcp( new QuadBasis(order_x_, order_z_, pointType_) );
658  case 1:
659  return Teuchos::rcp( new QuadBasis(order_y_,order_z_, pointType_) );
660  case 2:
661  return Teuchos::rcp( new QuadBasis(order_x_, order_z_, pointType_) );
662  case 3:
663  return Teuchos::rcp( new QuadBasis(order_z_, order_y_, pointType_) );
664  case 4:
665  return Teuchos::rcp( new QuadBasis(order_y_, order_x_, pointType_) );
666  case 5:
667  return Teuchos::rcp( new QuadBasis(order_x_, order_y_, pointType_) );
668  }
669  }
670 
671  INTREPID2_TEST_FOR_EXCEPTION(true,std::invalid_argument,"Input parameters out of bounds");
672  }
678  getHostBasis() const override {
680 
681  auto hostBasis = Teuchos::rcp(new HostBasis(order_x_, order_y_, order_z_, pointType_));
682 
683  return hostBasis;
684  }
685  };
686 } // end namespace Intrepid2
687 
688 #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.
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.
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.
BasisPtr< typename Kokkos::HostSpace::device_type, OutputType, PointType > HostBasisPtr
Pointer to a Basis whose device type is on the host (Kokkos::HostSpace::device_type), allowing host access to input and output views, and ensuring host execution of basis evaluation.
virtual void getDofCoeffs(typename BasisBase::ScalarViewType dofCoeffs) const override
Fills in coefficients of degrees of freedom on the 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...
A basis that is the direct sum of two other bases.
virtual const char * getName() const override
Returns basis name.
EOperator
Enumeration of primitive operators available in Intrepid. Primitive operators act on reconstructed fu...
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 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 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...
EPointType
Enumeration of types of point distributions in Intrepid.
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 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 OperatorTensorDecomposition getSimpleOperatorDecomposition(const EOperator operatorType) const override
Returns a simple decomposition of the specified operator: what operator(s) should be applied to basis...
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...