43 #ifndef PANZER_STK_SCATTER_VECTOR_FIELDS_IMPL_HPP
44 #define PANZER_STK_SCATTER_VECTOR_FIELDS_IMPL_HPP
46 #include "Teuchos_Assert.hpp"
48 #include "Phalanx_config.hpp"
49 #include "Phalanx_Evaluator_Macros.hpp"
50 #include "Phalanx_MDField.hpp"
51 #include "Phalanx_DataLayout.hpp"
52 #include "Phalanx_DataLayout_MDALayout.hpp"
57 #include "Teuchos_FancyOStream.hpp"
59 namespace panzer_stk {
61 template<
typename EvalT,
typename Traits>
70 template <
typename EvalT,
typename TraitsT>
75 const std::vector<std::string> & names,
76 const std::vector<double> & scaling)
92 for (std::size_t fd = 0; fd < names.size(); ++fd) {
99 PHX::Tag<ScalarT> scatterHolder(scatterName,
Teuchos::rcp(
new PHX::MDALayout<panzer::Dummy>(0)));
100 this->addEvaluatedField(scatterHolder);
102 this->setName(scatterName+
": STK-Scatter Vector Fields");
105 template<
typename EvalT,
typename Traits>
109 typename Traits::EvalData )
120 std::vector<std::string> dimStrings(3);
126 const std::vector<std::size_t> & localCellIds = this->wda(workset).cell_local_ids;
127 std::string blockId = this->wda(workset).block_id;
129 for(
int d=0;d<spatialDimension_;d++) {
130 for(std::size_t fieldIndex=0; fieldIndex<scatterFields_.size();fieldIndex++) {
131 PHX::MDField<const ScalarT,panzer::Cell,panzer::IP,panzer::Dim> &
field = scatterFields_[fieldIndex];
132 std::string fieldName = names_[fieldIndex]+dimStrings[d];
134 PHX::MDField<double,panzer::Cell,panzer::NODE> cellValue
138 double scaling = (scaling_.size()>0) ? scaling_[fieldIndex] : 1.0;
140 for(
unsigned i=0; i<field.extent(0);i++)
141 cellValue(i,0) =
field(i,0,d);
144 mesh_->setCellFieldData(fieldName,blockId,localCellIds,cellValue,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)
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)