16 #include "Teuchos_Assert.hpp"
17 #include "Phalanx_DataLayout_MDALayout.hpp"
22 const int basis_order,
25 topology_(cell_topology),
33 const int in_basis_order,
35 topology_(in_cell_data.getCellTopology()),
36 num_cells_(in_cell_data.numCells())
45 topology_(cell_topology),
54 std::string basis_type = in_basis_type;
55 int basis_order = in_basis_order;
57 if (basis_type==
"Q1" || basis_type==
"T1") {
61 else if (basis_type ==
"Q2" || basis_type==
"T2") {
65 else if (basis_type ==
"TEdge1" || basis_type==
"QEdge1") {
69 else if(basis_type ==
"Const") {
75 intrepid_basis_ = panzer::createIntrepid2Basis<PHX::Device::execution_space,double,double>(basis_type, basis_order, *topology_);
77 basis_type_ = basis_type;
79 std::ostringstream os;
80 os << basis_type_ <<
":" << basis_order;
81 basis_name_ = os.str();
83 field_basis_name_ =
"Basis: " + basis_name_;
84 field_basis_name_D1_ =
"Grad Basis: " + basis_name_;
85 field_basis_name_D2_ =
"D2 Basis: " + basis_name_;
87 if( basis_type_ ==
"HGrad")
88 element_space_ = HGRAD;
89 else if(basis_type_==
"HCurl")
90 element_space_ = HCURL;
91 else if(basis_type_==
"HDiv")
92 element_space_ = HDIV;
93 else if(basis_type_==
"Const")
94 element_space_ = CONST;
95 else if(basis_type_==
"HVol")
96 element_space_ = HVOL;
98 "PureBasis::initializeIntrospection - Invalid basis name \""
99 << basis_type_ <<
"\""); }
101 switch(getElementSpace()) {
125 cell_data =
rcp(
new MDALayout<Cell>(numCells()));
127 functional =
rcp(
new MDALayout<Cell,BASIS>(numCells(), cardinality()));
129 functional_grad =
rcp(
new MDALayout<Cell,BASIS,Dim>(numCells(),
133 coordinates =
rcp(
new MDALayout<Cell,BASIS,Dim>(numCells(),
137 functional_D2 =
rcp(
new MDALayout<Cell,BASIS,Dim,Dim>(numCells(),
143 this->numCells(), this->cardinality(), this->cardinality()));
149 return intrepid_basis_->getCardinality();
159 return topology_->getDimension();
169 return intrepid_basis_->getDegree();
179 return field_basis_name_;
184 return field_basis_name_D1_;
189 return field_basis_name_D2_;
195 return intrepid_basis_;
std::string name() const
A unique key that is the combination of the basis type and basis order.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
int order() const
Returns the polynomial order of the basis.
int cardinality() const
Returns the number of basis coefficients.
std::string fieldName() const
int dimension() const
Returns the dimension of the basis from the topology.
bool supportsBasisCoordinates() const
std::string type() const
Returns the basis type.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
const std::string & getType() const
Get type of basis.
Data for determining cell topology and dimensionality.
PureBasis(const std::string &basis_type, const int basis_order, const CellData &cell_data)
Teuchos::RCP< Intrepid2::Basis< PHX::Device::execution_space, double, double > > getIntrepid2Basis() const
int getOrder() const
Get order of basis.
int numCells() const
Returns the number of cells in the data layouts.
void initialize(const std::string &basis_type, const int basis_order)
Initialize the basis object.
#define TEUCHOS_ASSERT(assertion_test)
std::string fieldNameD1() const
std::string fieldNameD2() const