11 #ifndef PANZER_CONSTANT_FLUX_IMPL_HPP
12 #define PANZER_CONSTANT_FLUX_IMPL_HPP
17 template<
typename EvalT,
typename Traits>
21 flux( p.get<std::string>(
"Flux Field Name"),
22 p.get< Teuchos::
RCP<PHX::DataLayout> >(
"Data Layout") )
27 values.push_back(Teuchos::getValue<double>(i->second));
29 this->addEvaluatedField(
flux);
31 std::string n =
"ConstantFlux: " +
flux.fieldTag().name();
36 template<
typename EvalT,
typename Traits>
44 this->utils.setFieldData(flux,fm);
46 TEUCHOS_ASSERT(static_cast<std::size_t>(flux.extent(2)) == values.size());
48 auto flux_v = flux.get_static_view();
50 for (
int dim = 0; dim < flux_v.extent_int(2); ++dim) {
51 auto val = values[dim];
52 Kokkos::parallel_for (
"ConstantFlux", flux.extent_int(0), KOKKOS_LAMBDA(
const int cell) {
53 for (
int ip = 0; ip < flux_v.extent_int(1); ++ip)
54 flux_v(cell,ip,dim) = val;
61 template<
typename EvalT,
typename Traits>
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)
std::vector< ScalarT > values
ConstIterator end() const
ConstantFlux(const Teuchos::ParameterList &p)
params_t::ConstIterator ConstIterator
ConstIterator begin() const
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
#define TEUCHOS_ASSERT(assertion_test)
PHX::MDField< ScalarT > flux
void evaluateFields(typename Traits::EvalData d)