Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_BasisIRLayout.cpp
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 #include "Panzer_BasisIRLayout.hpp"
12 #include "Panzer_PointRule.hpp"
14 #include "Teuchos_Assert.hpp"
15 #include "Phalanx_DataLayout_MDALayout.hpp"
17 
18 
19 // ***********************************************************************
20 // Nonmember ctors
21 
23 panzer::basisIRLayout(std::string basis_type, const int basis_order, const panzer::PointRule& pt_rule)
24 {
25  return Teuchos::rcp(new panzer::BasisIRLayout(basis_type,basis_order,pt_rule),true);
26 }
27 
30 {
31  return Teuchos::rcp(new panzer::BasisIRLayout(b,pt_rule),true);
32 }
33 
34 
35 // ***********************************************************************
36 // Class implementation
37 
39 BasisIRLayout(std::string basis_type, const int basis_order, const panzer::PointRule& point_rule)
40 {
41  basis_data_ = Teuchos::rcp(new PureBasis(basis_type,basis_order,point_rule.workset_size,point_rule.topology));
42 
43  setup(point_rule);
44 }
45 
48  basis_data_(b)
49 {
50  setup(point_rule);
51 }
52 
54 setup(const panzer::PointRule & point_rule)
55 {
56  basis_name_ = basis_data_->name() + ":" + point_rule.getName();
57  num_cells_ = point_rule.dl_vector->extent(0);
58  num_points_ = point_rule.dl_vector->extent(1);
59  dimension_ = point_rule.dl_vector->extent(2);
60 
61  using Teuchos::rcp;
62  using PHX::MDALayout;
63 
64  basis_ref = rcp(new MDALayout<BASIS,IP>(cardinality(), numPoints()));
65 
66  basis =
67  rcp(new MDALayout<Cell,BASIS,IP>(numCells(), cardinality(), numPoints()));
68 
69  basis_grad_ref =
70  rcp(new MDALayout<BASIS,IP,Dim>(cardinality(), numPoints(), dimension()));
71 
72  basis_grad = rcp(new MDALayout<Cell,BASIS,IP,Dim>(numCells(),
73  cardinality(),
74  numPoints(),
75  dimension()));
76 
77  basis_D2_ref = rcp(new MDALayout<BASIS,IP,Dim,Dim>(cardinality(),
78  numPoints(),
79  dimension(),
80  dimension()));
81 
82  basis_D2 = rcp(new MDALayout<Cell,BASIS,IP,Dim,Dim>(numCells(),
83  cardinality(),
84  numPoints(),
85  dimension(),
86  dimension()));
87 
88  functional = rcp(new MDALayout<Cell,BASIS>(numCells(), cardinality()));
89 
90  functional_grad = rcp(new MDALayout<Cell,BASIS,Dim>(numCells(),
91  cardinality(),
92  dimension()));
93 
94  functional_D2 = rcp(new MDALayout<Cell,BASIS,Dim,Dim>(numCells(),
95  cardinality(),
96  dimension(),
97  dimension()));
98 
99  const Teuchos::RCP<const shards::CellTopology>& topology = basis_data_->getCellTopology();
100  cell_topo_info = rcp(new panzer::CellTopologyInfo(numCells(), topology) );
101 
102 }
103 
105 {
106  return basis_data_->cardinality();
107 }
108 
110 {
111  return num_cells_;
112 }
113 
115 {
116  return num_points_;
117 }
118 
120 {
121  return dimension_;
122 }
123 
124 std::string panzer::BasisIRLayout::name() const
125 {
126  return basis_name_;
127 }
128 
130 {
131  return basis_data_->fieldName();
132 }
133 
135 {
136  return basis_data_->fieldNameD1();
137 }
138 
140 {
141  return basis_data_->fieldNameD2();
142 }
143 
146 {
147  return basis_data_->getIntrepid2Basis();
148 }
149 
152 {
153  return basis_data_;
154 }
155 
156 void panzer::BasisIRLayout::print(std::ostream & os) const
157 {
158  os << "Name = " << name()
159  << ", Dimension = " << dimension()
160  << ", Cells = " << numCells()
161  << ", Num Points = " << numPoints();
162 }
Teuchos::RCP< Intrepid2::Basis< PHX::Device::execution_space, double, double > > getIntrepid2Basis() const
BasisIRLayout(std::string basis_type, const int basis_order, const PointRule &int_rule)
void print(std::ostream &os) const
int numPoints
const std::string & getName() const
Teuchos::RCP< const PureBasis > getBasis() const
Teuchos::RCP< panzer::BasisIRLayout > basisIRLayout(std::string basis_type, const int basis_order, const PointRule &pt_rule)
Nonmember constructor.
std::string fieldNameD2() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
std::string fieldName() const
Teuchos::RCP< const shards::CellTopology > topology
std::string name() const
Unique key for workset indexing composed of basis name and point rule name.
Teuchos::RCP< PHX::DataLayout > dl_vector
Data layout for vector fields.
std::string fieldNameD1() const
const int num_points_
void setup(const panzer::PointRule &int_rule)
Description and data layouts associated with a particular basis.
Teuchos::RCP< const PureBasis > basis_data_