Panzer
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
disc-fe
src
Panzer_BasisIRLayout.cpp
Go to the documentation of this file.
1
// @HEADER
2
// ***********************************************************************
3
//
4
// Panzer: A partial differential equation assembly
5
// engine for strongly coupled complex multiphysics systems
6
// Copyright (2011) Sandia Corporation
7
//
8
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9
// the U.S. Government retains certain rights in this software.
10
//
11
// Redistribution and use in source and binary forms, with or without
12
// modification, are permitted provided that the following conditions are
13
// met:
14
//
15
// 1. Redistributions of source code must retain the above copyright
16
// notice, this list of conditions and the following disclaimer.
17
//
18
// 2. Redistributions in binary form must reproduce the above copyright
19
// notice, this list of conditions and the following disclaimer in the
20
// documentation and/or other materials provided with the distribution.
21
//
22
// 3. Neither the name of the Corporation nor the names of the
23
// contributors may be used to endorse or promote products derived from
24
// this software without specific prior written permission.
25
//
26
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
//
38
// Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
39
// Eric C. Cyr (eccyr@sandia.gov)
40
// ***********************************************************************
41
// @HEADER
42
43
#include "
Panzer_BasisIRLayout.hpp
"
44
#include "
Panzer_PointRule.hpp
"
45
#include "
Panzer_IntrepidBasisFactory.hpp
"
46
#include "Teuchos_Assert.hpp"
47
#include "Phalanx_DataLayout_MDALayout.hpp"
48
#include "
Panzer_CellTopologyInfo.hpp
"
49
50
51
// ***********************************************************************
52
// Nonmember ctors
53
54
Teuchos::RCP<panzer::BasisIRLayout>
55
panzer::basisIRLayout
(std::string basis_type,
const
int
basis_order,
const
panzer::PointRule
& pt_rule)
56
{
57
return
Teuchos::rcp(
new
panzer::BasisIRLayout
(basis_type,basis_order,pt_rule),
true
);
58
}
59
60
Teuchos::RCP<panzer::BasisIRLayout>
61
panzer::basisIRLayout
(
const
Teuchos::RCP<const PureBasis> & b,
const
PointRule
& pt_rule)
62
{
63
return
Teuchos::rcp(
new
panzer::BasisIRLayout
(b,pt_rule),
true
);
64
}
65
66
67
// ***********************************************************************
68
// Class implementation
69
70
panzer::BasisIRLayout::
71
BasisIRLayout
(std::string basis_type,
const
int
basis_order,
const
panzer::PointRule
& point_rule)
72
{
73
basis_data_
= Teuchos::rcp(
new
PureBasis
(basis_type,basis_order,point_rule.
workset_size
,point_rule.
topology
));
74
75
setup
(point_rule);
76
}
77
78
panzer::BasisIRLayout::
79
BasisIRLayout
(
const
Teuchos::RCP<const panzer::PureBasis> & b,
const
panzer::PointRule
& point_rule) :
80
basis_data_(b)
81
{
82
setup
(point_rule);
83
}
84
85
void
panzer::BasisIRLayout::
86
setup
(
const
panzer::PointRule
& point_rule)
87
{
88
basis_name_
=
basis_data_
->name() +
":"
+ point_rule.
getName
();
89
num_cells_
= point_rule.
dl_vector
->extent(0);
90
num_points_
= point_rule.
dl_vector
->extent(1);
91
dimension_
= point_rule.
dl_vector
->extent(2);
92
93
using
Teuchos::rcp;
94
using
PHX::MDALayout;
95
96
basis_ref
= rcp(
new
MDALayout<BASIS,IP>(
cardinality
(),
numPoints
()));
97
98
basis
=
99
rcp(
new
MDALayout<Cell,BASIS,IP>(
numCells
(),
cardinality
(),
numPoints
()));
100
101
basis_grad_ref
=
102
rcp(
new
MDALayout<BASIS,IP,Dim>(
cardinality
(),
numPoints
(),
dimension
()));
103
104
basis_grad
= rcp(
new
MDALayout<Cell,BASIS,IP,Dim>(
numCells
(),
105
cardinality
(),
106
numPoints
(),
107
dimension
()));
108
109
basis_D2_ref
= rcp(
new
MDALayout<BASIS,IP,Dim,Dim>(
cardinality
(),
110
numPoints
(),
111
dimension
(),
112
dimension
()));
113
114
basis_D2
= rcp(
new
MDALayout<Cell,BASIS,IP,Dim,Dim>(
numCells
(),
115
cardinality
(),
116
numPoints
(),
117
dimension
(),
118
dimension
()));
119
120
functional
= rcp(
new
MDALayout<Cell,BASIS>(
numCells
(),
cardinality
()));
121
122
functional_grad
= rcp(
new
MDALayout<Cell,BASIS,Dim>(
numCells
(),
123
cardinality
(),
124
dimension
()));
125
126
functional_D2
= rcp(
new
MDALayout<Cell,BASIS,Dim,Dim>(
numCells
(),
127
cardinality
(),
128
dimension
(),
129
dimension
()));
130
131
const
Teuchos::RCP<const shards::CellTopology>& topology =
basis_data_
->getCellTopology();
132
cell_topo_info
= rcp(
new
panzer::CellTopologyInfo
(
numCells
(), topology) );
133
134
}
135
136
int
panzer::BasisIRLayout::cardinality
()
const
137
{
138
return
basis_data_
->cardinality();
139
}
140
141
int
panzer::BasisIRLayout::numCells
()
const
142
{
143
return
num_cells_
;
144
}
145
146
int
panzer::BasisIRLayout::numPoints
()
const
147
{
148
return
num_points_
;
149
}
150
151
int
panzer::BasisIRLayout::dimension
()
const
152
{
153
return
dimension_
;
154
}
155
156
std::string
panzer::BasisIRLayout::name
()
const
157
{
158
return
basis_name_
;
159
}
160
161
std::string
panzer::BasisIRLayout::fieldName
()
const
162
{
163
return
basis_data_
->fieldName();
164
}
165
166
std::string
panzer::BasisIRLayout::fieldNameD1
()
const
167
{
168
return
basis_data_
->fieldNameD1();
169
}
170
171
std::string
panzer::BasisIRLayout::fieldNameD2
()
const
172
{
173
return
basis_data_
->fieldNameD2();
174
}
175
176
Teuchos::RCP< Intrepid2::Basis<PHX::Device::execution_space,double,double> >
177
panzer::BasisIRLayout::getIntrepid2Basis
()
const
178
{
179
return
basis_data_
->getIntrepid2Basis();
180
}
181
182
Teuchos::RCP< const panzer::PureBasis>
183
panzer::BasisIRLayout::getBasis
()
const
184
{
185
return
basis_data_
;
186
}
187
188
void
panzer::BasisIRLayout::print
(std::ostream & os)
const
189
{
190
os <<
"Name = "
<<
name
()
191
<<
", Dimension = "
<<
dimension
()
192
<<
", Cells = "
<<
numCells
()
193
<<
", Num Points = "
<<
numPoints
();
194
}
Panzer_BasisIRLayout.hpp
Panzer_CellTopologyInfo.hpp
Panzer_IntrepidBasisFactory.hpp
Panzer_PointRule.hpp
panzer::BasisIRLayout
Definition
Panzer_BasisIRLayout.hpp:71
panzer::BasisIRLayout::basis_grad
Teuchos::RCP< PHX::DataLayout > basis_grad
<Cell,BASIS,IP,Dim>
Definition
Panzer_BasisIRLayout.hpp:117
panzer::BasisIRLayout::basis_data_
Teuchos::RCP< const PureBasis > basis_data_
Definition
Panzer_BasisIRLayout.hpp:136
panzer::BasisIRLayout::name
std::string name() const
Unique key for workset indexing composed of basis name and point rule name.
Definition
Panzer_BasisIRLayout.cpp:156
panzer::BasisIRLayout::fieldNameD2
std::string fieldNameD2() const
Definition
Panzer_BasisIRLayout.cpp:171
panzer::BasisIRLayout::functional
Teuchos::RCP< PHX::DataLayout > functional
<Cell,Basis>
Definition
Panzer_BasisIRLayout.hpp:124
panzer::BasisIRLayout::getBasis
Teuchos::RCP< const PureBasis > getBasis() const
Definition
Panzer_BasisIRLayout.cpp:183
panzer::BasisIRLayout::cell_topo_info
Teuchos::RCP< const CellTopologyInfo > cell_topo_info
Definition
Panzer_BasisIRLayout.hpp:138
panzer::BasisIRLayout::basis_D2
Teuchos::RCP< PHX::DataLayout > basis_D2
<Cell,BASIS,IP,Dim,Dim>
Definition
Panzer_BasisIRLayout.hpp:121
panzer::BasisIRLayout::basis_name_
std::string basis_name_
Definition
Panzer_BasisIRLayout.hpp:131
panzer::BasisIRLayout::numCells
int numCells() const
Definition
Panzer_BasisIRLayout.cpp:141
panzer::BasisIRLayout::dimension
int dimension() const
Definition
Panzer_BasisIRLayout.cpp:151
panzer::BasisIRLayout::functional_D2
Teuchos::RCP< PHX::DataLayout > functional_D2
<Cell,Basis,Dim,Dim>
Definition
Panzer_BasisIRLayout.hpp:128
panzer::BasisIRLayout::getIntrepid2Basis
Teuchos::RCP< Intrepid2::Basis< PHX::Device::execution_space, double, double > > getIntrepid2Basis() const
Definition
Panzer_BasisIRLayout.cpp:177
panzer::BasisIRLayout::basis_D2_ref
Teuchos::RCP< PHX::DataLayout > basis_D2_ref
<BASIS,IP,Dim,Dim>
Definition
Panzer_BasisIRLayout.hpp:119
panzer::BasisIRLayout::cardinality
int cardinality() const
Definition
Panzer_BasisIRLayout.cpp:136
panzer::BasisIRLayout::BasisIRLayout
BasisIRLayout(std::string basis_type, const int basis_order, const PointRule &int_rule)
Definition
Panzer_BasisIRLayout.cpp:71
panzer::BasisIRLayout::num_points_
int num_points_
Definition
Panzer_BasisIRLayout.hpp:133
panzer::BasisIRLayout::basis_grad_ref
Teuchos::RCP< PHX::DataLayout > basis_grad_ref
<BASIS,IP,Dim>
Definition
Panzer_BasisIRLayout.hpp:115
panzer::BasisIRLayout::fieldNameD1
std::string fieldNameD1() const
Definition
Panzer_BasisIRLayout.cpp:166
panzer::BasisIRLayout::basis_ref
Teuchos::RCP< PHX::DataLayout > basis_ref
<BASIS,IP>
Definition
Panzer_BasisIRLayout.hpp:111
panzer::BasisIRLayout::fieldName
std::string fieldName() const
Definition
Panzer_BasisIRLayout.cpp:161
panzer::BasisIRLayout::dimension_
int dimension_
Definition
Panzer_BasisIRLayout.hpp:134
panzer::BasisIRLayout::basis
Teuchos::RCP< PHX::DataLayout > basis
<Cell,BASIS,IP>
Definition
Panzer_BasisIRLayout.hpp:113
panzer::BasisIRLayout::setup
void setup(const panzer::PointRule &int_rule)
Definition
Panzer_BasisIRLayout.cpp:86
panzer::BasisIRLayout::num_cells_
int num_cells_
Definition
Panzer_BasisIRLayout.hpp:132
panzer::BasisIRLayout::print
void print(std::ostream &os) const
Definition
Panzer_BasisIRLayout.cpp:188
panzer::BasisIRLayout::functional_grad
Teuchos::RCP< PHX::DataLayout > functional_grad
<Cell,Basis,Dim>
Definition
Panzer_BasisIRLayout.hpp:126
panzer::BasisIRLayout::numPoints
int numPoints() const
Definition
Panzer_BasisIRLayout.cpp:146
panzer::CellTopologyInfo
Definition
Panzer_CellTopologyInfo.hpp:64
panzer::PointRule
Definition
Panzer_PointRule.hpp:61
panzer::PointRule::dl_vector
Teuchos::RCP< PHX::DataLayout > dl_vector
Data layout for vector fields.
Definition
Panzer_PointRule.hpp:114
panzer::PointRule::workset_size
int workset_size
Definition
Panzer_PointRule.hpp:125
panzer::PointRule::topology
Teuchos::RCP< const shards::CellTopology > topology
Definition
Panzer_PointRule.hpp:107
panzer::PointRule::getName
const std::string & getName() const
Definition
Panzer_PointRule.cpp:174
panzer::PureBasis
Description and data layouts associated with a particular basis.
Definition
Panzer_PureBasis.hpp:61
panzer::basisIRLayout
Teuchos::RCP< panzer::BasisIRLayout > basisIRLayout(std::string basis_type, const int basis_order, const PointRule &pt_rule)
Nonmember constructor.
Definition
Panzer_BasisIRLayout.cpp:55
Generated by
1.17.0