11#ifndef PANZER_EVALUATOR_SCATTER_DIRICHLET_RESIDUAL_BLOCKEDTPETRA_HPP
12#define PANZER_EVALUATOR_SCATTER_DIRICHLET_RESIDUAL_BLOCKEDTPETRA_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"
31 template <
typename ScalarT>
class ProductVectorBase;
36class BlockedDOFManager;
47template <
typename EvalT,
typename TRAITS,
typename LO,
typename GO,
typename NodeT=panzer::TpetraNodeType>
50 public PHX::EvaluatorDerived<panzer::Traits::Residual, TRAITS>,
58 const Teuchos::ParameterList& p);
60 virtual Teuchos::RCP<CloneableEvaluator>
clone(
const Teuchos::ParameterList & pl)
const
66 { std::cout <<
"unspecialized version of \"ScatterDirichletResidual_BlockedTpetra::evaluateFields\" on \""+PHX::print<EvalT>()+
"\" should not be used!" << std::endl;
67 TEUCHOS_ASSERT(
false); }
80template <
typename TRAITS,
typename LO,
typename GO,
typename NodeT>
83 public PHX::EvaluatorDerived<panzer::Traits::Residual, TRAITS>,
88 : globalIndexer_(indexer) {}
93 const std::vector<Teuchos::RCP<const panzer::GlobalIndexer> > & )
94 : globalIndexer_(indexer) {}
97 const Teuchos::ParameterList& p);
100 const std::vector<Teuchos::RCP<const panzer::GlobalIndexer> > & ,
101 const Teuchos::ParameterList& p)
107 void preEvaluate(
typename TRAITS::PreEvalData d);
111 virtual Teuchos::RCP<CloneableEvaluator>
clone(
const Teuchos::ParameterList & pl)
const
152 Teuchos::RCP<const std::map<std::string,std::string> >
fieldMap_;
179 std::vector< PHX::MDField<const bool,Cell,NODE> >
applyBC_;
187template <
typename TRAITS,
typename LO,
typename GO,
typename NodeT>
190 public PHX::EvaluatorDerived<panzer::Traits::Jacobian, TRAITS>,
195 : globalIndexer_(indexer) {}
201 const std::vector<Teuchos::RCP<const panzer::GlobalIndexer> > & colIndexers)
202 : globalIndexer_(indexer), colGlobalIndexers_(colIndexers), hasColIndexers_(true) {}
205 const Teuchos::ParameterList& p);
208 const std::vector<Teuchos::RCP<const panzer::GlobalIndexer> > & colIndexers,
209 const Teuchos::ParameterList& p);
211 void preEvaluate(
typename TRAITS::PreEvalData d);
218 virtual Teuchos::RCP<CloneableEvaluator>
clone(
const Teuchos::ParameterList & pl)
const
252 Teuchos::RCP<const std::map<std::string,std::string> >
fieldMap_;
281 bool hasColIndexers_ =
false;
288 using LocalMatrixType = KokkosSparse::CrsMatrix<double,LO,PHX::Device,Kokkos::MemoryTraits<Kokkos::Unmanaged>,
size_t>;
308 std::vector< PHX::MDField<const bool,Cell,NODE> >
applyBC_;
311 static constexpr int maxDerivativeArraySize_ = 256;
319template <
typename TRAITS,
typename LO,
typename GO,
typename NodeT>
322 public PHX::EvaluatorDerived<panzer::Traits::Tangent, TRAITS>,
327 : globalIndexer_(indexer) {}
332 const std::vector<Teuchos::RCP<const panzer::GlobalIndexer> > & )
333 : globalIndexer_(indexer) {}
336 const Teuchos::ParameterList& p);
339 const std::vector<Teuchos::RCP<const panzer::GlobalIndexer> > & ,
340 const Teuchos::ParameterList& p)
346 void preEvaluate(
typename TRAITS::PreEvalData d);
350 virtual Teuchos::RCP<CloneableEvaluator>
clone(
const Teuchos::ParameterList & pl)
const
391 Teuchos::RCP<const std::map<std::string,std::string> >
fieldMap_;
418 std::vector< PHX::MDField<const bool,Cell,NODE> >
applyBC_;
421 PHX::ViewOfViews<2,Kokkos::View<RealType**,Kokkos::LayoutLeft,PHX::Device>>
dfdpFieldsVoV_;
434#ifdef Panzer_BUILD_HESSIAN_SUPPORT
Non-templated empty base class for template managers.
Wrapper to PHX::EvaluatorWithBaseImpl that implements Panzer-specific helpers.
PHX::View< LO * > colBlockOffsets_
ScatterDirichletResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer)
std::vector< PHX::MDField< const ScalarT, Cell, NODE > > scatterFields_
std::vector< int > productVectorBlockIndex_
PHX::View< LocalMatrixType ** >::host_mirror_type hostJacTpetraBlocks_
PHX::View< LO ** > colWorksetLIDs_
Column LIDs and derivative offsets. Aliases of the row members when square.
PHX::View< int ** > blockExistsInJac_
panzer::Traits::Jacobian::ScalarT ScalarT
std::vector< PHX::MDField< const bool, Cell, NODE > > applyBC_
std::string globalDataKey_
Tpetra::CrsMatrix< RealType, LO, GO, NodeT > CrsMatrixType
std::size_t side_subcell_dim_
PHX::View< int ** >::host_mirror_type hostBlockExistsInJac_
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
PHX::View< LO * >::host_mirror_type colBlockOffsets_h_
PHX::View< LO * > blockOffsets_
The offset values of the blocked DOFs per element. Size of number of blocks in the product vector + 1...
TRAITS::RealType RealType
std::vector< PHX::View< int * > > basisIndexForMDFieldOffsets_
BlockedTpetraLinearObjContainer< RealType, LO, GO, NodeT > ContainerType
Tpetra::Operator< RealType, LO, GO, NodeT > OperatorType
PHX::View< LocalMatrixType ** > jacTpetraBlocks_
bool checkApplyBC_
If set to true, allows runtime disabling of dirichlet BCs on node-by-node basis.
std::vector< PHX::View< int * > > fieldOffsets_
Offset into the cell lids for each field. Size of number of fields to scatter.
Teuchos::RCP< Thyra::ProductVectorBase< double > > dirichletCounter_
std::size_t local_side_id_
std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > colGlobalIndexers_
Teuchos::RCP< const BlockedTpetraLinearObjContainer< RealType, LO, GO, NodeT > > blockedContainer_
Teuchos::RCP< const panzer::BlockedDOFManager > globalIndexer_
Thyra::TpetraLinearOp< RealType, LO, GO, NodeT > ThyraLinearOp
PHX::View< LO * >::host_mirror_type blockOffsets_h_
Host copies of the offsets, filled once since the offsets never change.
std::vector< int > fieldIds_
Teuchos::RCP< const std::map< std::string, std::string > > fieldMap_
ScatterDirichletResidual_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< PHX::FieldTag > scatterHolder_
Tpetra::Map< LO, GO, NodeT > MapType
KokkosSparse::CrsMatrix< double, LO, PHX::Device, Kokkos::MemoryTraits< Kokkos::Unmanaged >, size_t > LocalMatrixType
Sub-block matrix type handed to the scatter kernel.
PHX::View< LO ** > worksetLIDs_
Local indices for unknowns.
ScatterDirichletResidual_BlockedTpetra()
Tpetra::Export< LO, GO, NodeT > ExportType
std::size_t side_subcell_dim_
std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > fieldGlobalIndexers_
Tpetra::Vector< RealType, LO, GO, NodeT > VectorType
std::vector< int > productVectorBlockIndex_
Teuchos::RCP< Thyra::ProductVectorBase< double > > dirichletCounter_
std::vector< PHX::View< int * > > fieldOffsets_
Offset into the cell lids for each field.
ScatterDirichletResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer, const std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > &)
Tpetra::CrsMatrix< RealType, LO, GO, NodeT > CrsMatrixType
BlockedTpetraLinearObjContainer< RealType, LO, GO, NodeT > ContainerType
Teuchos::RCP< const std::map< std::string, std::string > > fieldMap_
Tpetra::Map< LO, GO, NodeT > MapType
panzer::Traits::Residual::ScalarT ScalarT
bool checkApplyBC_
If set to true, allows runtime disabling of dirichlet BCs on node-by-node basis.
ScatterDirichletResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer, const std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > &, const Teuchos::ParameterList &p)
TRAITS::RealType RealType
Teuchos::RCP< const BlockedTpetraLinearObjContainer< RealType, LO, GO, NodeT > > blockedContainer_
std::vector< PHX::MDField< const bool, Cell, NODE > > applyBC_
ScatterDirichletResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer)
Tpetra::CrsGraph< LO, GO, NodeT > CrsGraphType
std::size_t local_side_id_
Teuchos::RCP< PHX::FieldTag > scatterHolder_
std::vector< PHX::MDField< const ScalarT, Cell, NODE > > scatterFields_
Tpetra::Import< LO, GO, NodeT > ImportType
std::vector< int > fieldIds_
Field IDs in the local product vector block (not global field id)
std::vector< PHX::View< int * > > basisIndexForMDFieldOffsets_
PHX::View< LO ** > worksetLIDs_
Local indices for unknowns.
ScatterDirichletResidual_BlockedTpetra()
std::string globalDataKey_
Teuchos::RCP< const panzer::BlockedDOFManager > globalIndexer_
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Tpetra::Map< LO, GO, NodeT > MapType
std::size_t local_side_id_
ScatterDirichletResidual_BlockedTpetra()
std::size_t side_subcell_dim_
Tpetra::CrsGraph< LO, GO, NodeT > CrsGraphType
Teuchos::RCP< const BlockedTpetraLinearObjContainer< RealType, LO, GO, NodeT > > blockedContainer_
Tpetra::CrsMatrix< RealType, LO, GO, NodeT > CrsMatrixType
Teuchos::RCP< PHX::FieldTag > scatterHolder_
std::vector< std::vector< Teuchos::RCP< VectorType > > > dfdpVectors_
BlockedTpetraLinearObjContainer< RealType, LO, GO, NodeT > ContainerType
std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > fieldGlobalIndexers_
Tpetra::Export< LO, GO, NodeT > ExportType
PHX::View< LO ** > worksetLIDs_
Local indices for unknowns.
panzer::Traits::Tangent::ScalarT ScalarT
Teuchos::RCP< const std::map< std::string, std::string > > fieldMap_
Teuchos::RCP< Thyra::ProductVectorBase< double > > dirichletCounter_
TRAITS::RealType RealType
std::vector< int > fieldIds_
Field IDs in the local product vector block (not global field id)
ScatterDirichletResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer)
Teuchos::RCP< const panzer::BlockedDOFManager > globalIndexer_
Tpetra::Vector< RealType, LO, GO, NodeT > VectorType
std::vector< PHX::View< int * > > fieldOffsets_
Offset into the cell lids for each field.
Tpetra::Import< LO, GO, NodeT > ImportType
ScatterDirichletResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer, const std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > &)
ScatterDirichletResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &indexer, const std::vector< Teuchos::RCP< const panzer::GlobalIndexer > > &, const Teuchos::ParameterList &p)
bool checkApplyBC_
If set to true, allows runtime disabling of dirichlet BCs on node-by-node basis.
std::string globalDataKey_
std::vector< PHX::View< int * > > basisIndexForMDFieldOffsets_
std::vector< PHX::MDField< const ScalarT, Cell, NODE > > scatterFields_
PHX::ViewOfViews< 2, Kokkos::View< RealType **, Kokkos::LayoutLeft, PHX::Device > > dfdpFieldsVoV_
std::vector< PHX::MDField< const bool, Cell, NODE > > applyBC_
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
std::vector< int > productVectorBlockIndex_
Pushes residual values into the residual vector for a Newton-based solve.
void evaluateFields(typename TRAITS::EvalData)
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
ScatterDirichletResidual_BlockedTpetra(const Teuchos::RCP< const BlockedDOFManager > &)
void postRegistrationSetup(typename TRAITS::SetupData, PHX::FieldManager< TRAITS > &)
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),...