Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_STK_GatherRefCoords_impl.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_STK_GatherRefCoords_impl_hpp__
12 #define __PANZER_STK_GatherRefCoords_impl_hpp__
13 
14 #include "Teuchos_Assert.hpp"
15 #include "Phalanx_DataLayout.hpp"
16 
17 #include "Panzer_BasisIRLayout.hpp"
18 
19 #include "Teuchos_FancyOStream.hpp"
20 
21 // **********************************************************************
22 // Specialization: Residual
23 // **********************************************************************
24 
25 template<typename EvalT, typename Traits>
28  const panzer::BasisIRLayout & basis,
29  const std::string & fieldName)
30 {
31  using panzer::Cell;
32  using panzer::NODE;
33 
34  mesh_ = mesh;
35 
37  this->addEvaluatedField(coordField_);
38 
39  this->setName("Gather STK Fields");
40 }
41 
42 // **********************************************************************
43 template<typename EvalT, typename Traits>
45 evaluateFields(typename Traits::EvalData workset)
46 {
47  const std::vector<stk::mesh::Entity> & localElements = *mesh_->getElementsOrderedByLID();
48 
49  // for convenience pull out some objects from workset
50  const std::vector<std::size_t> & localCellIds = this->wda(workset).cell_local_ids;
51 
52  // convert to a vector of entity objects
53  std::vector<stk::mesh::Entity> selected_elements;
54  for(std::size_t cell=0;cell<localCellIds.size();cell++)
55  selected_elements.push_back(localElements[localCellIds[cell]]);
56 
57  auto coordField = coordField_.get_view();
58  mesh_->getElementVertices_FromCoordsNoResize(selected_elements,coordField);
59 }
60 
61 #endif
void evaluateFields(typename Traits::EvalData d)
Teuchos::RCP< PHX::DataLayout > functional_grad
&lt;Cell,Basis,Dim&gt;