Intrepid2
Intrepid2_Basis.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 
50 #ifndef __INTREPID2_BASIS_HPP__
51 #define __INTREPID2_BASIS_HPP__
52 
53 #include "Intrepid2_ConfigDefs.hpp"
54 #include "Intrepid2_Types.hpp"
55 #include "Intrepid2_Utils.hpp"
56 
58 #include "Kokkos_Vector.hpp"
59 #include "Shards_CellTopology.hpp"
60 
61 #include <vector>
62 
63 namespace Intrepid2 {
64 
101  template<typename ExecSpaceType = void,
102  typename outputValueType = double,
103  typename pointValueType = double>
104  class Basis {
105  public:
108  using ExecutionSpace = ExecSpaceType;
109 
112  using OutputValueType = outputValueType;
113 
116  using PointValueType = pointValueType;
117 
120  using OrdinalViewType = Kokkos::View<ordinal_type,ExecSpaceType>;
121 
124  using EBasisViewType = Kokkos::View<EBasis,ExecSpaceType>;
125 
128  using ECoordinatesViewType = Kokkos::View<ECoordinates,ExecSpaceType>;
129 
130  // ** tag interface
131  // - tag interface is not decorated with Kokkos inline so it should be allocated on hostspace
132 
135  using OrdinalTypeArray1DHost = Kokkos::View<ordinal_type*,typename ExecSpaceType::array_layout,Kokkos::HostSpace>;
136 
139  using OrdinalTypeArray2DHost = Kokkos::View<ordinal_type**,typename ExecSpaceType::array_layout,Kokkos::HostSpace>;
140 
143  using OrdinalTypeArray3DHost = Kokkos::View<ordinal_type***,typename ExecSpaceType::array_layout,Kokkos::HostSpace>;
144 
147  using OrdinalTypeArrayStride1DHost = Kokkos::View<ordinal_type*, Kokkos::LayoutStride, Kokkos::HostSpace>;
148 
151  using OrdinalTypeArray1D = Kokkos::View<ordinal_type*,ExecSpaceType>;
152 
155  using OrdinalTypeArray2D = Kokkos::View<ordinal_type**,ExecSpaceType>;
156 
159  using OrdinalTypeArray3D = Kokkos::View<ordinal_type***,ExecSpaceType>;
160 
163  using OrdinalTypeArrayStride1D = Kokkos::View<ordinal_type*, Kokkos::LayoutStride, ExecSpaceType>;
164 
167  typedef typename ScalarTraits<pointValueType>::scalar_type scalarType;
168  protected:
169 
172  ordinal_type basisCardinality_;
173 
176  ordinal_type basisDegree_;
177 
182  shards::CellTopology basisCellTopology_;
183 
186  EBasis basisType_;
187 
190  ECoordinates basisCoordinates_;
191 
194  EFunctionSpace functionSpace_ = FUNCTION_SPACE_MAX;
195 
198  //Kokkos::View<bool,ExecSpaceType> basisTagsAreSet_;
199 
212 
225 
237  template<typename OrdinalTypeView3D,
238  typename OrdinalTypeView2D,
239  typename OrdinalTypeView1D>
240  void setOrdinalTagData( OrdinalTypeView3D &tagToOrdinal,
241  OrdinalTypeView2D &ordinalToTag,
242  const OrdinalTypeView1D tags,
243  const ordinal_type basisCard,
244  const ordinal_type tagSize,
245  const ordinal_type posScDim,
246  const ordinal_type posScOrd,
247  const ordinal_type posDfOrd ) {
248  // Create ordinalToTag
249  ordinalToTag = OrdinalTypeView2D("ordinalToTag", basisCard, tagSize);
250 
251  // Initialize with -1
252  Kokkos::deep_copy( ordinalToTag, -1 );
253 
254  // Copy tags
255  for (ordinal_type i=0;i<basisCard;++i)
256  for (ordinal_type j=0;j<tagSize;++j)
257  ordinalToTag(i, j) = tags(i*tagSize + j);
258 
259  // Find out dimension of tagToOrdinal
260  auto maxScDim = 0; // first dimension of tagToOrdinal
261  for (ordinal_type i=0;i<basisCard;++i)
262  if (maxScDim < tags(i*tagSize + posScDim))
263  maxScDim = tags(i*tagSize + posScDim);
264  ++maxScDim;
265 
266  auto maxScOrd = 0; // second dimension of tagToOrdinal
267  for (ordinal_type i=0;i<basisCard;++i)
268  if (maxScOrd < tags(i*tagSize + posScOrd))
269  maxScOrd = tags(i*tagSize + posScOrd);
270  ++maxScOrd;
271 
272  auto maxDfOrd = 0; // third dimension of tagToOrdinal
273  for (ordinal_type i=0;i<basisCard;++i)
274  if (maxDfOrd < tags(i*tagSize + posDfOrd))
275  maxDfOrd = tags(i*tagSize + posDfOrd);
276  ++maxDfOrd;
277 
278  // Create tagToOrdinal
279  tagToOrdinal = OrdinalTypeView3D("tagToOrdinal", maxScDim, maxScOrd, maxDfOrd);
280 
281  // Initialize with -1
282  Kokkos::deep_copy( tagToOrdinal, -1 );
283 
284  // Overwrite elements of the array corresponding to tags with local DoF Id's, leave all other = -1
285  for (ordinal_type i=0;i<basisCard;++i)
286  tagToOrdinal(tags(i*tagSize), tags(i*tagSize+1), tags(i*tagSize+2)) = i;
287  }
288 
289  // dof coords
292  Kokkos::DynRankView<scalarType,ExecSpaceType> dofCoords_;
293 
294  // dof coeffs
302  Kokkos::DynRankView<scalarType,ExecSpaceType> dofCoeffs_;
303 
312  public:
313 
314  Basis() = default;
315  virtual~Basis() = default;
316 
317  // receives input arguments
320  OutputValueType getDummyOutputValue() { return outputValueType(); }
321 
324  PointValueType getDummyPointValue() { return pointValueType(); }
325 
328  using OutputViewType = Kokkos::DynRankView<OutputValueType,Kokkos::LayoutStride,ExecSpaceType>;
329 
332  using PointViewType = Kokkos::DynRankView<PointValueType,Kokkos::LayoutStride,ExecSpaceType>;
333 
336  using ScalarViewType = Kokkos::DynRankView<scalarType,Kokkos::LayoutStride,ExecSpaceType>;
337 
356  virtual
357  void
358  getValues( OutputViewType /* outputValues */,
359  const PointViewType /* inputPoints */,
360  const EOperator /* operatorType */ = OPERATOR_VALUE ) const {
361  INTREPID2_TEST_FOR_EXCEPTION( true, std::logic_error,
362  ">>> ERROR (Basis::getValues): this method (FEM) is not supported or should be overridden accordingly by derived classes.");
363  }
364 
384  virtual
385  void
386  getValues( OutputViewType /* outputValues */,
387  const PointViewType /* inputPoints */,
388  const PointViewType /* cellVertices */,
389  const EOperator /* operatorType */ = OPERATOR_VALUE ) const {
390  INTREPID2_TEST_FOR_EXCEPTION( true, std::logic_error,
391  ">>> ERROR (Basis::getValues): this method (FVM) is not supported or should be overridden accordingly by derived classes.");
392  }
393 
394 
398  virtual
399  void
400  getDofCoords( ScalarViewType /* dofCoords */ ) const {
401  INTREPID2_TEST_FOR_EXCEPTION( true, std::logic_error,
402  ">>> ERROR (Basis::getDofCoords): this method is not supported or should be overridden accordingly by derived classes.");
403  }
404 
413  virtual
414  void
415  getDofCoeffs( ScalarViewType /* dofCoeffs */ ) const {
416  INTREPID2_TEST_FOR_EXCEPTION( true, std::logic_error,
417  ">>> ERROR (Basis::getDofCoeffs): this method is not supported or should be overridden accordingly by derived classes.");
418  }
419 
428  {
429  INTREPID2_TEST_FOR_EXCEPTION( basisType_ != BASIS_FEM_HIERARCHICAL, std::logic_error,
430  ">>> ERROR (Basis::getFieldOrdinalsForDegree): this method is not supported for non-hierarchical bases.");
431  int degreeEntryLength = fieldOrdinalPolynomialDegree_.extent_int(1);
432  int requestedDegreeLength = degrees.extent_int(0);
433  INTREPID2_TEST_FOR_EXCEPTION(degreeEntryLength != requestedDegreeLength, std::invalid_argument, "length of degrees does not match the entries in fieldOrdinalPolynomialDegree_");
434  std::vector<int> fieldOrdinalsVector;
435  for (int basisOrdinal=0; basisOrdinal<fieldOrdinalPolynomialDegree_.extent_int(0); basisOrdinal++)
436  {
437  bool matches = true;
438  for (int d=0; d<degreeEntryLength; d++)
439  {
440  if (fieldOrdinalPolynomialDegree_(basisOrdinal,d) > degrees(d)) matches = false;
441  }
442  if (matches) fieldOrdinalsVector.push_back(basisOrdinal);
443  }
444  OrdinalTypeArray1DHost fieldOrdinals("fieldOrdinalsForDegree",fieldOrdinalsVector.size());
445  for (unsigned i=0; i<fieldOrdinalsVector.size(); i++)
446  {
447  fieldOrdinals(i) = fieldOrdinalsVector[i];
448  }
449  return fieldOrdinals;
450  }
451 
463  std::vector<int> getFieldOrdinalsForDegree(std::vector<int> &degrees) const
464  {
465  INTREPID2_TEST_FOR_EXCEPTION( basisType_ != BASIS_FEM_HIERARCHICAL, std::logic_error,
466  ">>> ERROR (Basis::getFieldOrdinalsForDegree): this method is not supported for non-hierarchical bases.");
467  OrdinalTypeArray1DHost degreesView("degrees",degrees.size());
468  for (unsigned d=0; d<degrees.size(); d++)
469  {
470  degreesView(d) = degrees[d];
471  }
472  auto fieldOrdinalsView = getFieldOrdinalsForDegree(degreesView);
473  std::vector<int> fieldOrdinalsVector(fieldOrdinalsView.extent_int(0));
474  for (int i=0; i<fieldOrdinalsView.extent_int(0); i++)
475  {
476  fieldOrdinalsVector[i] = fieldOrdinalsView(i);
477  }
478  return fieldOrdinalsVector;
479  }
480 
488  {
489  INTREPID2_TEST_FOR_EXCEPTION( basisType_ != BASIS_FEM_HIERARCHICAL, std::logic_error,
490  ">>> ERROR (Basis::getPolynomialDegreeOfField): this method is not supported for non-hierarchical bases.");
491  INTREPID2_TEST_FOR_EXCEPTION(fieldOrdinal < 0, std::invalid_argument, "field ordinal must be non-negative");
492  INTREPID2_TEST_FOR_EXCEPTION(fieldOrdinal >= fieldOrdinalPolynomialDegree_.extent_int(0), std::invalid_argument, "field ordinal out of bounds");
493 
494  int polyDegreeLength = getPolynomialDegreeLength();
495  OrdinalTypeArray1DHost polyDegree("polynomial degree", polyDegreeLength);
496  for (int d=0; d<polyDegreeLength; d++)
497  {
498  polyDegree(d) = fieldOrdinalPolynomialDegree_(fieldOrdinal,d);
499  }
500  return polyDegree;
501  }
502 
510  std::vector<int> getPolynomialDegreeOfFieldAsVector(int fieldOrdinal) const
511  {
512  INTREPID2_TEST_FOR_EXCEPTION( basisType_ != BASIS_FEM_HIERARCHICAL, std::logic_error,
513  ">>> ERROR (Basis::getPolynomialDegreeOfFieldAsVector): this method is not supported for non-hierarchical bases.");
514  auto polynomialDegreeView = getPolynomialDegreeOfField(fieldOrdinal);
515  std::vector<int> polynomialDegree(polynomialDegreeView.extent_int(0));
516 
517  for (unsigned d=0; d<polynomialDegree.size(); d++)
518  {
519  polynomialDegree[d] = polynomialDegreeView(d);
520  }
521  return polynomialDegree;
522  }
523 
527  {
528  INTREPID2_TEST_FOR_EXCEPTION( basisType_ != BASIS_FEM_HIERARCHICAL, std::logic_error,
529  ">>> ERROR (Basis::getPolynomialDegreeLength): this method is not supported for non-hierarchical bases.");
530  return fieldOrdinalPolynomialDegree_.extent_int(1);
531  }
532 
537  virtual
538  const char*
539  getName() const {
540  return "Intrepid2_Basis";
541  }
542 
545  virtual
546  bool
548  return false;
549  }
550 
555  ordinal_type
556  getCardinality() const {
557  return basisCardinality_;
558  }
559 
560 
565  ordinal_type
566  getDegree() const {
567  return basisDegree_;
568  }
569 
574  EFunctionSpace
576  return functionSpace_;
577  }
578 
584  shards::CellTopology
586  return basisCellTopology_;
587  }
588 
589 
594  EBasis
595  getBasisType() const {
596  return basisType_;
597  }
598 
599 
604  ECoordinates
606  return basisCoordinates_;
607  }
608 
616  ordinal_type
617  getDofCount( const ordinal_type subcDim,
618  const ordinal_type subcOrd ) const {
619  if ( subcDim >= 0 && subcDim < static_cast<ordinal_type>(tagToOrdinal_.extent(0)) &&
620  subcOrd >= 0 && subcOrd < static_cast<ordinal_type>(tagToOrdinal_.extent(1)) )
621  {
622  int firstDofOrdinal = tagToOrdinal_(subcDim, subcOrd, 0); // will be -1 if no dofs for subcell
623  if (firstDofOrdinal == -1) return static_cast<ordinal_type>(0);
624  // otherwise, lookup its tag and return the dof count stored there
625  return static_cast<ordinal_type>(this->getDofTag(firstDofOrdinal)[3]);
626  }
627  else
628  {
629  // subcDim and/or subcOrd out of bounds -> no dofs associated with subcell
630  return static_cast<ordinal_type>(0);
631  }
632  }
633 
642  ordinal_type
643  getDofOrdinal( const ordinal_type subcDim,
644  const ordinal_type subcOrd,
645  const ordinal_type subcDofOrd ) const {
646  // this should be abort and able to be called as a device function
647 #ifdef HAVE_INTREPID2_DEBUG
648  INTREPID2_TEST_FOR_EXCEPTION( subcDim < 0 || subcDim >= static_cast<ordinal_type>(tagToOrdinal_.extent(0)), std::out_of_range,
649  ">>> ERROR (Basis::getDofOrdinal): subcDim is out of range");
650  INTREPID2_TEST_FOR_EXCEPTION( subcOrd < 0 || subcOrd >= static_cast<ordinal_type>(tagToOrdinal_.extent(1)), std::out_of_range,
651  ">>> ERROR (Basis::getDofOrdinal): subcOrd is out of range");
652  INTREPID2_TEST_FOR_EXCEPTION( subcDofOrd < 0 || subcDofOrd >= static_cast<ordinal_type>(tagToOrdinal_.extent(2)), std::out_of_range,
653  ">>> ERROR (Basis::getDofOrdinal): subcDofOrd is out of range");
654 #endif
655  ordinal_type r_val = -1;
656  if ( subcDim < static_cast<ordinal_type>(tagToOrdinal_.extent(0)) &&
657  subcOrd < static_cast<ordinal_type>(tagToOrdinal_.extent(1)) &&
658  subcDofOrd < static_cast<ordinal_type>(tagToOrdinal_.extent(2)) )
659  r_val = tagToOrdinal_(subcDim, subcOrd, subcDofOrd);
660 #ifdef HAVE_INTREPID2_DEBUG
661  INTREPID2_TEST_FOR_EXCEPTION( r_val == -1, std::runtime_error,
662  ">>> ERROR (Basis::getDofOrdinal): Invalid DoF tag is found.");
663 #endif
664  return r_val;
665  }
666 
670  return tagToOrdinal_;
671  }
672 
673 
685  getDofTag( const ordinal_type dofOrd ) const {
686 #ifdef HAVE_INTREPID2_DEBUG
687  INTREPID2_TEST_FOR_EXCEPTION( dofOrd < 0 || dofOrd >= static_cast<ordinal_type>(ordinalToTag_.extent(0)), std::out_of_range,
688  ">>> ERROR (Basis::getDofTag): dofOrd is out of range");
689 #endif
690  return Kokkos::subview(ordinalToTag_, dofOrd, Kokkos::ALL());
691  }
692 
693 
703  getAllDofTags() const {
704  return ordinalToTag_;
705  }
706 
707  }; // class Basis
708 
709 
710  //--------------------------------------------------------------------------------------------//
711  // //
712  // Helper functions of the Basis class //
713  // //
714  //--------------------------------------------------------------------------------------------//
715 
716  //
717  // functions for orders, cardinality, etc.
718  //
719 
720 
732  KOKKOS_INLINE_FUNCTION
733  ordinal_type getFieldRank(const EFunctionSpace spaceType);
734 
770  KOKKOS_INLINE_FUNCTION
771  ordinal_type getOperatorRank(const EFunctionSpace spaceType,
772  const EOperator operatorType,
773  const ordinal_type spaceDim);
774 
780  KOKKOS_INLINE_FUNCTION
781  ordinal_type getOperatorOrder(const EOperator operatorType);
782 
783  template<EOperator operatorType>
784  KOKKOS_INLINE_FUNCTION
785  constexpr ordinal_type getOperatorOrder();
786 
810  template<ordinal_type spaceDim>
811  KOKKOS_INLINE_FUNCTION
812  ordinal_type getDkEnumeration(const ordinal_type xMult,
813  const ordinal_type yMult = -1,
814  const ordinal_type zMult = -1);
815 
816 
827  template<ordinal_type spaceDim>
828  KOKKOS_INLINE_FUNCTION
829  ordinal_type getPnEnumeration(const ordinal_type p,
830  const ordinal_type q = 0,
831  const ordinal_type r = 0);
832 
833 
834 
853 template<typename value_type>
854 KOKKOS_INLINE_FUNCTION
855 void getJacobyRecurrenceCoeffs (
856  value_type &an,
857  value_type &bn,
858  value_type &cn,
859  const ordinal_type alpha,
860  const ordinal_type beta ,
861  const ordinal_type n);
862 
863 
864 
865 
866 
867  // /** \brief Returns multiplicities of dx, dy, and dz based on the enumeration of the partial
868  // derivative, its order and the space dimension. Inverse of the getDkEnumeration() method.
869 
870  // \param partialMult [out] - array with the multiplicities f dx, dy and dz
871  // \param derivativeEnum [in] - enumeration of the partial derivative
872  // \param operatorType [in] - k-th partial derivative Dk
873  // \param spaceDim [in] - space dimension
874  // */
875  // template<typename OrdinalArrayType>
876  // KOKKOS_INLINE_FUNCTION
877  // void getDkMultiplicities(OrdinalArrayType partialMult,
878  // const ordinal_type derivativeEnum,
879  // const EOperator operatorType,
880  // const ordinal_type spaceDim);
881 
900  KOKKOS_INLINE_FUNCTION
901  ordinal_type getDkCardinality(const EOperator operatorType,
902  const ordinal_type spaceDim);
903 
904  template<EOperator operatorType, ordinal_type spaceDim>
905  KOKKOS_INLINE_FUNCTION
906  constexpr ordinal_type getDkCardinality();
907 
908 
909 
919  template<ordinal_type spaceDim>
920  KOKKOS_INLINE_FUNCTION
921  ordinal_type getPnCardinality (ordinal_type n);
922 
923  template<ordinal_type spaceDim, ordinal_type n>
924  KOKKOS_INLINE_FUNCTION
925  constexpr ordinal_type getPnCardinality ();
926 
927 
928 
929  //
930  // Argument check
931  //
932 
933 
944  template<typename outputValueViewType,
945  typename inputPointViewType>
946  void getValues_HGRAD_Args( const outputValueViewType outputValues,
947  const inputPointViewType inputPoints,
948  const EOperator operatorType,
949  const shards::CellTopology cellTopo,
950  const ordinal_type basisCard );
951 
962  template<typename outputValueViewType,
963  typename inputPointViewType>
964  void getValues_HCURL_Args( const outputValueViewType outputValues,
965  const inputPointViewType inputPoints,
966  const EOperator operatorType,
967  const shards::CellTopology cellTopo,
968  const ordinal_type basisCard );
969 
980  template<typename outputValueViewType,
981  typename inputPointViewType>
982  void getValues_HDIV_Args( const outputValueViewType outputValues,
983  const inputPointViewType inputPoints,
984  const EOperator operatorType,
985  const shards::CellTopology cellTopo,
986  const ordinal_type basisCard );
987 
998  template<typename outputValueViewType,
999  typename inputPointViewType>
1000  void getValues_HVOL_Args( const outputValueViewType outputValues,
1001  const inputPointViewType inputPoints,
1002  const EOperator operatorType,
1003  const shards::CellTopology cellTopo,
1004  const ordinal_type basisCard );
1005 
1006 }// namespace Intrepid2
1007 
1008 #include <Intrepid2_BasisDef.hpp>
1009 
1010 //--------------------------------------------------------------------------------------------//
1011 // //
1012 // D O C U M E N T A T I O N P A G E S //
1013 // //
1014 //--------------------------------------------------------------------------------------------//
1116 #endif
const OrdinalTypeArray3DHost getAllDofOrdinal() const
DoF tag to ordinal data structure.
Kokkos::View< ordinal_type *, typename Basis_TensorBasis< HVOL_LINE, HVOL_LINE >::ExecutionSpace::array_layout, Kokkos::HostSpace > OrdinalTypeArray1DHost
View type for 1d host array.
Kokkos::View< ordinal_type **, typename Basis_TensorBasis< HVOL_LINE, HVOL_LINE >::ExecutionSpace::array_layout, Kokkos::HostSpace > OrdinalTypeArray2DHost
View type for 2d host array.
OrdinalTypeArray3DHost tagToOrdinal_
DoF tag to ordinal lookup table.
ordinal_type basisCardinality_
Cardinality of the basis, i.e., the number of basis functions/degrees-of-freedom. ...
ECoordinates basisCoordinates_
The coordinate system for which the basis is defined.
const OrdinalTypeArray2DHost getAllDofTags() const
Retrieves all DoF tags.
EFunctionSpace functionSpace_
The function space in which the basis is defined.
An abstract base class that defines interface for concrete basis implementations for Finite Element (...
shards::CellTopology getBaseCellTopology() const
Returns the base cell topology for which the basis is defined. See Shards documentation https://trili...
Kokkos::DynRankView< scalarType, ExecSpaceType > dofCoords_
Coordinates of degrees-of-freedom for basis functions defined in physical space.
ordinal_type getCardinality() const
Returns cardinality of the basis.
virtual void getValues(OutputViewType, const PointViewType, const EOperator=OPERATOR_VALUE) const
Evaluation of a FEM basis on a reference cell.
ordinal_type basisDegree_
Degree of the largest complete polynomial space that can be represented by the basis.
Header function for Intrepid2::Util class and other utility functions.
ordinal_type getDofOrdinal(const ordinal_type subcDim, const ordinal_type subcOrd, const ordinal_type subcDofOrd) const
DoF tag to ordinal lookup.
int getPolynomialDegreeLength() const
For hierarchical bases, returns the number of entries required to specify the polynomial degree of a ...
virtual bool requireOrientation() const
True if orientation is required.
std::vector< int > getPolynomialDegreeOfFieldAsVector(int fieldOrdinal) const
For hierarchical bases, returns the polynomial degree (which may have multiple values in higher spati...
std::vector< int > getFieldOrdinalsForDegree(std::vector< int > &degrees) const
For hierarchical bases, returns the field ordinals that have at most the specified degree in each dim...
EBasis basisType_
Type of the basis.
virtual void getValues(OutputViewType, const PointViewType, const PointViewType, const EOperator=OPERATOR_VALUE) const
Evaluation of an FVD basis evaluation on a physical cell.
PointValueType getDummyPointValue()
Dummy array to receive input arguments.
Definition of cell topology information.
virtual void getDofCoeffs(ScalarViewType) const
Coefficients for computing degrees of freedom for Lagrangian basis If P is an element of the space sp...
Kokkos::DynRankView< OutputValueType, Kokkos::LayoutStride, Basis_TensorBasis< HVOL_LINE, HVOL_LINE >::ExecutionSpace > OutputViewType
View type for basis value output.
ordinal_type getDofCount(const ordinal_type subcDim, const ordinal_type subcOrd) const
DoF count for specified subcell.
EFunctionSpace getFunctionSpace() const
Returns the function space for the basis.
OrdinalTypeArray2DHost fieldOrdinalPolynomialDegree_
Polynomial degree for each degree of freedom. Only defined for hierarchical bases right now...
Kokkos::View< ordinal_type ***, typename Basis_TensorBasis< HVOL_LINE, HVOL_LINE >::ExecutionSpace::array_layout, Kokkos::HostSpace > OrdinalTypeArray3DHost
View type for 3d host array.
Contains definitions of custom data types in Intrepid2.
ordinal_type getDegree() const
Returns the degree of the basis.
void setOrdinalTagData(OrdinalTypeView3D &tagToOrdinal, OrdinalTypeView2D &ordinalToTag, const OrdinalTypeView1D tags, const ordinal_type basisCard, const ordinal_type tagSize, const ordinal_type posScDim, const ordinal_type posScOrd, const ordinal_type posDfOrd)
Fills ordinalToTag_ and tagToOrdinal_ by basis-specific tag data.
virtual const char * getName() const
Returns basis name.
Kokkos::DynRankView< PointValueType, Kokkos::LayoutStride, Basis_TensorBasis< HVOL_LINE, HVOL_LINE >::ExecutionSpace > PointViewType
View type for input points.
OutputValueType getDummyOutputValue()
Dummy array to receive input arguments.
virtual void getDofCoords(ScalarViewType) const
Returns spatial locations (coordinates) of degrees of freedom on the reference cell.
Kokkos::DynRankView< scalarType, Kokkos::LayoutStride, Basis_TensorBasis< HVOL_LINE, HVOL_LINE >::ExecutionSpace > ScalarViewType
View type for scalars.
Kokkos::DynRankView< scalarType, ExecSpaceType > dofCoeffs_
Coefficients for computing degrees of freedom for Lagrangian basis If P is an element of the space sp...
OrdinalTypeArray1DHost getFieldOrdinalsForDegree(OrdinalTypeArray1DHost &degrees) const
For hierarchical bases, returns the field ordinals that have at most the specified degree in each dim...
const OrdinalTypeArrayStride1DHost getDofTag(const ordinal_type dofOrd) const
DoF ordinal to DoF tag lookup.
Implementation file for the abstract base class Intrepid2::Basis.
ECoordinates getCoordinateSystem() const
Returns the type of coordinate system for which the basis is defined.
ScalarTraits< pointValueType >::scalar_type scalarType
Scalar type for point values.
OrdinalTypeArray1DHost getPolynomialDegreeOfField(int fieldOrdinal) const
For hierarchical bases, returns the polynomial degree (which may have multiple values in higher spati...
EBasis getBasisType() const
Returns the basis type.
Kokkos::View< ordinal_type *, Kokkos::LayoutStride, Basis_TensorBasis< HVOL_LINE, HVOL_LINE >::ExecutionSpace > OrdinalTypeArrayStride1D
View type for 1d device array.
OrdinalTypeArray2DHost ordinalToTag_
&quot;true&quot; if tagToOrdinal_ and ordinalToTag_ have been initialized
shards::CellTopology basisCellTopology_
Base topology of the cells for which the basis is defined. See the Shards package for definition of b...