Panzer Version of the Day
Loading...
Searching...
No Matches
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
23namespace 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
81 Teuchos::RCP< Intrepid2::Basis<PHX::Device::execution_space,double,double> >
82 getIntrepid2Basis() const;
83
84 template <typename ExecutionSpace,typename OutputValueType, typename PointValueType>
85 Teuchos::RCP< Intrepid2::Basis<ExecutionSpace,OutputValueType,PointValueType> >
87 { return panzer::createIntrepid2Basis<ExecutionSpace,OutputValueType,PointValueType>(type(), order(), *(getCellTopology())); }
88
91
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
117 Teuchos::RCP<const shards::CellTopology> getCellTopology() const
118 { return topology_; }
119
120 public:
122 Teuchos::RCP<PHX::DataLayout> cell_data;
124 Teuchos::RCP<PHX::DataLayout> functional;
126 Teuchos::RCP<PHX::DataLayout> functional_grad;
128 Teuchos::RCP<PHX::DataLayout> functional_D2;
130 Teuchos::RCP<PHX::DataLayout> coordinates;
132 Teuchos::RCP<PHX::DataLayout> local_mat_layout;
133
134 private:
135
137 void initialize(const std::string & basis_type,const int basis_order);
138
139 private:
140
141 Teuchos::RCP<const shards::CellTopology> topology_;
142 Teuchos::RCP< Intrepid2::Basis<PHX::Device::execution_space,double,double> > intrepid_basis_;
143
144 std::string basis_type_;
145 std::string basis_name_;
146 std::string field_basis_name_;
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
Data for determining cell topology and dimensionality.
Description and data layouts associated with a particular basis.
std::string fieldName() const
void initialize(const std::string &basis_type, const int basis_order)
Initialize the basis object.
int numCells() const
Returns the number of cells in the data layouts.
bool supportsBasisCoordinates() const
Teuchos::RCP< const shards::CellTopology > getCellTopology() const
std::string field_basis_name_D1_
EElementSpace getElementSpace() const
Teuchos::RCP< PHX::DataLayout > cell_data
<Cell>
Teuchos::RCP< PHX::DataLayout > functional_grad
<Cell,Basis,Dim>
Teuchos::RCP< Intrepid2::Basis< PHX::Device::execution_space, double, double > > getIntrepid2Basis() const
std::string type() const
Returns the basis type.
std::string field_basis_name_
Teuchos::RCP< const shards::CellTopology > topology_
bool requiresOrientations() const
std::string fieldNameD1() const
int cardinality() const
Returns the number of basis coefficients.
Teuchos::RCP< PHX::DataLayout > functional
<Cell,Basis> or <Cell,Basis>
std::string name() const
A unique key that is the combination of the basis type and basis order.
int order() const
Returns the polynomial order of the basis.
int dimension() const
Returns the dimension of the basis from the topology.
Teuchos::RCP< Intrepid2::Basis< ExecutionSpace, OutputValueType, PointValueType > > getIntrepid2Basis() const
Teuchos::RCP< PHX::DataLayout > local_mat_layout
<Cell,Basis,Basis>
Teuchos::RCP< PHX::DataLayout > coordinates
<Cell,Basis,Dim>
bool supportsGrad() const
std::string fieldNameD2() const
Teuchos::RCP< Intrepid2::Basis< PHX::Device::execution_space, double, double > > intrepid_basis_
std::string field_basis_name_D2_
EElementSpace element_space_
Teuchos::RCP< PHX::DataLayout > functional_D2
<Cell,Basis,Dim>
std::pair< std::string, Teuchos::RCP< panzer::PureBasis > > StrPureBasisPair
Simple binary comparison class to help with sorting.
bool operator()(const StrPureBasisPair &lhs, const StrPureBasisPair &rhs) const