Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_ScatterResidual_BlockedEpetra_Hessian.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//
12#ifndef __Panzer_ScatterResidual_BlockedEpetra_Hessian_hpp__
13#define __Panzer_ScatterResidual_BlockedEpetra_Hessian_hpp__
14
15// only do this if required by the user
16#ifdef Panzer_BUILD_HESSIAN_SUPPORT
17
18// the includes for this file come in as a result of the includes in the main
19// Epetra scatter residual file
20
21namespace panzer {
22
23// **************************************************************
24// Hessian Specialization
25// **************************************************************
26template<typename TRAITS,typename LO,typename GO>
28 : public panzer::EvaluatorWithBaseImpl<TRAITS>,
29 public PHX::EvaluatorDerived<panzer::Traits::Hessian, TRAITS>,
31
32public:
33
34 ScatterResidual_BlockedEpetra(const std::vector<Teuchos::RCP<const GlobalIndexer<LO,int> > > & rIndexers,
35 const std::vector<Teuchos::RCP<const GlobalIndexer<LO,int> > > & cIndexers,
36 bool useDiscreteAdjoint=false)
37 : rowIndexers_(rIndexers), colIndexers_(cIndexers), useDiscreteAdjoint_(useDiscreteAdjoint) {}
38
39 ScatterResidual_BlockedEpetra(const std::vector<Teuchos::RCP<const GlobalIndexer<LO,int> > > & rIndexers,
40 const std::vector<Teuchos::RCP<const GlobalIndexer<LO,int> > > & cIndexers,
41 const Teuchos::ParameterList& p,
42 bool useDiscreteAdjoint=false);
43
44 void postRegistrationSetup(typename TRAITS::SetupData d,
46
47 void preEvaluate(typename TRAITS::PreEvalData d);
48
49 void evaluateFields(typename TRAITS::EvalData workset);
50
51 virtual Teuchos::RCP<CloneableEvaluator> clone(const Teuchos::ParameterList & pl) const
52 { return Teuchos::rcp(new ScatterResidual_BlockedEpetra<panzer::Traits::Hessian,TRAITS,LO,GO>(rowIndexers_,colIndexers_,pl,useDiscreteAdjoint_)); }
53
54private:
56
57 // dummy field so that the evaluator will have something to do
58 Teuchos::RCP<PHX::FieldTag> scatterHolder_;
59
60 // fields that need to be scattered will be put in this vector
61 std::vector< PHX::MDField<const ScalarT,Cell,NODE> > scatterFields_;
62
63 std::vector<Teuchos::RCP<const GlobalIndexer<LO,int> > > rowIndexers_;
64 std::vector<Teuchos::RCP<const GlobalIndexer<LO,int> > > colIndexers_;
65
66 std::vector<int> indexerIds_; // block index
67 std::vector<int> subFieldIds_; // sub field numbers
68
69 // This maps the scattered field names to the DOF manager field
70 // For instance a Navier-Stokes map might look like
71 // fieldMap_["RESIDUAL_Velocity"] --> "Velocity"
72 // fieldMap_["RESIDUAL_Pressure"] --> "Pressure"
73 Teuchos::RCP<const std::map<std::string,std::string> > fieldMap_;
74
75 std::string globalDataKey_; // what global data does this fill?
77
78 Teuchos::RCP<Thyra::BlockedLinearOpBase<double> > Jac_;
79
81};
82
83}
84
85// **************************************************************
86#endif
87
88#endif
Non-templated empty base class for template managers.
Wrapper to PHX::EvaluatorWithBaseImpl that implements Panzer-specific helpers.
ScatterResidual_BlockedEpetra(const std::vector< Teuchos::RCP< const GlobalIndexer< LO, int > > > &rIndexers, const std::vector< Teuchos::RCP< const GlobalIndexer< LO, int > > > &cIndexers, bool useDiscreteAdjoint=false)
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Pushes residual values into the residual vector for a Newton-based solve.
void postRegistrationSetup(typename TRAITS::SetupData d, PHX::FieldManager< TRAITS > &vm)