Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_STK_ParameterListCallback.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_ParameterListCallback_hpp__
12 #define __Panzer_STK_ParameterListCallback_hpp__
13 
14 #include "PanzerAdaptersSTK_config.hpp"
15 #ifdef PANZER_HAVE_TEKO
16 
17 #include "Teuchos_RCP.hpp"
19 
20 #include "Teko_RequestCallback.hpp"
21 
24 
25 #include <vector>
26 #include <map>
27 
28 namespace panzer_stk {
29 
30 class STKConnManager;
31 
36 class ParameterListCallback : public Teko::RequestCallback<Teuchos::RCP<Teuchos::ParameterList> > {
37 public:
38  ParameterListCallback(const std::string & coordFieldName,
39  const std::map<std::string,Teuchos::RCP<const panzer::Intrepid2FieldPattern> > & fp,
42 
43  Teuchos::RCP<Teuchos::ParameterList> request(const Teko::RequestMesg & rm);
44 
45  bool handlesRequest(const Teko::RequestMesg & rm);
46 
47  void preRequest(const Teko::RequestMesg & rm);
48 
49  const std::vector<double> & getCoordsVector(unsigned dim) const
50  { switch(dim) {
51  case 0:
52  return getXCoordsVector();
53  case 1:
54  return getYCoordsVector();
55  case 2:
56  return getZCoordsVector();
57  default:
58  TEUCHOS_ASSERT(false);
59  }
60  TEUCHOS_ASSERT(false);
61  return xcoords_; // should never get here!
62  }
63  const std::vector<double> & getXCoordsVector() const { return xcoords_; }
64  const std::vector<double> & getYCoordsVector() const { return ycoords_; }
65  const std::vector<double> & getZCoordsVector() const { return zcoords_; }
66 
68  Teuchos::RCP<const panzer::ArrayToFieldVector> getArrayToFieldVector() const
69  { return arrayToVector_; }
70 
71  void buildCoordinates();
72  void buildArrayToVector();
73 
75  void storeExtraVector(const Teuchos::RCP<const std::vector<double> > & extra)
76  { extraVecs_.push_back(extra); }
77 
78 private:
79 
80  void setFieldByKey(const std::string & key,Teuchos::ParameterList & pl) const;
81 
82  std::string coordFieldName_;
83  std::map<std::string,Teuchos::RCP<const panzer::Intrepid2FieldPattern> > fieldPatterns_;
86  bool coordinatesBuilt_;
87 
88  std::vector<double> xcoords_;
89  std::vector<double> ycoords_;
90  std::vector<double> zcoords_;
91 
93  std::vector<Teuchos::RCP<const std::vector<double> > > extraVecs_;
94 };
95 
96 }
97 
98 #endif // PANZER_HAVE_TEKO
99 
100 #endif
#define TEUCHOS_ASSERT(assertion_test)