Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_ScatterResidual_Tpetra_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#ifndef __Panzer_ScatterResidual_Tpetra_Hessian_hpp__
12#define __Panzer_ScatterResidual_Tpetra_Hessian_hpp__
13
14// only do this if required by the user
15#ifdef Panzer_BUILD_HESSIAN_SUPPORT
16
17// the includes for this file come in as a result of the includes in the main
18// Tpetra scatter residual file
19
20namespace panzer {
21
22// **************************************************************
23// Hessian Specialization
24// **************************************************************
25
35template<typename TRAITS,typename LO,typename GO,typename NodeT>
37 : public panzer::EvaluatorWithBaseImpl<TRAITS>,
38 public PHX::EvaluatorDerived<panzer::Traits::Hessian, TRAITS>,
40
41public:
43 ScatterResidual_Tpetra(const Teuchos::RCP<const panzer::GlobalIndexer> & indexer)
44 : globalIndexer_(indexer) {}
45
47 ScatterResidual_Tpetra(const Teuchos::RCP<const panzer::GlobalIndexer> & indexer,
48 const Teuchos::ParameterList& p);
49
51 void postRegistrationSetup(typename TRAITS::SetupData d,
53
55 void preEvaluate(typename TRAITS::PreEvalData d);
56
58 void evaluateFields(typename TRAITS::EvalData workset);
59
61 virtual Teuchos::RCP<CloneableEvaluator> clone(const Teuchos::ParameterList & pl) const
62 { return Teuchos::rcp(new ScatterResidual_Tpetra<panzer::Traits::Hessian,TRAITS,LO,GO,NodeT>(globalIndexer_,pl)); }
63
64private:
66
67 // dummy field so that the evaluator will have something to do
68 Teuchos::RCP<PHX::FieldTag> scatterHolder_;
69
70 // fields that need to be scattered will be put in this vector
71 std::vector< PHX::MDField<const ScalarT,Cell,NODE> > scatterFields_;
72
73 // maps the local (field,element,basis) triplet to a global ID
74 // for scattering
75 Teuchos::RCP<const panzer::GlobalIndexer> globalIndexer_;
76 std::vector<int> fieldIds_; // field IDs needing mapping
77
78 // This maps the scattered field names to the DOF manager field
79 // For instance a Navier-Stokes map might look like
80 // fieldMap_["RESIDUAL_Velocity"] --> "Velocity"
81 // fieldMap_["RESIDUAL_Pressure"] --> "Pressure"
82 Teuchos::RCP<const std::map<std::string,std::string> > fieldMap_;
83
84 std::string globalDataKey_; // what global data does this fill?
85 Teuchos::RCP<const TpetraLinearObjContainer<double,LO,GO,NodeT> > tpetraContainer_;
86
88};
89
90}
91
92#endif // end hessian support
93
94#endif
Non-templated empty base class for template managers.
Wrapper to PHX::EvaluatorWithBaseImpl that implements Panzer-specific helpers.
Teuchos::RCP< const TpetraLinearObjContainer< double, LO, GO, NodeT > > tpetraContainer_
ScatterResidual_Tpetra(const Teuchos::RCP< const panzer::GlobalIndexer > &indexer)
Construct with a global indexer only; scattered field names must be set later (e.g....
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Creates a copy of this evaluator configured from a new ParameterList, sharing the same global indexer...
Pushes residual values into the residual vector for a Newton-based solve.
Evaluation type for computing second derivatives, using HessianType as the scalar type....