Panzer Version of the Day
Loading...
Searching...
No Matches
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"
18#include "Teuchos_ParameterList.hpp"
19
20#include "Teko_RequestCallback.hpp"
21
24
25#include <vector>
26#include <map>
27
28namespace panzer_stk {
29
30class STKConnManager;
31
36class ParameterListCallback : public Teko::RequestCallback<Teuchos::RCP<Teuchos::ParameterList> > {
37public:
45 ParameterListCallback(const std::string & coordFieldName,
46 const std::map<std::string,Teuchos::RCP<const panzer::Intrepid2FieldPattern> > & fp,
47 const Teuchos::RCP<const panzer_stk::STKConnManager> & connManager,
48 const Teuchos::RCP<const panzer::GlobalIndexer> & ugi);
49
51 Teuchos::RCP<Teuchos::ParameterList> request(const Teko::RequestMesg & rm);
52
54 bool handlesRequest(const Teko::RequestMesg & rm);
55
57 void preRequest(const Teko::RequestMesg & rm);
58
60 const std::vector<double> & getCoordsVector(unsigned dim) const
61 { switch(dim) {
62 case 0:
63 return getXCoordsVector();
64 case 1:
65 return getYCoordsVector();
66 case 2:
67 return getZCoordsVector();
68 default:
69 TEUCHOS_ASSERT(false);
70 }
71 TEUCHOS_ASSERT(false);
72 return xcoords_; // should never get here!
73 }
75 const std::vector<double> & getXCoordsVector() const { return xcoords_; }
77 const std::vector<double> & getYCoordsVector() const { return ycoords_; }
79 const std::vector<double> & getZCoordsVector() const { return zcoords_; }
80
82 Teuchos::RCP<const panzer::ArrayToFieldVector> getArrayToFieldVector() const
83 { return arrayToVector_; }
84
86 void buildCoordinates();
88 void buildArrayToVector();
89
91 void storeExtraVector(const Teuchos::RCP<const std::vector<double> > & extra)
92 { extraVecs_.push_back(extra); }
93
94private:
95
96 void setFieldByKey(const std::string & key,Teuchos::ParameterList & pl) const;
97
98 std::string coordFieldName_;
99 std::map<std::string,Teuchos::RCP<const panzer::Intrepid2FieldPattern> > fieldPatterns_;
100 Teuchos::RCP<const panzer_stk::STKConnManager> connManager_;
101 Teuchos::RCP<const panzer::GlobalIndexer> ugi_;
102 bool coordinatesBuilt_;
103
104 std::vector<double> xcoords_;
105 std::vector<double> ycoords_;
106 std::vector<double> zcoords_;
107
108 mutable Teuchos::RCP<const panzer::ArrayToFieldVector> arrayToVector_;
109 std::vector<Teuchos::RCP<const std::vector<double> > > extraVecs_;
110};
111
112}
113
114#endif // PANZER_HAVE_TEKO
115
116#endif