Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_BasisValues2.hpp
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 #ifndef PANZER_BASIS_VALUES2_HPP
44 #define PANZER_BASIS_VALUES2_HPP
45 
46 #include "Teuchos_RCP.hpp"
47 
48 #include "Intrepid2_Basis.hpp"
49 #include "Intrepid2_Orientation.hpp"
50 
51 #include "Panzer_BasisIRLayout.hpp"
52 #include "Panzer_ArrayTraits.hpp"
53 
54 namespace panzer {
55 
62  template <typename Scalar>
63  class BasisValues2 {
64  public:
66 
67  typedef PHX::MDField<Scalar> ArrayDynamic;
68  typedef PHX::MDField<Scalar,BASIS,IP> Array_BasisIP;
69  typedef PHX::MDField<Scalar,Cell,BASIS,IP> Array_CellBasisIP;
70  typedef PHX::MDField<Scalar,BASIS,IP,Dim> Array_BasisIPDim;
71  typedef PHX::MDField<Scalar,Cell,BASIS,IP,Dim> Array_CellBasisIPDim;
72  typedef PHX::MDField<Scalar,BASIS,Dim> Array_BasisDim;
73  typedef PHX::MDField<Scalar,Cell,BASIS,Dim> Array_CellBasisDim;
74 
75  BasisValues2(const std::string & pre="",bool allocArrays=false,bool buildWeighted=false)
76  : build_weighted(buildWeighted), alloc_arrays(allocArrays), prefix(pre)
77  , ddims_(1,0), references_evaluated(false) {}
78 
81  bool computeDerivatives=true);
82 
83  void evaluateValues(const PHX::MDField<Scalar,IP,Dim> & cub_points,
84  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac,
85  const PHX::MDField<Scalar,Cell,IP> & jac_det,
86  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac_inv,
87  const int in_num_cells = -1);
88 
89  void evaluateValues(const PHX::MDField<Scalar,IP,Dim> & cub_points,
90  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac,
91  const PHX::MDField<Scalar,Cell,IP> & jac_det,
92  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac_inv,
93  const PHX::MDField<Scalar,Cell,IP> & weighted_measure,
94  const PHX::MDField<Scalar,Cell,NODE,Dim> & vertex_coordinates,
95  bool use_vertex_coordinates=true,
96  const int in_num_cells = -1);
97 
98  void evaluateValuesCV(const PHX::MDField<Scalar,Cell,IP,Dim> & cell_cub_points,
99  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac,
100  const PHX::MDField<Scalar,Cell,IP> & jac_det,
101  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac_inv);
102 
103 
104  void evaluateValuesCV(const PHX::MDField<Scalar,Cell,IP,Dim> & cell_cub_points,
105  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac,
106  const PHX::MDField<Scalar,Cell,IP> & jac_det,
107  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac_inv,
108  const PHX::MDField<Scalar,Cell,NODE,Dim> & vertex_coordinates,
109  bool use_vertex_coordinates=true,
110  const int in_num_cells = -1);
111 
112 
113  void evaluateValues(const PHX::MDField<Scalar,Cell,IP,Dim> & cub_points,
114  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac,
115  const PHX::MDField<Scalar,Cell,IP> & jac_det,
116  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac_inv,
117  const PHX::MDField<Scalar,Cell,IP> & weighted_measure,
118  const PHX::MDField<Scalar,Cell,NODE,Dim> & vertex_coordinates,
119  bool use_vertex_coordinates=true,
120  const int in_num_cells = -1);
121 
122 
124  // some evaluators use this apply orientation (this will be deprecated)
125  void applyOrientations(const PHX::MDField<const Scalar,Cell,BASIS> & orientations);
126 
127  // this is used in workset factory
128  void applyOrientations(const std::vector<Intrepid2::Orientation> & orientations,
129  const int in_num_cells = -1);
130 
131  void setExtendedDimensions(const std::vector<PHX::index_size_type> & ddims)
132  { ddims_ = ddims; }
133 
135 
137  Array_CellBasisIP basis_scalar; // <Cell,BASIS,IP>
138 
139  Array_BasisIPDim basis_ref_vector; // <BASIS,IP,Dim>
140  Array_CellBasisIPDim basis_vector; // <Cell,BASIS,IP,Dim>
141 
142  Array_BasisIPDim grad_basis_ref; // <BASIS,IP,Dim>
143  Array_CellBasisIPDim grad_basis; // <Cell,BASIS,IP,Dim>
144 
146  Array_CellBasisIP curl_basis_scalar; // <Cell,BASIS,IP> - 2D!
147 
148  Array_BasisIPDim curl_basis_ref_vector; // <BASIS,IP,Dim> - 3D!
149  Array_CellBasisIPDim curl_basis_vector; // <Cell,BASIS,IP,Dim> - 3D!
150 
151  Array_BasisIP div_basis_ref; // <BASIS,IP>
152  Array_CellBasisIP div_basis; // <Cell,BASIS,IP>
153 
160 
167 
174 
176 
178 
182  std::string prefix;
183  std::vector<PHX::index_size_type> ddims_;
184 
185  protected:
186 
187 
188  void evaluateValues_Const(const PHX::MDField<Scalar,Cell,IP,Dim> & cub_points,
189  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac_inv,
190  const PHX::MDField<Scalar,Cell,IP> & weighted_measure,
191  const int in_num_cells);
192 
193  void evaluateValues_HVol(const PHX::MDField<Scalar,Cell,IP,Dim> & cub_points,
194  const PHX::MDField<Scalar,Cell,IP> & jac_det,
195  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac_inv,
196  const PHX::MDField<Scalar,Cell,IP> & weighted_measure,
197  const int in_num_cells);
198 
199  void evaluateValues_HGrad(const PHX::MDField<Scalar,Cell,IP,Dim> & cub_points,
200  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac_inv,
201  const PHX::MDField<Scalar,Cell,IP> & weighted_measure,
202  const int in_num_cells);
203 
204  void evaluateValues_HCurl(const PHX::MDField<Scalar,Cell,IP,Dim> & cub_points,
205  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac,
206  const PHX::MDField<Scalar,Cell,IP> & jac_det,
207  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac_inv,
208  const PHX::MDField<Scalar,Cell,IP> & weighted_measure,
209  const int in_num_cells);
210 
211  void evaluateValues_HDiv(const PHX::MDField<Scalar,Cell,IP,Dim> & cub_points,
212  const PHX::MDField<Scalar,Cell,IP,Dim,Dim> & jac,
213  const PHX::MDField<Scalar,Cell,IP> & jac_det,
214  const PHX::MDField<Scalar,Cell,IP> & weighted_measure,
215  const int in_num_cells);
216 
217  private:
218 
219  void evaluateBasisCoordinates(const PHX::MDField<Scalar,Cell,NODE,Dim> & vertex_coordinates,
220  const int in_num_cells = -1);
221 
226  void evaluateReferenceValues(const PHX::MDField<Scalar,IP,Dim> & cub_points,bool compute_derivatives,bool use_vertex_coordinates);
227 
229  };
230 
231 } // namespace panzer
232 
233 #endif
Array_CellBasisIPDim weighted_curl_basis_vector
void evaluateValues_HCurl(const PHX::MDField< Scalar, Cell, IP, Dim > &cub_points, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac, const PHX::MDField< Scalar, Cell, IP > &jac_det, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac_inv, const PHX::MDField< Scalar, Cell, IP > &weighted_measure, const int in_num_cells)
void evaluateValues_HDiv(const PHX::MDField< Scalar, Cell, IP, Dim > &cub_points, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac, const PHX::MDField< Scalar, Cell, IP > &jac_det, const PHX::MDField< Scalar, Cell, IP > &weighted_measure, const int in_num_cells)
Array_BasisIPDim curl_basis_ref_vector
void evaluateValuesCV(const PHX::MDField< Scalar, Cell, IP, Dim > &cell_cub_points, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac, const PHX::MDField< Scalar, Cell, IP > &jac_det, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac_inv)
void evaluateReferenceValues(const PHX::MDField< Scalar, IP, Dim > &cub_points, bool compute_derivatives, bool use_vertex_coordinates)
void evaluateValues_HGrad(const PHX::MDField< Scalar, Cell, IP, Dim > &cub_points, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac_inv, const PHX::MDField< Scalar, Cell, IP > &weighted_measure, const int in_num_cells)
Array_CellBasisIPDim curl_basis_vector
BasisValues2(const std::string &pre="", bool allocArrays=false, bool buildWeighted=false)
Array_CellBasisIP weighted_basis_scalar
Array_CellBasisIP basis_scalar
Array_CellBasisIP div_basis
void applyOrientations(const PHX::MDField< const Scalar, Cell, BASIS > &orientations)
Method to apply orientations to a basis values container.
void setExtendedDimensions(const std::vector< PHX::index_size_type > &ddims)
PHX::MDField< Scalar, Cell, BASIS, IP > Array_CellBasisIP
PHX::MDField< Scalar, Cell, BASIS, IP, Dim > Array_CellBasisIPDim
Array_CellBasisIPDim basis_vector
PHX::MDField< Scalar, Cell, BASIS, Dim > Array_CellBasisDim
void evaluateBasisCoordinates(const PHX::MDField< Scalar, Cell, NODE, Dim > &vertex_coordinates, const int in_num_cells=-1)
Array_BasisIPDim basis_ref_vector
std::vector< PHX::index_size_type > ddims_
ArrayTraits< Scalar, PHX::MDField< Scalar > >::size_type size_type
Teuchos::RCP< const panzer::BasisIRLayout > basis_layout
Teuchos::RCP< Intrepid2::Basis< PHX::Device::execution_space, Scalar, Scalar > > intrepid_basis
PureBasis::EElementSpace getElementSpace() const
Array_CellBasisIP weighted_curl_basis_scalar
void evaluateValues_Const(const PHX::MDField< Scalar, Cell, IP, Dim > &cub_points, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac_inv, const PHX::MDField< Scalar, Cell, IP > &weighted_measure, const int in_num_cells)
Array_CellBasisDim basis_coordinates
Array_CellBasisIPDim weighted_grad_basis
Array_CellBasisIPDim weighted_basis_vector
void setupArrays(const Teuchos::RCP< const panzer::BasisIRLayout > &basis, bool computeDerivatives=true)
Sizes/allocates memory for arrays.
Array_CellBasisIPDim grad_basis
PHX::MDField< Scalar, BASIS, IP, Dim > Array_BasisIPDim
Array_CellBasisIP weighted_div_basis
void evaluateValues_HVol(const PHX::MDField< Scalar, Cell, IP, Dim > &cub_points, const PHX::MDField< Scalar, Cell, IP > &jac_det, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac_inv, const PHX::MDField< Scalar, Cell, IP > &weighted_measure, const int in_num_cells)
PHX::MDField< Scalar, BASIS, Dim > Array_BasisDim
Array_BasisDim basis_coordinates_ref
Array_BasisIP curl_basis_ref_scalar
void evaluateValues(const PHX::MDField< Scalar, IP, Dim > &cub_points, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac, const PHX::MDField< Scalar, Cell, IP > &jac_det, const PHX::MDField< Scalar, Cell, IP, Dim, Dim > &jac_inv, const int in_num_cells=-1)
PHX::MDField< Scalar, BASIS, IP > Array_BasisIP
Array_BasisIPDim grad_basis_ref
Array_CellBasisIP curl_basis_scalar
PHX::MDField< Scalar > ArrayDynamic