Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_ScatterResidual_BlockedTpetra_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_BlockedTpetra_Hessian_hpp__
12#define __Panzer_ScatterResidual_BlockedTpetra_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// blocked Tpetra scatter dirichlet 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_BlockedTpetra(const Teuchos::RCP<const BlockedDOFManager> & indexer)
44 : globalIndexer_(indexer) {}
45
47 ScatterResidual_BlockedTpetra(const Teuchos::RCP<const BlockedDOFManager> & 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_BlockedTpetra<panzer::Traits::Hessian,TRAITS,LO,GO,NodeT>(globalIndexer_,pl)); }
63
64private:
66 typedef typename TRAITS::RealType RealType;
67
69 typedef Tpetra::Vector<RealType,LO,GO,NodeT> VectorType;
70 typedef Tpetra::CrsMatrix<RealType,LO,GO,NodeT> CrsMatrixType;
71 typedef Tpetra::CrsGraph<LO,GO,NodeT> CrsGraphType;
72 typedef Tpetra::Map<LO,GO,NodeT> MapType;
73 typedef Tpetra::Import<LO,GO,NodeT> ImportType;
74 typedef Tpetra::Export<LO,GO,NodeT> ExportType;
75
76 // dummy field so that the evaluator will have something to do
77 Teuchos::RCP<PHX::FieldTag> scatterHolder_;
78
79 // fields that need to be scattered will be put in this vector
80 std::vector< PHX::MDField<const ScalarT,Cell,NODE> > scatterFields_;
81
82 // maps the local (field,element,basis) triplet to a global ID
83 // for scattering
84 Teuchos::RCP<const BlockedDOFManager> globalIndexer_;
85
86 std::vector<int> fieldIds_; // field IDs needing mapping
87
88 // This maps the scattered field names to the DOF manager field
89 // For instance a Navier-Stokes map might look like
90 // fieldMap_["RESIDUAL_Velocity"] --> "Velocity"
91 // fieldMap_["RESIDUAL_Pressure"] --> "Pressure"
92 Teuchos::RCP<const std::map<std::string,std::string> > fieldMap_;
93
94 std::string globalDataKey_; // what global data does this fill?
95 Teuchos::RCP<const BlockedTpetraLinearObjContainer<RealType,LO,GO,NodeT> > blockedContainer_;
96
98};
99
100}
101
102// **************************************************************
103#endif
104
105#endif
Non-templated empty base class for template managers.
Wrapper to PHX::EvaluatorWithBaseImpl that implements Panzer-specific helpers.
Teuchos::RCP< const BlockedTpetraLinearObjContainer< RealType, LO, GO, NodeT > > blockedContainer_
ScatterResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer)
Construct with a blocked DOF manager only; scattered field names must be set later (e....
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Creates a copy of this evaluator configured from a new ParameterList, sharing the same blocked DOF ma...
Pushes residual values into the residual vector for a Newton-based solve.
void postRegistrationSetup(typename TRAITS::SetupData, PHX::FieldManager< TRAITS > &)
Evaluation type for computing second derivatives, using HessianType as the scalar type....