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// **************************************************************
26template<typename TRAITS,typename LO,typename GO,typename NodeT>
28 : public panzer::EvaluatorWithBaseImpl<TRAITS>,
29 public PHX::EvaluatorDerived<panzer::Traits::Hessian, TRAITS>,
31
32
33public:
34
35 GatherSolution_Tpetra(const Teuchos::RCP<const panzer::GlobalIndexer> & indexer) :
36 globalIndexer_(indexer) {}
37
38 GatherSolution_Tpetra(const Teuchos::RCP<const panzer::GlobalIndexer> & /* indexer */,
39 const Teuchos::ParameterList& /* p */) {}
40
41 void postRegistrationSetup(typename TRAITS::SetupData /* d */,
42 PHX::FieldManager<TRAITS>& /* vm */) {}
43
44 void preEvaluate(typename TRAITS::PreEvalData /* d */) {}
45
46 void evaluateFields(typename TRAITS::EvalData /* d */) {}
47
48 virtual Teuchos::RCP<CloneableEvaluator> clone(const Teuchos::ParameterList & pl) const
49 { return Teuchos::rcp(new GatherSolution_Tpetra<panzer::Traits::Hessian,TRAITS,LO,GO,NodeT>(globalIndexer_,pl)); }
50
51 // for testing purposes
52 const PHX::FieldTag & getFieldTag(int i) const
53 { TEUCHOS_ASSERT(i < Teuchos::as<int>(gatherFields_.size())); return gatherFields_[i].fieldTag(); }
54
55private:
56
58
59 // maps the local (field,element,basis) triplet to a global ID
60 // for scattering
61 Teuchos::RCP<const panzer::GlobalIndexer> globalIndexer_;
62 std::vector<int> fieldIds_; // field IDs needing mapping
63
64 std::vector< PHX::MDField<ScalarT,Cell,NODE> > gatherFields_;
65
66 Teuchos::RCP<std::vector<std::string> > indexerNames_;
68 std::string globalDataKey_; // what global data does this fill?
69
70 Teuchos::RCP<const TpetraLinearObjContainer<double,LO,GO,NodeT> > tpetraContainer_;
71
72 // Fields for storing tangent components dx/dp of solution vector x
73 // These are not actually used by the residual specialization of this evaluator,
74 // even if they are supplied, but it is useful to declare them as dependencies anyway
75 // when saving the tangent components to the output file
77 std::vector< std::vector< PHX::MDField<const ScalarT,Cell,NODE> > > tangentFields_;
78
80};
81
82}
83
84#endif // end hessian support
85
86#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 &)
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Gathers solution values from the Newton solution vector into the nodal fields of the field manager.