Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_AssemblyEngine_InArgs.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_ASSEMBLY_ENGINE_INARGS_HPP
12 #define PANZER_ASSEMBLY_ENGINE_INARGS_HPP
13 
14 #include "Teuchos_RCP.hpp"
15 #include "Teuchos_ScalarTraits.hpp"
16 
18 
19 class Epetra_Vector;
20 class Epetra_CrsMatrix;
21 class Epetra_Map;
22 
23 namespace panzer {
24 
25  class LinearObjContainer;
26 
28  public:
29 
32  : ghostedContainer_(ghostedContainer), container_(container)
33  , alpha(Teuchos::ScalarTraits<double>::nan()) // also setup some painful and
34  , beta(Teuchos::ScalarTraits<double>::nan()) // hopefully loud initial values
35  , time(Teuchos::ScalarTraits<double>::nan())
36  , step_size(Teuchos::ScalarTraits<double>::nan())
37  , stage_number(Teuchos::ScalarTraits<double>::one())
41  , apply_dirichlet_beta(false)
42  , dirichlet_beta(0.0)
43  { }
44 
46  : ghostedContainer_(Teuchos::null), container_(Teuchos::null)
47  , alpha(Teuchos::ScalarTraits<double>::nan()) // also setup some painful and
48  , beta(Teuchos::ScalarTraits<double>::nan()) // hopefully loud initial values
49  , time(Teuchos::ScalarTraits<double>::nan())
50  , step_size(Teuchos::ScalarTraits<double>::nan())
51  , stage_number(Teuchos::ScalarTraits<double>::one())
55  , apply_dirichlet_beta(false)
56  , dirichlet_beta(0.0)
57  { }
58 
61 
62  double alpha;
63  double beta;
64  double time;
65  double step_size;
66  double stage_number;
67  std::vector<double> gather_seeds; // generic gather seeds
71 
74 
81  void addGlobalEvaluationData(const std::string & key,const Teuchos::RCP<GlobalEvaluationData> & ged)
82  {
83  TEUCHOS_TEST_FOR_EXCEPTION(ged_map.find(key)!=ged_map.end(),std::logic_error,
84  "AssemblyEngine::addGlobalEvaluationData: Method cannot over write existing "
85  "data object with key \"" + key + "\"");
86 
87  ged_map[key] = ged;
88  }
89 
91  {
92  ged_map.insert(gedc.begin(),gedc.end());
93  }
94 
97  {
98  std::map<std::string,Teuchos::RCP<GlobalEvaluationData> >::const_iterator itr;
99  for(itr=ged_map.begin();itr!=ged_map.end();++itr)
100  gedc.addDataObject(itr->first,itr->second);
101  }
102 
103  const std::map<std::string,Teuchos::RCP<GlobalEvaluationData> > &
105  { return ged_map; }
106 
107  private:
108  std::map<std::string,Teuchos::RCP<GlobalEvaluationData> > ged_map;
109  };
110 
111 
115  inline std::ostream & operator<<(std::ostream & os,const AssemblyEngineInArgs & in)
116  {
117  os << "AE Inargs:\n"
118  << " alpha = " << in.alpha << "\n"
119  << " beta = " << in.beta << "\n"
120  << " time = " << in.time << "\n"
121  << " step_size = " << in.step_size << "\n"
122  << " stage_number = " << in.stage_number << "\n"
123  << " eval_tran = " << in.evaluate_transient_terms << "\n"
124  << " 1st sens_name = " << in.first_sensitivities_name << "\n"
125  << " 2nd sens_name = " << in.second_sensitivities_name << "\n"
126  << " apply_db = " << in.apply_dirichlet_beta << "\n"
127  << " db = " << in.dirichlet_beta << "\n"
128  << " seeds = ";
129  for(std::size_t i=0;i<in.gather_seeds.size();i++)
130  os << in.gather_seeds[i] << " ";
131  os << "\n";
132 
133  const std::map<std::string,Teuchos::RCP<GlobalEvaluationData> > & ged_map
135  os << " ged_map = ";
136  for(std::map<std::string,Teuchos::RCP<GlobalEvaluationData> >::const_iterator itr=ged_map.begin();
137  itr!=ged_map.end();++itr) {
138  os << " \"" << itr->first << "\": ";
139  itr->second->print(os);
140  os << "\n";
141  }
142  os << std::endl;
143 
144  return os;
145  }
146 
147 }
148 
149 #endif
void addDataObject(const std::string &key, const Teuchos::RCP< GlobalEvaluationData > &ged)
const std::map< std::string, Teuchos::RCP< GlobalEvaluationData > > & getGlobalEvaluationDataMap() const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< panzer::LinearObjContainer > ghostedContainer_
Teuchos::RCP< panzer::LinearObjContainer > container_
void addGlobalEvaluationData(const std::string &key, const Teuchos::RCP< GlobalEvaluationData > &ged)
void addGlobalEvaluationData(const GlobalEvaluationDataContainer &gedc)
void fillGlobalEvaluationDataContainer(GlobalEvaluationDataContainer &gedc) const
Using internal map fill the global evaluation data container object.
AssemblyEngineInArgs(const Teuchos::RCP< panzer::LinearObjContainer > &ghostedContainer, const Teuchos::RCP< panzer::LinearObjContainer > &container)
std::ostream & operator<<(std::ostream &os, const AssemblyEngineInArgs &in)
std::map< std::string, Teuchos::RCP< GlobalEvaluationData > > ged_map