Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_ResponseEvaluatorFactory_ExtremeValue.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_ResponseEvaluatorFactory_ExtremeValue_hpp__
12 #define __Panzer_ResponseEvaluatorFactory_ExtremeValue_hpp__
13 
14 #include <string>
15 
16 #include "PanzerDiscFE_config.hpp"
17 #include "Panzer_PhysicsBlock.hpp"
18 #include "Panzer_BC.hpp"
19 #include "Panzer_Traits.hpp"
23 
24 #include <mpi.h>
25 
26 namespace panzer {
27 
30 template <typename EvalT,typename LO,typename GO>
32 public:
33 
35  int cubatureDegree=1,
36  bool requiresCellReduction=true,
37  bool useMax=true,
38  const std::string & quadPointField="",
39  const Teuchos::RCP<const panzer::LinearObjFactory<panzer::Traits> > & linearObjFactory=Teuchos::null,
40  const Teuchos::RCP<const panzer::GlobalIndexer> & globalIndexer=Teuchos::null,
41  bool applyDirichletToDerivative=false,
42  std::string in_prefix="")
43  : comm_(comm), cubatureDegree_(cubatureDegree), requiresCellExtreme_(requiresCellReduction), useMax_(useMax)
44  , quadPointField_(quadPointField), linearObjFactory_(linearObjFactory), globalIndexer_(globalIndexer)
45  , applyDirichletToDerivative_(applyDirichletToDerivative)
46  , prefix_(in_prefix)
47  {
48  TEUCHOS_ASSERT((linearObjFactory==Teuchos::null && globalIndexer==Teuchos::null) ||
49  (linearObjFactory!=Teuchos::null && globalIndexer!=Teuchos::null));
50  }
51 
53 
63  virtual Teuchos::RCP<ResponseBase> buildResponseObject(const std::string & responseName) const;
64 
65  virtual Teuchos::RCP<ResponseBase> buildResponseObject(const std::string & responseName,
66  const std::vector<WorksetDescriptor> & /* wkstDesc */) const
67  { return buildResponseObject(responseName); }
68 
80  virtual void buildAndRegisterEvaluators(const std::string & responseName,
82  const panzer::PhysicsBlock & physicsBlock,
83  const Teuchos::ParameterList & user_data) const;
84 
92  virtual bool typeSupported() const;
93 
94 protected:
96  int getCubatureDegree() const { return cubatureDegree_; }
97 
98 private:
99  MPI_Comm comm_;
102  bool useMax_;
103  std::string quadPointField_;
107  std::string prefix_;
108 };
109 
110 template <typename LO,typename GO>
112  MPI_Comm comm;
115  bool useMax;
116  std::string quadPointField;
117  bool applyDirichletToDerivative; // if this is set to true, then the dirichlet values will be zerod out in
118  // the DgDx vector
119 
120  std::string prefix;
122 
124 
126  const Teuchos::RCP<const panzer::GlobalIndexer> & in_globalIndexer)
127  {
128  linearObjFactory = in_linearObjFactory;
129  globalIndexer = in_globalIndexer;
130 
131  TEUCHOS_ASSERT((linearObjFactory==Teuchos::null && globalIndexer==Teuchos::null) ||
132  (linearObjFactory!=Teuchos::null && globalIndexer!=Teuchos::null));
133  }
134 
135  virtual void setDerivativeInformation(const Teuchos::RCP<const panzer::LinearObjFactory<panzer::Traits> > & in_linearObjFactory)
136  {
137  using Teuchos::rcp_dynamic_cast;
138 
139  setDerivativeInformation(in_linearObjFactory,
140  rcp_dynamic_cast<const panzer::GlobalIndexer>(in_linearObjFactory->getDomainGlobalIndexer(),true));
141  }
142 
143  template <typename T>
147 
149  { return build<panzer::Traits::Residual>(); }
150 
152  { return build<panzer::Traits::Jacobian>(); }
153 
155  { return build<panzer::Traits::Tangent>(); }
156 
157 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
158 
162  { return build<panzer::Traits::Hessian>(); }
163 #endif
164 
165 private:
168 };
169 
170 
171 }
172 
174 
175 #endif
virtual Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > buildDerivativeFactory() const
Teuchos::RCP< const panzer::GlobalIndexer > globalIndexer
Object that contains information on the physics and discretization of a block of elements with the SA...
virtual Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > buildHessianFactory() const
virtual void setDerivativeInformation(const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &in_linearObjFactory)
void setDerivativeInformation(const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &in_linearObjFactory, const Teuchos::RCP< const panzer::GlobalIndexer > &in_globalIndexer)
virtual Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > buildTangentFactory() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
int getCubatureDegree() const
Accessor method for Cubature degree (can be used by sub classes)
Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > build() const
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > linearObjFactory_
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > linearObjFactory
ResponseEvaluatorFactory_ExtremeValue(MPI_Comm comm, int cubatureDegree=1, bool requiresCellReduction=true, bool useMax=true, const std::string &quadPointField="", const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &linearObjFactory=Teuchos::null, const Teuchos::RCP< const panzer::GlobalIndexer > &globalIndexer=Teuchos::null, bool applyDirichletToDerivative=false, std::string in_prefix="")
virtual Teuchos::RCP< ResponseBase > buildResponseObject(const std::string &responseName) const
virtual void buildAndRegisterEvaluators(const std::string &responseName, PHX::FieldManager< panzer::Traits > &fm, const panzer::PhysicsBlock &physicsBlock, const Teuchos::ParameterList &user_data) const
virtual Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > buildValueFactory() const
#define TEUCHOS_ASSERT(assertion_test)
virtual Teuchos::RCP< ResponseBase > buildResponseObject(const std::string &responseName, const std::vector< WorksetDescriptor > &) const