Panzer Version of the Day
Loading...
Searching...
No Matches
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"
18#include "Panzer_BC.hpp"
19#include "Panzer_Traits.hpp"
23
24#include <mpi.h>
25
26namespace panzer {
27
30template <typename EvalT,typename LO,typename GO>
32public:
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
94protected:
96 int getCubatureDegree() const { return cubatureDegree_; }
97
98private:
99 MPI_Comm comm_;
103 std::string quadPointField_;
104 Teuchos::RCP<const panzer::LinearObjFactory<panzer::Traits> > linearObjFactory_;
105 Teuchos::RCP<const panzer::GlobalIndexer> globalIndexer_;
107 std::string prefix_;
108};
109
110template <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
125 void setDerivativeInformation(const Teuchos::RCP<const panzer::LinearObjFactory<panzer::Traits> > & in_linearObjFactory,
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
148 virtual Teuchos::RCP<panzer::ResponseEvaluatorFactoryBase> buildValueFactory() const
150
151 virtual Teuchos::RCP<panzer::ResponseEvaluatorFactoryBase> buildDerivativeFactory() const
153
154 virtual Teuchos::RCP<panzer::ResponseEvaluatorFactoryBase> buildTangentFactory() const
156
157#ifdef Panzer_BUILD_HESSIAN_SUPPORT
161 virtual Teuchos::RCP<panzer::ResponseEvaluatorFactoryBase> buildHessianFactory() const
163#endif
164
165private:
166 Teuchos::RCP<const panzer::LinearObjFactory<panzer::Traits> > linearObjFactory;
167 Teuchos::RCP<const panzer::GlobalIndexer> globalIndexer;
168};
169
170
171}
172
174
175#endif
Object that contains information on the physics and discretization of a block of elements with the SA...
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > linearObjFactory_
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< ResponseBase > buildResponseObject(const std::string &responseName, const std::vector< WorksetDescriptor > &) const
virtual Teuchos::RCP< ResponseBase > buildResponseObject(const std::string &responseName) const
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="")
Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > ResponseMESupportBuilderBase::build< panzer::Traits::Tangent >() const
Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > ResponseMESupportBuilderBase::build< panzer::Traits::Residual >() const
Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > ResponseMESupportBuilderBase::build< panzer::Traits::Jacobian >() const
Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > ResponseMESupportBuilderBase::build< panzer::Traits::Hessian >() const
virtual void setDerivativeInformation(const Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > &in_linearObjFactory)
Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > build() const
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > linearObjFactory
virtual Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > buildHessianFactory() const
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 > buildValueFactory() const
virtual Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > buildTangentFactory() const
virtual Teuchos::RCP< panzer::ResponseEvaluatorFactoryBase > buildDerivativeFactory() const