Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_ResponseEvaluatorFactory_Functional.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_Functional_hpp__
12 #define __Panzer_ResponseEvaluatorFactory_Functional_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 
34  ResponseEvaluatorFactory_Functional(MPI_Comm comm, int cubatureDegree=1,bool requiresCellIntegral=true,const std::string & quadPointField="",
35  const Teuchos::RCP<const panzer::LinearObjFactory<panzer::Traits> > & linearObjFactory=Teuchos::null,
36  bool applyDirichletToDerivative=false)
37  : comm_(comm), cubatureDegree_(cubatureDegree), requiresCellIntegral_(requiresCellIntegral)
38  , quadPointField_(quadPointField), linearObjFactory_(linearObjFactory)
39  , applyDirichletToDerivative_(applyDirichletToDerivative)
40  { }
41 
43 
53  virtual Teuchos::RCP<ResponseBase> buildResponseObject(const std::string & responseName) const;
54 
55  virtual Teuchos::RCP<ResponseBase> buildResponseObject(const std::string & responseName,
56  const std::vector<WorksetDescriptor> & /* wkstDesc */) const
57  { return buildResponseObject(responseName); }
58 
70  virtual void buildAndRegisterEvaluators(const std::string & responseName,
72  const panzer::PhysicsBlock & physicsBlock,
73  const Teuchos::ParameterList & user_data) const;
74 
82  virtual bool typeSupported() const;
83 
84 protected:
86  int getCubatureDegree() const { return cubatureDegree_; }
87 
88 private:
89  MPI_Comm comm_;
92  std::string quadPointField_;
95 };
96 
97 template <typename LO,typename GO>
99  MPI_Comm comm;
102  std::string quadPointField;
103  bool applyDirichletToDerivative; // if this is set to true, then the dirichlet values will be zerod out in
104  // the DgDx vector
105 
107 
109 
111  {
112  linearObjFactory = in_linearObjFactory;
113  }
114 
115  template <typename T>
119 
121  { return build<panzer::Traits::Residual>(); }
122 
124  { return build<panzer::Traits::Jacobian>(); }
125 
127  { return build<panzer::Traits::Tangent>(); }
128 
129 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
131  { return build<panzer::Traits::Hessian>(); }
132 #endif
133 
134 private:
136 };
137 
138 
139 }
140 
142 
143 #endif
void setDerivativeInformation(const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &in_linearObjFactory)
Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > build() const
Object that contains information on the physics and discretization of a block of elements with the SA...
virtual Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > buildTangentFactory() const
virtual Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > buildValueFactory() const
ResponseEvaluatorFactory_Functional(MPI_Comm comm, int cubatureDegree=1, bool requiresCellIntegral=true, const std::string &quadPointField="", const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &linearObjFactory=Teuchos::null, bool applyDirichletToDerivative=false)
virtual Teuchos::RCP< ResponseBase > buildResponseObject(const std::string &responseName, const std::vector< WorksetDescriptor > &) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > linearObjFactory_
virtual Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > buildDerivativeFactory() const
virtual Teuchos::RCP< ResponseBase > buildResponseObject(const std::string &responseName) const
int getCubatureDegree() const
Accessor method for Cubature degree (can be used by sub classes)
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 > buildHessianFactory() const
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > linearObjFactory