Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_CoordinatesEvaluator_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_COORDINATESEVALUTOR_IMPL_HPP
12 #define PANZER_COORDINATESEVALUTOR_IMPL_HPP
13 
14 namespace panzer {
15 
16 //**********************************************************************
17 template<typename EvalT, typename Traits>
20  const Teuchos::ParameterList& p) :
21  dimension(p.get<int>("Dimension")),
22  coordinate( p.get<std::string>("Field Name"),
23  p.get< Teuchos::RCP<PHX::DataLayout> >("Data Layout") )
24 {
25  this->addEvaluatedField(coordinate);
26 
27  std::string n = "CoordinatesEvaluator: " + coordinate.fieldTag().name();
28  this->setName(n);
29 }
30 
31 //**********************************************************************
32 template<typename EvalT, typename Traits>
33 void
36  typename Traits::SetupData /* worksets */,
38 {
39  this->utils.setFieldData(coordinate,fm);
40 }
41 
42 //**********************************************************************
43 template<typename EvalT, typename Traits>
44 void
47  typename Traits::EvalData d)
48 {
49  auto coords = this->wda(d).cell_node_coordinates.get_static_view();
50  auto coordinate_v = coordinate.get_static_view();
51  auto l_dimension = dimension;
52 
53  // copy coordinates directly into the field
54  Kokkos::parallel_for(d.num_cells, KOKKOS_LAMBDA (int i) {
55  for(int j=0;j<coords.extent_int(1);j++)
56  coordinate_v(i,j) = coords(i,j,l_dimension);
57  });
58  Kokkos::fence();
59 }
60 
61 //**********************************************************************
62 
63 }
64 
65 #endif
CoordinatesEvaluator(const Teuchos::ParameterList &p)
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)
int num_cells
DEPRECATED - use: numCells()
void evaluateFields(typename Traits::EvalData d)
PHX::MDField< ScalarT, Cell, BASIS > coordinate