Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_EvaluatorsRegistrar.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_EVALUATORS_REGISTRAR_HPP
12#define PANZER_EVALUATORS_REGISTRAR_HPP
13
14#include "Phalanx_FieldManager.hpp"
15
17
18namespace panzer {
19
26public:
31 int setDetailsIndex(const int details_index) {
32 int old_di = details_index_;
33 details_index_ = details_index;
34 return old_di;
35 }
37 int getDetailsIndex() const { return details_index_; }
38
39protected:
43
46 template <typename EvalT>
48 const Teuchos::RCP< PHX::Evaluator<panzer::Traits> >& op) const;
49
50private:
52};
53
54template<typename EvalT>
57 const Teuchos::RCP< PHX::Evaluator<panzer::Traits> >& op) const
58{
59 Teuchos::RCP< panzer::EvaluatorWithBaseImpl<panzer::Traits> >
60 pop = Teuchos::rcp_dynamic_cast< panzer::EvaluatorWithBaseImpl<panzer::Traits> >(op);
61 // Temporarily allow casting failure so that Charon continues to work.
62#if 0
63 TEUCHOS_TEST_FOR_EXCEPTION(pop.is_null(), std::runtime_error,
64 op->getName() + " does not inherit from panzer::EvaluatorWithBaseImpl.");
65 pop->setDetailsIndex(details_index_);
66#else
67 if (Teuchos::nonnull(pop))
68 pop->setDetailsIndex(details_index_);
69#endif
70 fm.template registerEvaluator<EvalT>(op);
71}
72
73}
74
75#endif
int getDetailsIndex() const
Get the WorksetDetails index.
void registerEvaluator(PHX::FieldManager< panzer::Traits > &fm, const Teuchos::RCP< PHX::Evaluator< panzer::Traits > > &op) const
int setDetailsIndex(const int details_index)
EvaluatorsRegistrar()
Default ctor initializes WorksetDetails index to 0.