Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_Copy_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_COPY_IMPL_HPP
12 #define PANZER_COPY_IMPL_HPP
13 
14 #include <cstddef>
15 #include <string>
16 #include <vector>
17 
18 namespace panzer {
19 
20 //**********************************************************************
21 template<typename EvalT, typename Traits>
24  const Teuchos::ParameterList& p)
25 {
26  std::string input_name = p.get<std::string>("Source Name");
27  std::string output_name = p.get<std::string>("Destination Name");
28  Teuchos::RCP<PHX::DataLayout> data_layout = p.get< Teuchos::RCP<PHX::DataLayout> >("Data Layout");
29 
30  input = PHX::MDField<const ScalarT>(input_name, data_layout);
31  output = PHX::MDField<ScalarT>(output_name, data_layout);
32 
33  this->addDependentField(input);
34  this->addEvaluatedField(output);
35 
36  std::string n = "Copy Evaluator: " + input_name + " => " + output_name;
37  this->setName(n);
38 }
39 
40 //**********************************************************************
41 template<typename EvalT, typename Traits>
42 void
45  typename Traits::SetupData /* worksets */,
46  PHX::FieldManager<Traits>& /* fm */)
47 {
48  TEUCHOS_ASSERT(input.size()==output.size());
49 }
50 
51 //**********************************************************************
52 template<typename EvalT, typename Traits>
53 void
56  typename Traits::EvalData /* workset */)
57 {
58  output.deep_copy(input);
59 }
60 
61 //**********************************************************************
62 
63 }
64 
65 #endif
T & get(const std::string &name, T def_value)
void postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager< Traits > &fm)
#define TEUCHOS_ASSERT(assertion_test)
Copy(const Teuchos::ParameterList &p)
void evaluateFields(typename Traits::EvalData d)