Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_ResponseEvaluatorFactory_Probe.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_Probe_hpp__
12 #define __Panzer_ResponseEvaluatorFactory_Probe_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  MPI_Comm comm,
36  const Teuchos::Array<double>& point,
37  int fieldComponent = 0,
38  int cubatureDegree=1,
39  const std::string & fieldName="",
40  const Teuchos::RCP<const panzer::LinearObjFactory<panzer::Traits> > & linearObjFactory=Teuchos::null,
41  const Teuchos::RCP<const panzer::GlobalIndexer> & globalIndexer=Teuchos::null,
42  bool applyDirichletToDerivative=false)
43  : comm_(comm), point_(point), fieldComponent_(fieldComponent), cubatureDegree_(cubatureDegree)
44  , fieldName_(fieldName), linearObjFactory_(linearObjFactory), globalIndexer_(globalIndexer)
45  , applyDirichletToDerivative_(applyDirichletToDerivative)
46  {
47  TEUCHOS_ASSERT((linearObjFactory==Teuchos::null && globalIndexer==Teuchos::null) ||
48  (linearObjFactory!=Teuchos::null && globalIndexer!=Teuchos::null));
49  }
50 
52 
62  virtual Teuchos::RCP<ResponseBase> buildResponseObject(const std::string & responseName) const;
63 
64  virtual Teuchos::RCP<ResponseBase> buildResponseObject(const std::string & responseName,
65  const std::vector<WorksetDescriptor> & wkstDesc) const
66  { return buildResponseObject(responseName); }
67 
79  virtual void buildAndRegisterEvaluators(const std::string & responseName,
81  const panzer::PhysicsBlock & physicsBlock,
82  const Teuchos::ParameterList & user_data) const;
83 
91  virtual bool typeSupported() const;
92 
93 protected:
95  int getCubatureDegree() const { return cubatureDegree_; }
96 
97 private:
98  MPI_Comm comm_;
102  std::string fieldName_;
105  bool applyDirichletToDerivative_; // do we need this???
106 };
107 
108 template <typename LO,typename GO>
110  MPI_Comm comm;
114  std::string fieldName;
115  bool applyDirichletToDerivative; // if this is set to true, then the dirichlet values will be zerod out in
116  // the DgDx vector
117 
119 
121 
123  const Teuchos::RCP<const panzer::GlobalIndexer> & in_globalIndexer)
124  {
125  linearObjFactory = in_linearObjFactory;
126  globalIndexer = in_globalIndexer;
127 
128  TEUCHOS_ASSERT((linearObjFactory==Teuchos::null && globalIndexer==Teuchos::null) ||
129  (linearObjFactory!=Teuchos::null && globalIndexer!=Teuchos::null));
130  }
131 
132  virtual void setDerivativeInformation(const Teuchos::RCP<const panzer::LinearObjFactory<panzer::Traits> > & in_linearObjFactory)
133  {
134  using Teuchos::rcp_dynamic_cast;
135 
136  setDerivativeInformation(in_linearObjFactory,
137  rcp_dynamic_cast<const panzer::GlobalIndexer>(in_linearObjFactory->getDomainGlobalIndexer(),true));
138  }
139 
140  template <typename T>
145 
147  { return build<panzer::Traits::Residual>(); }
148 
150  { return build<panzer::Traits::Jacobian>(); }
151 
153  { return build<panzer::Traits::Tangent>(); }
154 
155 private:
158 };
159 
160 
161 }
162 
164 
165 #endif
Teuchos::RCP< const panzer::GlobalIndexer > globalIndexer
void setDerivativeInformation(const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &in_linearObjFactory, const Teuchos::RCP< const panzer::GlobalIndexer > &in_globalIndexer)
Object that contains information on the physics and discretization of a block of elements with the SA...
virtual Teuchos::RCP< ResponseBase > buildResponseObject(const std::string &responseName, const std::vector< WorksetDescriptor > &wkstDesc) const
ResponseEvaluatorFactory_Probe(MPI_Comm comm, const Teuchos::Array< double > &point, int fieldComponent=0, int cubatureDegree=1, const std::string &fieldName="", const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &linearObjFactory=Teuchos::null, const Teuchos::RCP< const panzer::GlobalIndexer > &globalIndexer=Teuchos::null, bool applyDirichletToDerivative=false)
virtual Teuchos::RCP< ResponseBase > buildResponseObject(const std::string &responseName) const
virtual Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > buildTangentFactory() const
int getCubatureDegree() const
Accessor method for Cubature degree (can be used by sub classes)
Teuchos::RCP< const panzer::GlobalIndexer > globalIndexer_
virtual Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > buildValueFactory() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > linearObjFactory
virtual void setDerivativeInformation(const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &in_linearObjFactory)
virtual Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > buildDerivativeFactory() const
Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > build() const
#define TEUCHOS_ASSERT(assertion_test)
virtual void buildAndRegisterEvaluators(const std::string &responseName, PHX::FieldManager< panzer::Traits > &fm, const panzer::PhysicsBlock &physicsBlock, const Teuchos::ParameterList &user_data) const
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > linearObjFactory_