Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_EquationSet_DefaultImpl_decl.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_EQUATION_SET_DEFAULTIMPL_DECL_HPP
12#define PANZER_EQUATION_SET_DEFAULTIMPL_DECL_HPP
13
16#include "Panzer_CellData.hpp"
17
18#include <map>
19
20namespace Teuchos {
21 class ParameterList;
22}
23
24namespace PHX {
25 template<typename Traits> class FieldManager;
26}
27
28namespace panzer {
29
30 template <typename EvalT>
33
34 public:
35
36 EquationSet_DefaultImpl(const Teuchos::RCP<Teuchos::ParameterList>& params,
37 const int& default_integration_order,
38 const panzer::CellData& cell_data,
39 const Teuchos::RCP<panzer::GlobalData>& global_data,
40 const bool build_transient_support);
41
43
45 const panzer::FieldLibrary& fl,
47 const Teuchos::ParameterList& user_data) const;
48
50 const panzer::FieldLibrary& fl,
52 const Teuchos::ParameterList& user_data) const;
53
55 const panzer::FieldLibrary& fl,
56 const Teuchos::ParameterList& user_data) const = 0;
57
60 const Teuchos::RCP<panzer::IntegrationRule>& ir,
61 const Teuchos::Ptr<const panzer::LinearObjFactory<panzer::Traits> > & lof,
62 const Teuchos::ParameterList& user_data) const;
63
66 const Teuchos::RCP<panzer::IntegrationRule>& ir,
68 const Teuchos::ParameterList& models,
69 const Teuchos::ParameterList& user_data) const;
70
73 const Teuchos::RCP<panzer::IntegrationRule>& ir,
75 const std::string & model_name,
76 const Teuchos::ParameterList& models,
77 const Teuchos::ParameterList& user_data) const;
78
80 const panzer::FieldLibrary& fl,
82 const std::string& model_name,
83 const Teuchos::ParameterList& models,
85 const Teuchos::ParameterList& user_data) const;
86
87 virtual const Teuchos::RCP<Teuchos::ParameterList> getEvaluatorParameterList() const;
88
89 virtual const std::vector<std::pair<std::string,Teuchos::RCP<panzer::PureBasis> > > & getProvidedDOFs() const;
90
91 virtual const std::vector<std::vector<std::string> > & getCoordinateDOFs() const;
92
93 virtual const std::map<int,Teuchos::RCP<panzer::IntegrationRule> > & getIntegrationRules() const;
94
95 virtual void setElementBlockId(const std::string & blockId);
96
97 virtual std::string getElementBlockId() const;
98
99 virtual std::string getType() const;
100
102 virtual void setTangentParamNames(const std::vector<std::string>& tangent_param_names);
103
112 void getAddedDOFs(std::vector<std::string> & dofNames) const;
113
128 void updateDOF(const std::string & dofName,
129 int basisOrder,
130 int integrationOrder = -1);
131
137 int getBasisOrder(const std::string & dofName) const;
138
144 int getIntegrationOrder(const std::string & dofName) const;
145
146 protected:
147
149 virtual void setupDOFs();
150
152 bool buildTransientSupport() const;
153
154 // The set of functions below are for use by derived classes to specify the
155 // provided degree of freedom (and associated residual name), in addition
156 // to enabling the, gradient, curl and time derivative for those.
157
179 void addDOF(const std::string & dofName,
180 const std::string & basisType,
181 const int & basisOrder,
182 const int integrationOrder = -1,
183 const std::string residualName = "",
184 const std::string scatterName = "");
185
194 void addDOFGrad(const std::string & dofName,
195 const std::string & gradName = "");
196
205 void addDOFCurl(const std::string & dofName,
206 const std::string & curlName = "");
207
216 void addDOFDiv(const std::string & dofName,
217 const std::string & divName = "");
218
227 void addDOFTimeDerivative(const std::string & dofName,
228 const std::string & dotName = "");
229
237 void setCoordinateDOFs(const std::vector<std::string> & dofNames);
238
244 void addClosureModel(const std::string& closure_model);
245
252 void setDefaultValidParameters(Teuchos::ParameterList& valid_parameters);
253
255 Teuchos::RCP<panzer::PureBasis> getBasisForDOF(const std::string& dof_name) const;
256
258 Teuchos::RCP<panzer::IntegrationRule> getIntRuleForDOF(const std::string& dof_name) const;
259
261 Teuchos::RCP<panzer::BasisIRLayout> getBasisIRLayoutForDOF(const std::string& dof_name) const;
262
277 const std::string dof_name,
278 const std::vector<std::string>& residual_contributions,
279 const std::string residual_field_name = "") const;
280
297 const std::string dof_name,
298 const std::vector<std::string>& residual_contributions,
299 const std::vector<double>& scale_contributions,
300 const std::string residual_field_name = "") const;
301
303 //object. Useful for passing off input parameter sublists
304 //directly to evaluators.
305 Teuchos::RCP<Teuchos::ParameterList> getEquationSetParameterList() const;
306
307 // Deprecated code support, NOTE: this assumes the same basis and inte rule are used for all dofs in the physics block!!! We are setting these to avoid having to change closure model factories for all physics right away.
309
310 protected:
311
314 : dofName("")
315 , residualName(std::make_pair(false,""))
316 , grad(std::make_pair(false,""))
317 , curl(std::make_pair(false,""))
318 , div(std::make_pair(false,""))
319 , timeDerivative(std::make_pair(false,"")) {}
320
321 std::string dofName;
322 std::string basisType;
324 Teuchos::RCP<panzer::PureBasis> basis;
326 Teuchos::RCP<panzer::IntegrationRule> intRule;
327 std::pair<bool,std::string> residualName;
328 std::string scatterName;
329 std::pair<bool,std::string> grad;
330 std::pair<bool,std::string> curl;
331 std::pair<bool,std::string> div;
332 std::pair<bool,std::string> timeDerivative;
333
334 void print(std::ostream & os) const {
335 os << "DOF Desc = \"" << dofName << "\": "
336 << "Basis = (" << basisType << ", \"" << basisOrder << "\"), "
337 << "Res = (" << residualName.first << ", \"" << residualName.second << "\"), "
338 << "Grad = (" << grad.first << ", \"" << grad.second << "\"), "
339 << "Curl = (" << curl.first << ", \"" << curl.second << "\"), "
340 << "Div = (" << div.first << ", \"" << div.second << "\"), "
341 << "Time = (" << timeDerivative.first << ", \"" << timeDerivative.second << "\")";
342 }
343 };
344
346 std::map<std::string,DOFDescriptor> m_provided_dofs_desc;
347
348 // Tangent parameter names for setting up tangent fields
349 std::vector<std::string> m_tangent_param_names;
350
351 private:
352
354 typedef typename std::map<std::string,DOFDescriptor>::const_iterator DescriptorIterator;
355
356
367 std::map<std::string,std::pair<Teuchos::RCP<panzer::PureBasis>,Teuchos::RCP<std::vector<std::string> > > > m_basis_to_dofs;
368
370 typedef typename std::map<std::string,std::pair<Teuchos::RCP<panzer::PureBasis>,Teuchos::RCP<std::vector<std::string> > > >::const_iterator BasisIterator;
371
372 const Teuchos::RCP<Teuchos::ParameterList> m_input_params;
376
378 std::vector<std::pair<std::string,Teuchos::RCP<panzer::PureBasis> > > m_provided_dofs;
379
381 std::vector<std::pair<std::string,Teuchos::RCP<panzer::PureBasis> > > m_provided_coord_prefixes;
382
384 std::map<int,Teuchos::RCP<panzer::IntegrationRule> > m_int_rules;
385
387 std::map<std::string,Teuchos::RCP<panzer::PureBasis> > m_unique_bases;
388
389 Teuchos::RCP<Teuchos::ParameterList> m_eval_plist;
390
391 std::string m_block_id;
392 std::string m_type;
393 std::vector<std::string> m_closure_model_ids;
394
395 std::vector<std::vector<std::string> > m_coordinate_dofs;
396
397 };
398
399}
400
401#endif
Data for determining cell topology and dimensionality.
std::map< std::string, Teuchos::RCP< panzer::PureBasis > > m_unique_bases
Key is the basis name from panzer::PureBasis::name() and value is the corresponding PureBasis.
void addDOFGrad(const std::string &dofName, const std::string &gradName="")
void addDOFCurl(const std::string &dofName, const std::string &curlName="")
int getBasisOrder(const std::string &dofName) const
Get the basis order for an existing degree of freedom.
virtual void buildAndRegisterGatherAndOrientationEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::FieldLibrary &fl, const LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
std::map< std::string, std::pair< Teuchos::RCP< panzer::PureBasis >, Teuchos::RCP< std::vector< std::string > > > >::const_iterator BasisIterator
For convenience, declare a basis iterator.
int getIntegrationOrder(const std::string &dofName) const
Get the integration order for an existing degree of freedom.
void addClosureModel(const std::string &closure_model)
Teuchos::RCP< panzer::PureBasis > getBasisForDOF(const std::string &dof_name) const
Returns the PureBasis associated with the residual contributions for the dof_name.
void setCoordinateDOFs(const std::vector< std::string > &dofNames)
std::map< int, Teuchos::RCP< panzer::IntegrationRule > > m_int_rules
Key is the integration rule order and the value is the corresponding integration rule.
virtual const std::vector< std::pair< std::string, Teuchos::RCP< panzer::PureBasis > > > & getProvidedDOFs() const
Return the Basis for the equation set, key is the DOF name (note coordinate DOFs are NOT included)
void buildAndRegisterResidualSummationEvaluator(PHX::FieldManager< panzer::Traits > &fm, const std::string dof_name, const std::vector< std::string > &residual_contributions, const std::string residual_field_name="") const
Teuchos::RCP< Teuchos::ParameterList > getEquationSetParameterList() const
Returns the parameter list used to build this equation set.
virtual const std::map< int, Teuchos::RCP< panzer::IntegrationRule > > & getIntegrationRules() const
Return a map of unique integration rules for the equation set, key is the integration order.
virtual void setupDOFs()
Builds the integration rule, basis, DOFs, and default parameter list. This MUST be called in the cons...
Teuchos::RCP< panzer::BasisIRLayout > getBasisIRLayoutForDOF(const std::string &dof_name) const
Returns the BasisIRLayout for the dof_name.
void updateDOF(const std::string &dofName, int basisOrder, int integrationOrder=-1)
Modifying an existing DOF's basis function and integration rule.
virtual void buildAndRegisterEquationSetEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::FieldLibrary &fl, const Teuchos::ParameterList &user_data) const =0
virtual void buildAndRegisterDOFProjectionsToIPEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::FieldLayoutLibrary &fl, const Teuchos::RCP< panzer::IntegrationRule > &ir, const Teuchos::Ptr< const panzer::LinearObjFactory< panzer::Traits > > &lof, const Teuchos::ParameterList &user_data) const
bool buildTransientSupport() const
Returns true if transient support should be enabled in the equation set.
virtual std::string getType() const
Returns the type of the equation set object. Corresponds to the keyword used by the equation set fact...
void getAddedDOFs(std::vector< std::string > &dofNames) const
virtual const Teuchos::RCP< Teuchos::ParameterList > getEvaluatorParameterList() const
Returns the parameter list that will be passed off from the equaiton set to the closure model evaluat...
std::vector< std::vector< std::string > > m_coordinate_dofs
void addDOF(const std::string &dofName, const std::string &basisType, const int &basisOrder, const int integrationOrder=-1, const std::string residualName="", const std::string scatterName="")
std::vector< std::pair< std::string, Teuchos::RCP< panzer::PureBasis > > > m_provided_dofs
Key is the dof name and the value is the corresponding basis.
virtual void buildAndRegisterClosureModelEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::FieldLayoutLibrary &fl, const Teuchos::RCP< panzer::IntegrationRule > &ir, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &factory, const Teuchos::ParameterList &models, const Teuchos::ParameterList &user_data) const
Register closure model evaluators with the model name internally specified by the equation set.
virtual const std::vector< std::vector< std::string > > & getCoordinateDOFs() const
Return a vector of vectors that correspond to DOFs set as coordinate fields.
void addDOFTimeDerivative(const std::string &dofName, const std::string &dotName="")
Teuchos::RCP< panzer::IntegrationRule > getIntRuleForDOF(const std::string &dof_name) const
Returns the integration rule associated with the residual contributions for the dof_name.
virtual void setTangentParamNames(const std::vector< std::string > &tangent_param_names)
Set the list of tangent parameter names.
virtual void setElementBlockId(const std::string &blockId)
Teuchos::RCP< Teuchos::ParameterList > m_eval_plist
std::map< std::string, std::pair< Teuchos::RCP< panzer::PureBasis >, Teuchos::RCP< std::vector< std::string > > > > m_basis_to_dofs
Map that links a common basis to a vector of dof names. Key is the unique basis name,...
virtual void buildAndRegisterInitialConditionEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::FieldLibrary &fl, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &factory, const std::string &model_name, const Teuchos::ParameterList &models, const LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
std::vector< std::pair< std::string, Teuchos::RCP< panzer::PureBasis > > > m_provided_coord_prefixes
Key is the coordinate prefix name and the value is the corresponding basis.
virtual void buildAndRegisterScatterEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::FieldLibrary &fl, const LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
const Teuchos::RCP< Teuchos::ParameterList > m_input_params
void addDOFDiv(const std::string &dofName, const std::string &divName="")
std::map< std::string, DOFDescriptor > m_provided_dofs_desc
Maps the dof name into a DOFDescriptor. Should be private, but is protected so that the aux equaiton ...
std::map< std::string, DOFDescriptor >::const_iterator DescriptorIterator
For convenience, declare the DOFDescriptor iterator.
void setDefaultValidParameters(Teuchos::ParameterList &valid_parameters)
Default implementation for accessing the GlobalData object.