Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_PureBasis.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Panzer: A partial differential equation assembly
4 // engine for strongly coupled complex multiphysics systems
5 //
6 // Copyright 2011 NTESS and the Panzer contributors.
7 // SPDX-License-Identifier: BSD-3-Clause
8 // *****************************************************************************
9 // @HEADER
10 
11 #ifndef PANZER_PureBasis_HPP
12 #define PANZER_PureBasis_HPP
13 
14 #include <string>
15 #include "Teuchos_RCP.hpp"
16 
17 #include "Phalanx_DataLayout.hpp"
18 
19 #include "Kokkos_DynRankView.hpp"
20 #include "Intrepid2_Basis.hpp"
22 
23 namespace panzer {
24 
25  class CellData;
26  class BasisDescriptor;
27 
29  class PureBasis {
30 
31  public:
32  typedef enum { HGRAD=0, HCURL=1, HDIV=2, HVOL=3, CONST=4 } EElementSpace;
33 
39  PureBasis(const std::string & basis_type,const int basis_order,const CellData & cell_data);
40 
47  PureBasis(const std::string & basis_type,const int basis_order,const int num_cells,const Teuchos::RCP<const shards::CellTopology> & cell_topo);
48 
49 
55  PureBasis(const panzer::BasisDescriptor & description, const Teuchos::RCP<const shards::CellTopology> & cell_topology, const int num_cells);
56 
58  int cardinality() const;
59 
61  int numCells() const;
62 
64  int dimension() const;
65 
67  std::string type() const;
68 
70  int order() const;
71 
73  std::string name() const;
74 
75  std::string fieldName() const;
76 
77  std::string fieldNameD1() const;
78 
79  std::string fieldNameD2() const;
80 
82  getIntrepid2Basis() const;
83 
84  template <typename ExecutionSpace,typename OutputValueType, typename PointValueType>
87  { return panzer::createIntrepid2Basis<ExecutionSpace,OutputValueType,PointValueType>(type(), order(), *(getCellTopology())); }
88 
90  { return element_space_; }
91 
92  bool requiresOrientations() const
93  {
94  return intrepid_basis_->requireOrientation();
95  }
96 
97  bool supportsGrad() const
98  { return getElementSpace()==HGRAD; }
99 
100  bool supportsCurl() const
101  { return getElementSpace()==HCURL; }
102 
103  bool supportsDiv() const
104  { return getElementSpace()==HDIV; }
105 
106  bool isVectorBasis() const
107  { return getElementSpace()==HCURL || getElementSpace()==HDIV; }
108 
109  bool isScalarBasis() const
111 
112  int getBasisRank() const
113  { return basis_rank_; }
114 
115  bool supportsBasisCoordinates() const;
116 
118  { return topology_; }
119 
120  public:
133 
134  private:
135 
137  void initialize(const std::string & basis_type,const int basis_order);
138 
139  private:
140 
143 
144  std::string basis_type_;
145  std::string basis_name_;
146  std::string field_basis_name_;
147  std::string field_basis_name_D1_;
148  std::string field_basis_name_D2_;
149 
151 
154  };
155 
156  typedef std::pair<std::string,Teuchos::RCP<panzer::PureBasis> > StrPureBasisPair;
157 
160  bool operator() (const StrPureBasisPair & lhs, const StrPureBasisPair & rhs) const
161  {return lhs.first<rhs.first;}
162  };
163 
164 }
165 
166 #endif
std::string name() const
A unique key that is the combination of the basis type and basis order.
bool supportsCurl() const
bool supportsGrad() const
Simple binary comparison class to help with sorting.
EElementSpace getElementSpace() const
std::string field_basis_name_D1_
int order() const
Returns the polynomial order of the basis.
int cardinality() const
Returns the number of basis coefficients.
Teuchos::RCP< PHX::DataLayout > cell_data
&lt;Cell&gt;
std::string fieldName() const
int dimension() const
Returns the dimension of the basis from the topology.
bool requiresOrientations() const
bool supportsBasisCoordinates() const
std::string type() const
Returns the basis type.
Teuchos::RCP< const shards::CellTopology > getCellTopology() const
bool supportsDiv() const
std::string field_basis_name_
Data for determining cell topology and dimensionality.
Teuchos::RCP< PHX::DataLayout > coordinates
&lt;Cell,Basis,Dim&gt;
PureBasis(const std::string &basis_type, const int basis_order, const CellData &cell_data)
bool isVectorBasis() const
Teuchos::RCP< Intrepid2::Basis< ExecutionSpace, OutputValueType, PointValueType > > getIntrepid2Basis() const
Teuchos::RCP< PHX::DataLayout > functional_grad
&lt;Cell,Basis,Dim&gt;
Teuchos::RCP< PHX::DataLayout > functional_D2
&lt;Cell,Basis,Dim&gt;
Teuchos::RCP< Intrepid2::Basis< PHX::Device::execution_space, double, double > > getIntrepid2Basis() const
int numCells() const
Returns the number of cells in the data layouts.
bool operator()(const StrPureBasisPair &lhs, const StrPureBasisPair &rhs) const
bool isScalarBasis() const
Teuchos::RCP< Intrepid2::Basis< PHX::Device::execution_space, double, double > > intrepid_basis_
Teuchos::RCP< PHX::DataLayout > local_mat_layout
&lt;Cell,Basis,Basis&gt;
std::pair< std::string, Teuchos::RCP< panzer::PureBasis > > StrPureBasisPair
EElementSpace element_space_
void initialize(const std::string &basis_type, const int basis_order)
Initialize the basis object.
int getBasisRank() const
Description and data layouts associated with a particular basis.
Teuchos::RCP< PHX::DataLayout > functional
&lt;Cell,Basis&gt; or &lt;Cell,Basis&gt;
std::string fieldNameD1() const
Teuchos::RCP< const shards::CellTopology > topology_
std::string field_basis_name_D2_
std::string fieldNameD2() const