Panzer  Version of the Day
Panzer_IntegrationValues2.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 
44 #ifndef PANZER_INTEGRATION_VALUES2_HPP
45 #define PANZER_INTEGRATION_VALUES2_HPP
46 
47 #include "Teuchos_RCP.hpp"
48 
49 #include "PanzerDiscFE_config.hpp"
51 #include "Panzer_ArrayTraits.hpp"
52 #include "Panzer_Dimension.hpp"
53 #include "Phalanx_MDField.hpp"
54 
55 namespace panzer {
56 
57  template <typename Scalar>
59  public:
61 
62  typedef PHX::MDField<Scalar> ArrayDynamic;
63  typedef PHX::MDField<double> DblArrayDynamic;
64 
65  typedef PHX::MDField<Scalar,IP> Array_IP;
66  typedef PHX::MDField<Scalar,IP,Dim> Array_IPDim;
67 
68  typedef PHX::MDField<Scalar,Cell,IP> Array_CellIP;
69  typedef PHX::MDField<Scalar,Cell,IP,Dim> Array_CellIPDim;
70  typedef PHX::MDField<Scalar,Cell,IP,Dim,Dim> Array_CellIPDimDim;
71 
72  typedef PHX::MDField<Scalar,Cell,BASIS,Dim> Array_CellBASISDim;
73 
74  IntegrationValues2(const std::string & pre="",bool allocArrays=false)
75  : alloc_arrays(allocArrays), prefix(pre), ddims_(1,0) {}
76 
78  void setupArrays(const Teuchos::RCP<const panzer::IntegrationRule>& ir);
79 
80  void setupArraysForNodeRule(const Teuchos::RCP<const panzer::IntegrationRule>& ir);
81 
83  void evaluateValues(const PHX::MDField<Scalar,Cell,NODE,Dim> & vertex_coordinates);
84 
86  //
87  // Optionally provide IP coordinates for an element 'other' that shares the
88  // same side. If provided, a permutation of the cubature points is
89  // calculated so that the integration values are ordered according to the
90  // other element's. This permutation is then applied so that all fields are
91  // ordered accordingly in their IP dimension.
92  void evaluateValues(const PHX::MDField<Scalar,Cell,NODE,Dim> & vertex_coordinates,
93  const PHX::MDField<Scalar,Cell,IP,Dim> & other_ip_coordinates);
94 
95  Array_IPDim cub_points; // <IP,Dim>
96  Array_IPDim side_cub_points; // <IP,Dim> points on face topology (dim-1)
98  Array_CellBASISDim node_coordinates; // <Cell,BASIS,Dim>
99  Array_CellIPDimDim jac; // <Cell,IP,Dim,Dim>
100  Array_CellIPDimDim jac_inv; // <Cell,IP,Dim,Dim>
101  Array_CellIP jac_det; // <Cell,IP>
104 
105  Teuchos::RCP<const panzer::IntegrationRule> int_rule;
106 
107  Teuchos::RCP< Intrepid2::Cubature<double,DblArrayDynamic> > intrepid_cubature;
108 
109  // for Shakib stabilization <Cell,IP,Dim,Dim>
113 
114  // integration points
115  Array_CellIPDim ip_coordinates; // <Cell,IP,Dim>
116  Array_CellIPDim ref_ip_coordinates; // <Cell,IP,Dim> for Control Volumes
117 
120 
121  private:
123  std::string prefix;
124  std::vector<PHX::index_size_type> ddims_;
125 
126  void getCubature(const PHX::MDField<Scalar,Cell,NODE,Dim> & in_node_coordinates);
127  void getCubatureCV(const PHX::MDField<Scalar,Cell,NODE,Dim> & in_node_coordinates);
128  void evaluateRemainingValues(const PHX::MDField<Scalar,Cell,NODE,Dim> & in_node_coordinates);
129  void evaluateValuesCV(const PHX::MDField<Scalar,Cell,NODE,Dim> & vertex_coordinates);
130  };
131 
132 } // namespace panzer
133 
134 #endif
void evaluateValues(const PHX::MDField< Scalar, Cell, NODE, Dim > &vertex_coordinates)
Cell vertex coordinates, not basis coordinates.
IntegrationValues2(const std::string &pre="", bool allocArrays=false)
PHX::MDField< Scalar, Cell, IP > Array_CellIP
Teuchos::RCP< Intrepid2::Cubature< double, DblArrayDynamic > > intrepid_cubature
PHX::MDField< Scalar, IP > Array_IP
void evaluateRemainingValues(const PHX::MDField< Scalar, Cell, NODE, Dim > &in_node_coordinates)
PHX::MDField< Scalar, Cell, IP, Dim, Dim > Array_CellIPDimDim
Teuchos::RCP< const panzer::IntegrationRule > int_rule
PHX::MDField< Scalar, Cell, BASIS, Dim > Array_CellBASISDim
ArrayTraits< Scalar, PHX::MDField< Scalar > >::size_type size_type
void setupArrays(const Teuchos::RCP< const panzer::IntegrationRule > &ir)
Sizes/allocates memory for arrays.
PHX::MDField< Scalar, Cell, IP, Dim > Array_CellIPDim
PHX::MDField< double > DblArrayDynamic
PHX::MDField< Scalar, IP, Dim > Array_IPDim
void getCubature(const PHX::MDField< Scalar, Cell, NODE, Dim > &in_node_coordinates)
void evaluateValuesCV(const PHX::MDField< Scalar, Cell, NODE, Dim > &vertex_coordinates)
std::vector< PHX::index_size_type > ddims_
void getCubatureCV(const PHX::MDField< Scalar, Cell, NODE, Dim > &in_node_coordinates)
void setupArraysForNodeRule(const Teuchos::RCP< const panzer::IntegrationRule > &ir)