47 #include "Teuchos_Assert.hpp" 48 #include "Phalanx_DataLayout_MDALayout.hpp" 53 const int basis_order,
56 topology_(cell_topology),
63 PureBasis(
const std::string & basis_type,
const int basis_order,
const CellData & cell_data) :
64 topology_(cell_data.getCellTopology()),
65 num_cells_(cell_data.numCells())
73 std::string basis_type = in_basis_type;
74 int basis_order = in_basis_order;
76 if (basis_type==
"Q1" || basis_type==
"T1") {
80 else if (basis_type ==
"Q2" || basis_type==
"T2") {
84 else if (basis_type ==
"TEdge1" || basis_type==
"QEdge1") {
88 else if(basis_type ==
"Const") {
94 intrepid_basis_ = panzer::createIntrepid2Basis<double,Kokkos::DynRankView<double,PHX::Device> >(basis_type, basis_order, topology_);
96 basis_type_ = basis_type;
98 std::ostringstream os;
99 os << basis_type_ <<
":" << basis_order;
100 basis_name_ = os.str();
102 field_basis_name_ =
"Basis: " + basis_name_;
103 field_basis_name_D1_ =
"Grad Basis: " + basis_name_;
104 field_basis_name_D2_ =
"D2 Basis: " + basis_name_;
106 if( basis_type_ ==
"HGrad")
107 element_space_ = HGRAD;
108 else if(basis_type_==
"HCurl")
109 element_space_ = HCURL;
110 else if(basis_type_==
"HDiv")
111 element_space_ = HDIV;
112 else if(basis_type_==
"Const")
113 element_space_ = CONST;
115 "PureBasis::initializeIntrospection - Invalid basis name \"" 116 << basis_type_ <<
"\""); }
118 switch(getElementSpace()) {
137 using PHX::MDALayout;
139 cell_data =
rcp(
new MDALayout<Cell>(numCells()));
141 functional =
rcp(
new MDALayout<Cell,BASIS>(numCells(), cardinality()));
143 functional_grad =
rcp(
new MDALayout<Cell,BASIS,Dim>(numCells(),
147 coordinates =
rcp(
new MDALayout<Cell,BASIS,Dim>(numCells(),
151 functional_D2 =
rcp(
new MDALayout<Cell,BASIS,Dim,Dim>(numCells(),
159 return intrepid_basis_->getCardinality();
169 return topology_->getDimension();
179 return intrepid_basis_->getDegree();
189 return field_basis_name_;
194 return field_basis_name_D1_;
199 return field_basis_name_D2_;
205 return intrepid_basis_;
211 typedef Kokkos::DynRankView<double,PHX::Device>
Array;
213 = Teuchos::rcp_dynamic_cast<
const Intrepid2::DofCoordsInterface<Array> >(getIntrepid2Basis());
bool supportsBasisCoordinates() const
std::string name() const
A unique key that is the combination of the basis type and basis order.
std::string fieldNameD1() const
bool is_null(const std::shared_ptr< T > &p)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Data for determining cell topology and dimensionality.
PureBasis(const std::string &basis_type, const int basis_order, const CellData &cell_data)
std::string fieldNameD2() const
int dimension() const
Returns the dimension of the basis from the topology.
std::string fieldName() const
Teuchos::RCP< Intrepid2::Basis< double, Kokkos::DynRankView< double, PHX::Device > > > getIntrepid2Basis() const
int numCells() const
Returns the number of cells in the data layouts.
std::string type() const
Returns the basis type.
int order() const
Returns the polynomial order of the basis.
void initialize(const std::string &basis_type, const int basis_order)
Initialize the basis object.
#define TEUCHOS_ASSERT(assertion_test)
int cardinality() const
Returns the number of basis coefficients.