Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_GatherSolution_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//
12#ifndef __Panzer_GatherSolution_Tpetra_Hessian_hpp__
13#define __Panzer_GatherSolution_Tpetra_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// Tpetra gather solution file
20
21namespace panzer {
22
23// **************************************************************
24// Hessian Specialization
25// **************************************************************
26
38template<typename TRAITS,typename LO,typename GO,typename NodeT>
40 : public panzer::EvaluatorWithBaseImpl<TRAITS>,
41 public PHX::EvaluatorDerived<panzer::Traits::Hessian, TRAITS>,
43
44
45public:
46
48 GatherSolution_Tpetra(const Teuchos::RCP<const panzer::GlobalIndexer> & indexer) :
49 globalIndexer_(indexer) {}
50
52 GatherSolution_Tpetra(const Teuchos::RCP<const panzer::GlobalIndexer> & /* indexer */,
53 const Teuchos::ParameterList& /* p */) {}
54
56 void postRegistrationSetup(typename TRAITS::SetupData /* d */,
57 PHX::FieldManager<TRAITS>& /* vm */) {}
58
60 void preEvaluate(typename TRAITS::PreEvalData /* d */) {}
61
63 void evaluateFields(typename TRAITS::EvalData /* d */) {}
64
66 virtual Teuchos::RCP<CloneableEvaluator> clone(const Teuchos::ParameterList & pl) const
68
69 // for testing purposes
71 const PHX::FieldTag & getFieldTag(int i) const
72 { TEUCHOS_ASSERT(i < Teuchos::as<int>(gatherFields_.size())); return gatherFields_[i].fieldTag(); }
73
74private:
75
77
78 // maps the local (field,element,basis) triplet to a global ID
79 // for scattering
80 Teuchos::RCP<const panzer::GlobalIndexer> globalIndexer_;
81 std::vector<int> fieldIds_; // field IDs needing mapping
82
83 std::vector< PHX::MDField<ScalarT,Cell,NODE> > gatherFields_;
84
85 Teuchos::RCP<std::vector<std::string> > indexerNames_;
87 std::string globalDataKey_; // what global data does this fill?
88
89 Teuchos::RCP<const TpetraLinearObjContainer<double,LO,GO,NodeT> > tpetraContainer_;
90
91 // Fields for storing tangent components dx/dp of solution vector x
92 // These are not actually used by the residual specialization of this evaluator,
93 // even if they are supplied, but it is useful to declare them as dependencies anyway
94 // when saving the tangent components to the output file
96 std::vector< std::vector< PHX::MDField<const ScalarT,Cell,NODE> > > tangentFields_;
97
99};
100
101}
102
103#endif // end hessian support
104
105#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_
std::vector< std::vector< PHX::MDField< const ScalarT, Cell, NODE > > > tangentFields_
GatherSolution_Tpetra(const Teuchos::RCP< const panzer::GlobalIndexer > &, const Teuchos::ParameterList &)
No-op constructor (unimplemented for this specialization).
GatherSolution_Tpetra(const Teuchos::RCP< const panzer::GlobalIndexer > &indexer)
Construct with a global indexer only; no-op beyond storing the indexer.
void postRegistrationSetup(typename TRAITS::SetupData, PHX::FieldManager< TRAITS > &)
No-op (unimplemented for this specialization).
void evaluateFields(typename TRAITS::EvalData)
No-op (unimplemented for this specialization).
const PHX::FieldTag & getFieldTag(int i) const
Returns the FieldTag of the i-th gathered field. For testing purposes.
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...
void preEvaluate(typename TRAITS::PreEvalData)
No-op (unimplemented for this specialization).
Evaluation type for computing second derivatives, using HessianType as the scalar type....