11#ifndef PANZER_EVALUATOR_SCATTER_RESIDUAL_BLOCKEDTPETRA_DECL_HPP
12#define PANZER_EVALUATOR_SCATTER_RESIDUAL_BLOCKEDTPETRA_DECL_HPP
14#include "Phalanx_config.hpp"
15#include "Phalanx_Evaluator_Macros.hpp"
16#include "Phalanx_MDField.hpp"
17#include "Phalanx_KokkosViewOfViews.hpp"
19#include "Teuchos_ParameterList.hpp"
21#include "PanzerDiscFE_config.hpp"
26#include "KokkosSparse_CrsMatrix.hpp"
33class BlockedDOFManager;
40template <
typename EvalT,
typename TRAITS,
typename LO,
typename GO,
typename NodeT=panzer::TpetraNodeType>
43 public PHX::EvaluatorDerived<panzer::Traits::Residual, TRAITS>,
51 const Teuchos::ParameterList& p);
53 virtual Teuchos::RCP<CloneableEvaluator>
clone(
const Teuchos::ParameterList & pl)
const
59 { std::cout <<
"unspecialized version of \"ScatterResidual_BlockedTpetra::evaluateFields\" on \""+PHX::print<EvalT>()+
"\" should not be used!" << std::endl;
60 TEUCHOS_ASSERT(
false); }
73template <
typename TRAITS,
typename LO,
typename GO,
typename NodeT>
76 public PHX::EvaluatorDerived<panzer::Traits::Residual, TRAITS>,
81 : globalIndexer_(indexer) {}
86 const std::vector<Teuchos::RCP<const panzer::GlobalIndexer> > & )
87 : globalIndexer_(indexer) {}
90 const Teuchos::ParameterList& p);
93 const std::vector<Teuchos::RCP<const panzer::GlobalIndexer> > & ,
94 const Teuchos::ParameterList& p)
100 void preEvaluate(
typename TRAITS::PreEvalData d);
104 virtual Teuchos::RCP<CloneableEvaluator>
clone(
const Teuchos::ParameterList & pl)
const
142 Teuchos::RCP<const std::map<std::string,std::string> >
fieldMap_;
160template <
typename TRAITS,
typename LO,
typename GO,
typename NodeT>
163 public PHX::EvaluatorDerived<panzer::Traits::Jacobian, TRAITS>,
189 : globalIndexer_(indexer) {}
195 const std::vector<Teuchos::RCP<const panzer::GlobalIndexer> > & colIndexers)
196 : globalIndexer_(indexer), colGlobalIndexers_(colIndexers), hasColIndexers_(true) {}
199 const Teuchos::ParameterList& p);
202 const std::vector<Teuchos::RCP<const panzer::GlobalIndexer> > & colIndexers,
203 const Teuchos::ParameterList& p);
208 void preEvaluate(
typename TRAITS::PreEvalData d);
212 virtual Teuchos::RCP<CloneableEvaluator>
clone(
const Teuchos::ParameterList & pl)
const
246 Teuchos::RCP<const std::map<std::string,std::string> >
fieldMap_;
255 Kokkos::View<typename Sacado::ScalarType<ScalarT>::type**, Kokkos::LayoutRight, PHX::Device>
workset_vals_;
269 bool hasColIndexers_ =
false;
276 using LocalMatrixType = KokkosSparse::CrsMatrix<double,LO,PHX::Device,Kokkos::MemoryTraits<Kokkos::Unmanaged>,
size_t>;
298template <
typename TRAITS,
typename LO,
typename GO,
typename NodeT>
301 public PHX::EvaluatorDerived<panzer::Traits::Residual, TRAITS>,
306 : globalIndexer_(indexer) {}
311 const std::vector<Teuchos::RCP<const panzer::GlobalIndexer> > & )
312 : globalIndexer_(indexer) {}
315 const Teuchos::ParameterList& p);
318 const std::vector<Teuchos::RCP<const panzer::GlobalIndexer> > & ,
319 const Teuchos::ParameterList& p)
325 void preEvaluate(
typename TRAITS::PreEvalData d);
329 virtual Teuchos::RCP<CloneableEvaluator>
clone(
const Teuchos::ParameterList & pl)
const
367 Teuchos::RCP<const std::map<std::string,std::string> >
fieldMap_;
373 PHX::ViewOfViews<2,Kokkos::View<RealType**,Kokkos::LayoutLeft,PHX::Device>>
dfdpFieldsVoV_;
392#ifdef Panzer_BUILD_HESSIAN_SUPPORT
Non-templated empty base class for template managers.
Wrapper to PHX::EvaluatorWithBaseImpl that implements Panzer-specific helpers.
Teuchos::RCP< PHX::FieldTag > scatterHolder_
std::vector< int > fieldIds_
Tpetra::Operator< RealType, LO, GO, NodeT > OperatorType
PHX::View< LocalMatrixType ** >::host_mirror_type hostJacTpetraBlocks_
ScatterResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer)
std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > colGlobalIndexers_
ScatterResidual_BlockedTpetra()
Kokkos::View< typename Sacado::ScalarType< ScalarT >::type **, Kokkos::LayoutRight, PHX::Device > workset_vals_
Scratch space for local values.
PHX::View< int ** > blockExistsInJac_
PHX::View< LocalMatrixType ** > jacTpetraBlocks_
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
std::string globalDataKey_
PHX::View< int ** >::host_mirror_type hostBlockExistsInJac_
std::vector< PHX::View< int * > > fieldOffsets_
Offset into the cell lids for each field. Size of number of fields to scatter.
KokkosSparse::CrsMatrix< double, LO, PHX::Device, Kokkos::MemoryTraits< Kokkos::Unmanaged >, size_t > LocalMatrixType
Sub-block matrix type handed to the scatter kernel.
panzer::Traits::Jacobian::ScalarT ScalarT
PHX::View< LO * >::host_mirror_type blockOffsets_h_
Host copies of the offsets, filled once since the offsets never change.
Teuchos::RCP< const BlockedTpetraLinearObjContainer< RealType, LO, GO, NodeT > > blockedContainer_
PHX::View< LO * > blockOffsets_
The offset values of the blocked DOFs per element. Size of number of blocks in the product vector + 1...
std::vector< int > productVectorBlockIndex_
Teuchos::RCP< const std::map< std::string, std::string > > fieldMap_
std::vector< PHX::MDField< const ScalarT, Cell, NODE > > scatterFields_
BlockedTpetraLinearObjContainer< RealType, LO, GO, NodeT > ContainerType
Kokkos::View< LO **, Kokkos::LayoutRight, PHX::Device > colWorksetLIDs_
Column LIDs and derivative offsets. Aliases of the row members when square.
Tpetra::CrsMatrix< RealType, LO, GO, NodeT > CrsMatrixType
Thyra::TpetraLinearOp< RealType, LO, GO, NodeT > ThyraLinearOp
Kokkos::View< LO **, Kokkos::LayoutRight, PHX::Device > worksetLIDs_
Local indices for unknowns.
TRAITS::RealType RealType
PHX::View< LO * >::host_mirror_type colBlockOffsets_h_
Teuchos::RCP< const BlockedDOFManager > globalIndexer_
Tpetra::Map< LO, GO, NodeT > MapType
PHX::View< LO * > colBlockOffsets_
ScatterResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer, const std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > &colIndexers)
Ctor for a non-square operator, whose columns are indexed separately from its rows (a distributed par...
Teuchos::RCP< const BlockedDOFManager > globalIndexer_
Maps the local (field,element,basis) triplet to a global ID for scattering.
std::vector< PHX::View< int * > > fieldOffsets_
Offset into the cell lids for each field.
std::vector< int > fieldIds_
Field IDs in the local product vector block (not global field id)
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Teuchos::RCP< PHX::FieldTag > scatterHolder_
Dummy evalauted field so that the evaluator will have something to do.
std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > fieldGlobalIndexers_
Vector of global indexers, one for each scattered field respectively.
ScatterResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer, const std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > &, const Teuchos::ParameterList &p)
Tpetra::Export< LO, GO, NodeT > ExportType
ScatterResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer, const std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > &)
ScatterResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer)
Teuchos::RCP< const std::map< std::string, std::string > > fieldMap_
Tpetra::CrsMatrix< RealType, LO, GO, NodeT > CrsMatrixType
Tpetra::Import< LO, GO, NodeT > ImportType
ScatterResidual_BlockedTpetra()
std::string globalDataKey_
std::vector< PHX::MDField< const ScalarT, Cell, NODE > > scatterFields_
Fields that need to be scattered will be put in this vector.
TRAITS::RealType RealType
Teuchos::RCP< const BlockedTpetraLinearObjContainer< RealType, LO, GO, NodeT > > blockedContainer_
panzer::Traits::Residual::ScalarT ScalarT
std::vector< int > productVectorBlockIndex_
Tpetra::Map< LO, GO, NodeT > MapType
PHX::View< LO ** > worksetLIDs_
Local indices for unknowns.
BlockedTpetraLinearObjContainer< RealType, LO, GO, NodeT > ContainerType
Tpetra::CrsGraph< LO, GO, NodeT > CrsGraphType
Tpetra::Vector< RealType, LO, GO, NodeT > VectorType
ScatterResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer)
ScatterResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer, const std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > &, const Teuchos::ParameterList &p)
std::vector< int > productVectorBlockIndex_
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Teuchos::RCP< const BlockedDOFManager > globalIndexer_
Maps the local (field,element,basis) triplet to a global ID for scattering.
Tpetra::Export< LO, GO, NodeT > ExportType
Tpetra::Import< LO, GO, NodeT > ImportType
std::vector< PHX::View< int * > > fieldOffsets_
Offset into the cell lids for each field.
ScatterResidual_BlockedTpetra()
Tpetra::Map< LO, GO, NodeT > MapType
Teuchos::RCP< const std::map< std::string, std::string > > fieldMap_
PHX::ViewOfViews< 2, Kokkos::View< RealType **, Kokkos::LayoutLeft, PHX::Device > > dfdpFieldsVoV_
Storage for the tangent data.
Teuchos::RCP< PHX::FieldTag > scatterHolder_
Dummy evalauted field so that the evaluator will have something to do.
std::vector< int > fieldIds_
Field IDs in the local product vector block (not global field id)
std::vector< std::vector< Teuchos::RCP< VectorType > > > dfdpVectors_
panzer::Traits::Tangent::ScalarT ScalarT
std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > fieldGlobalIndexers_
Vector of global indexers, one for each scattered field respectively.
Tpetra::CrsGraph< LO, GO, NodeT > CrsGraphType
TRAITS::RealType RealType
Tpetra::Vector< RealType, LO, GO, NodeT > VectorType
std::vector< PHX::MDField< const ScalarT, Cell, NODE > > scatterFields_
Fields that need to be scattered will be put in this vector.
std::string globalDataKey_
Tpetra::CrsMatrix< RealType, LO, GO, NodeT > CrsMatrixType
PHX::View< LO ** > worksetLIDs_
Local indices for unknowns.
ScatterResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer, const std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > &)
Teuchos::RCP< const BlockedTpetraLinearObjContainer< RealType, LO, GO, NodeT > > blockedContainer_
BlockedTpetraLinearObjContainer< RealType, LO, GO, NodeT > ContainerType
Pushes residual values into the residual vector for a Newton-based solve.
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
void postRegistrationSetup(typename TRAITS::SetupData, PHX::FieldManager< TRAITS > &)
void evaluateFields(typename TRAITS::EvalData)
ScatterResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &)
Evaluation type for computing the residual and its Jacobian, using FadType as the scalar type.
Evaluation type for computing the residual only, using RealType as the scalar type.
Evaluation type for computing directional derivatives (e.g. parameter sensitivities),...