48 #include "Teuchos_Assert.hpp"
49 #include "Phalanx_DataLayout_MDALayout.hpp"
54 const int basis_order,
57 topology_(cell_topology),
65 const int in_basis_order,
67 topology_(in_cell_data.getCellTopology()),
68 num_cells_(in_cell_data.numCells())
77 topology_(cell_topology),
86 std::string basis_type = in_basis_type;
87 int basis_order = in_basis_order;
89 if (basis_type==
"Q1" || basis_type==
"T1") {
93 else if (basis_type ==
"Q2" || basis_type==
"T2") {
97 else if (basis_type ==
"TEdge1" || basis_type==
"QEdge1") {
101 else if(basis_type ==
"Const") {
102 basis_type =
"Const";
107 intrepid_basis_ = panzer::createIntrepid2Basis<PHX::Device::execution_space,double,double>(basis_type, basis_order, *topology_);
109 basis_type_ = basis_type;
111 std::ostringstream os;
112 os << basis_type_ <<
":" << basis_order;
113 basis_name_ = os.str();
115 field_basis_name_ =
"Basis: " + basis_name_;
116 field_basis_name_D1_ =
"Grad Basis: " + basis_name_;
117 field_basis_name_D2_ =
"D2 Basis: " + basis_name_;
119 if( basis_type_ ==
"HGrad")
120 element_space_ = HGRAD;
121 else if(basis_type_==
"HCurl")
122 element_space_ = HCURL;
123 else if(basis_type_==
"HDiv")
124 element_space_ = HDIV;
125 else if(basis_type_==
"Const")
126 element_space_ = CONST;
127 else if(basis_type_==
"HVol")
128 element_space_ = HVOL;
130 "PureBasis::initializeIntrospection - Invalid basis name \""
131 << basis_type_ <<
"\""); }
133 switch(getElementSpace()) {
155 using PHX::MDALayout;
157 cell_data =
rcp(
new MDALayout<Cell>(numCells()));
159 functional =
rcp(
new MDALayout<Cell,BASIS>(numCells(), cardinality()));
161 functional_grad =
rcp(
new MDALayout<Cell,BASIS,Dim>(numCells(),
165 coordinates =
rcp(
new MDALayout<Cell,BASIS,Dim>(numCells(),
169 functional_D2 =
rcp(
new MDALayout<Cell,BASIS,Dim,Dim>(numCells(),
174 local_mat_layout =
Teuchos::rcp(
new PHX::MDALayout<panzer::Cell, panzer::BASIS, panzer::BASIS>(
175 this->numCells(), this->cardinality(), this->cardinality()));
181 return intrepid_basis_->getCardinality();
191 return topology_->getDimension();
201 return intrepid_basis_->getDegree();
211 return field_basis_name_;
216 return field_basis_name_D1_;
221 return field_basis_name_D2_;
227 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