11 #ifndef PANZER_STK_SCATTER_VECTOR_FIELDS_IMPL_HPP
12 #define PANZER_STK_SCATTER_VECTOR_FIELDS_IMPL_HPP
14 #include "Teuchos_Assert.hpp"
16 #include "Phalanx_config.hpp"
17 #include "Phalanx_Evaluator_Macros.hpp"
18 #include "Phalanx_MDField.hpp"
19 #include "Phalanx_DataLayout.hpp"
20 #include "Phalanx_DataLayout_MDALayout.hpp"
25 #include "Teuchos_FancyOStream.hpp"
27 namespace panzer_stk {
29 template<
typename EvalT,
typename Traits>
38 template <
typename EvalT,
typename TraitsT>
43 const std::vector<std::string> & names,
44 const std::vector<double> & scaling)
60 for (std::size_t fd = 0; fd < names.size(); ++fd) {
68 this->addEvaluatedField(scatterHolder);
70 this->setName(scatterName+
": STK-Scatter Vector Fields");
73 template<
typename EvalT,
typename Traits>
77 typename Traits::EvalData )
88 std::vector<std::string> dimStrings(3);
94 const std::vector<std::size_t> & localCellIds = this->wda(workset).cell_local_ids;
95 std::string blockId = this->wda(workset).block_id;
97 for(
int d=0;d<spatialDimension_;d++) {
98 for(std::size_t fieldIndex=0; fieldIndex<scatterFields_.size();fieldIndex++) {
100 std::string fieldName = names_[fieldIndex]+dimStrings[d];
106 double scaling = (scaling_.size()>0) ? scaling_[fieldIndex] : 1.0;
110 Kokkos::parallel_for(field_v.extent(0), KOKKOS_LAMBDA (
int i) {
111 cellValue_v(i,0) = field_v(i,0,d);
116 mesh_->setCellFieldData(fieldName,blockId,localCellIds,cellValue.get_view(),scaling);
PHX::MDField< Scalar, T0 > buildStaticArray(const std::string &str, int d0) const
const std::string & getName() const
std::vector< std::string > names_
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
KOKKOS_FORCEINLINE_FUNCTION array_type get_static_view()
Teuchos::RCP< PHX::DataLayout > dl_vector
Data layout for vector fields.
PHX::MDField< ScalarT, panzer::Cell, panzer::BASIS > field
A field to which we'll contribute, or in which we'll store, the result of computing this integral...
std::vector< PHX::MDField< const ScalarT, panzer::Cell, panzer::IP, panzer::Dim > > scatterFields_
#define TEUCHOS_ASSERT(assertion_test)
ScatterVectorFields(const Teuchos::ParameterList &p)
void evaluateFields(typename Traits::EvalData d)