Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_CellAverage.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_CellAverage_hpp__
12 #define __Panzer_CellAverage_hpp__
13 
14 #include <string>
15 #include "Panzer_Dimension.hpp"
16 #include "Phalanx_Evaluator_Macros.hpp"
17 #include "Phalanx_MDField.hpp"
18 #include "Kokkos_DynRankView.hpp"
19 
21 
22 namespace panzer {
23 
37 template<typename EvalT, typename Traits>
39  :
40  public panzer::EvaluatorWithBaseImpl<Traits>,
41  public PHX::EvaluatorDerived<EvalT, Traits>
42 {
43  public:
44 
46  const Teuchos::ParameterList& p);
47 
48  void
50  typename Traits::SetupData d,
52 
53  void
55  typename Traits::EvalData d);
56 
57  private:
58 
59  using ScalarT = typename EvalT::ScalarT;
60 
62 
63  PHX::MDField<const ScalarT,Cell,IP> scalar; // function to be integrated
64 
65  std::vector<PHX::MDField<const ScalarT,Cell,IP> > field_multipliers;
66  double multiplier;
67 
68  std::size_t num_qp;
69  std::size_t quad_index;
71 
72 public:
73  // for testing purposes
74  const PHX::FieldTag & getFieldTag() const
75  { return average.fieldTag(); }
76 
77 private:
79 
80 }; // end of class CellAverage
81 
82 
94 template <typename EvalT,typename Traits>
96  const std::string & fieldName,
98 {
99  using Teuchos::RCP;
100  using Teuchos::rcp;
101  using Teuchos::rcp_const_cast;
102 
104  input.set("Average Name",averageName);
105  input.set("Field Name",fieldName);
106  input.set("IR",rcp_const_cast<panzer::IntegrationRule>(ir));
107 
108  return rcp(new CellAverage<EvalT,Traits>(input));
109 }
110 
111 }
112 
113 #endif
Teuchos::RCP< PHX::Evaluator< Traits > > cellAverageEvaluator(const std::string &averageName, const std::string &fieldName, const Teuchos::RCP< const panzer::IntegrationRule > &ir)
typename EvalT::ScalarT ScalarT
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
PHX::MDField< ScalarT, Cell > average
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Wrapper to PHX::EvaluatorWithBaseImpl that implements Panzer-specific helpers.
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)
const PHX::FieldTag & getFieldTag() const
void evaluateFields(typename Traits::EvalData d)
PHX::MDField< const ScalarT, Cell, IP > scalar
CellAverage(const Teuchos::ParameterList &p)
std::vector< PHX::MDField< const ScalarT, Cell, IP > > field_multipliers
Teuchos::RCP< Teuchos::ParameterList > getValidParameters() const