43 #ifndef PANZER_EQUATIONSET_DEFAULT_IMPL_IMPL_HPP 44 #define PANZER_EQUATIONSET_DEFAULT_IMPL_IMPL_HPP 51 #include "Panzer_GatherBasisCoordinates.hpp" 52 #include "Panzer_GatherIntegrationCoordinates.hpp" 53 #include "Panzer_GatherOrientation.hpp" 56 #include "Phalanx_MDField.hpp" 57 #include "Phalanx_DataLayout.hpp" 58 #include "Phalanx_DataLayout_MDALayout.hpp" 59 #include "Teuchos_ParameterList.hpp" 65 template <
typename EvalT>
68 const int& default_integration_order,
70 const Teuchos::RCP<panzer::GlobalData>& global_data,
71 const bool build_transient_support) :
73 m_input_params(params),
74 m_default_integration_order(default_integration_order),
75 m_cell_data(cell_data),
76 m_build_transient_support(build_transient_support)
84 template <
typename EvalT>
89 m_type = m_input_params->get<std::string>(
"Type");
96 this->m_provided_dofs.clear();
97 this->m_int_rules.clear();
100 for(
typename std::map<std::string,DOFDescriptor>::iterator itr=m_provided_dofs_desc.begin();
101 itr!=m_provided_dofs_desc.end();++itr) {
104 TEUCHOS_ASSERT(nonnull(itr->second.basis));
105 this->m_provided_dofs.push_back(std::make_pair(itr->first, itr->second.basis));
115 TEUCHOS_ASSERT(nonnull(itr->second.intRule));
116 m_int_rules[itr->second.intRule->order()] = itr->second.intRule;
121 for (
DescriptorIterator dof_iter = m_provided_dofs_desc.begin(); dof_iter != m_provided_dofs_desc.end(); ++dof_iter) {
123 std::string basis_name = dof_iter->second.basis->name();
124 Teuchos::RCP<panzer::PureBasis> basis = dof_iter->second.basis;
125 std::string dof_name = dof_iter->first;
127 if (is_null(m_basis_to_dofs[basis_name].first)) {
128 m_basis_to_dofs[basis_name].first = basis;
129 m_basis_to_dofs[basis_name].second = Teuchos::rcp(
new std::vector<std::string>);
132 m_basis_to_dofs[basis_name].second->push_back(dof_name);
136 for (
DescriptorIterator dof_iter = m_provided_dofs_desc.begin(); dof_iter != m_provided_dofs_desc.end(); ++dof_iter) {
137 m_unique_bases[dof_iter->second.basis->name()] = dof_iter->second.basis;
141 this->m_eval_plist->set(
"Block ID", getElementBlockId());
142 this->setupDeprecatedDOFsSupport();
146 template <
typename EvalT>
149 TEUCHOS_ASSERT(m_provided_dofs.size() > 0);
150 TEUCHOS_ASSERT(m_int_rules.size() > 0);
154 Teuchos::RCP<panzer::PureBasis> pure_basis = m_provided_dofs.begin()->second;
155 Teuchos::RCP<panzer::IntegrationRule> int_rule = m_int_rules.begin()->second;
158 this->m_eval_plist->set(
"Basis", basis);
159 this->m_eval_plist->set(
"IR", int_rule);
163 template <
typename EvalT>
168 const Teuchos::ParameterList& )
const 170 using Teuchos::ParameterList;
179 for (
BasisIterator basis_it = m_basis_to_dofs.begin(); basis_it != m_basis_to_dofs.end(); ++basis_it) {
182 Teuchos::RCP< std::vector< std::vector<std::string> > > tangent_field_names;
183 if (m_tangent_param_names.size() > 0) {
184 tangent_field_names = rcp(
new std::vector< std::vector<std::string> >(basis_it->second.second->size()));
185 for (std::size_t i=0; i<basis_it->second.second->size(); ++i) {
186 for (std::size_t j=0; j<m_tangent_param_names.size(); ++j) {
187 const std::string tname =
188 (*(basis_it->second.second))[i] +
" SENSITIVITY " + m_tangent_param_names[j];
189 (*tangent_field_names)[i].push_back(tname);
195 ParameterList p(
"Gather");
196 p.set(
"Basis", basis_it->second.first);
197 p.set(
"DOF Names", basis_it->second.second);
198 p.set(
"Indexer Names", basis_it->second.second);
199 p.set(
"Sensitivities Name",
"");
200 p.set(
"First Sensitivities Available",
true);
201 p.set(
"Second Sensitivities Available",
true);
204 if (tangent_field_names != Teuchos::null)
205 p.set(
"Tangent Names", tangent_field_names);
207 RCP< PHX::Evaluator<panzer::Traits> > op = lof.
buildGather<EvalT>(p);
209 this->
template registerEvaluator<EvalT>(fm, op);
214 if (tangent_field_names != Teuchos::null) {
215 for (std::size_t i=0; i<m_tangent_param_names.size(); ++i) {
217 Teuchos::RCP< std::vector<std::string> > names = rcp(
new std::vector<std::string>);
218 for (std::size_t j=0; j<basis_it->second.second->size(); ++j)
219 names->push_back((*tangent_field_names)[j][i]);
221 ParameterList p(std::string(
"Gather Tangent ") + this->m_tangent_param_names[i]);
222 p.set(
"Basis", basis_it->second.first);
223 p.set(
"DOF Names", names);
224 p.set(
"Indexer Names", basis_it->second.second);
225 p.set(
"Sensitivities Name",
"");
226 p.set(
"First Sensitivities Available",
false);
227 p.set(
"Second Sensitivities Available",
false);
228 p.set(
"Global Data Key",
"X TANGENT GATHER CONTAINER: " + this->m_tangent_param_names[i]);
232 this->
template registerEvaluator<EvalT>(fm, op);
242 for (std::map<std::string,Teuchos::RCP<panzer::PureBasis> >::const_iterator basis = m_unique_bases.begin();
243 basis != m_unique_bases.end(); ++ basis) {
244 RCP< PHX::Evaluator<panzer::Traits> > basis_op
246 this->
template registerEvaluator<EvalT>(fm, basis_op);
250 for (std::map<
int,Teuchos::RCP<panzer::IntegrationRule> >::const_iterator ir = m_int_rules.begin();
251 ir != m_int_rules.end(); ++ir) {
252 RCP< PHX::Evaluator<panzer::Traits> > quad_op
254 this->
template registerEvaluator<EvalT>(fm, quad_op);
267 for (
BasisIterator basis_it = m_basis_to_dofs.begin(); basis_it != m_basis_to_dofs.end(); ++basis_it) {
269 RCP< std::vector<std::string> > t_dof_names = rcp(
new std::vector<std::string>);
270 RCP< std::vector<std::string> > t_field_names = rcp(
new std::vector<std::string>);
271 RCP< std::vector< std::vector<std::string> > > tangent_field_names = rcp(
new std::vector< std::vector<std::string> >);
274 for (
typename std::vector<std::string>::const_iterator dof_name = basis_it->second.second->begin();
275 dof_name != basis_it->second.second->end(); ++dof_name) {
278 TEUCHOS_ASSERT(desc != m_provided_dofs_desc.end());
281 if(desc->second.timeDerivative.first) {
283 t_dof_names->push_back(*dof_name);
284 t_field_names->push_back(desc->second.timeDerivative.second);
287 if (m_tangent_param_names.size() > 0) {
288 std::vector<std::string> tfn;
289 for (std::size_t j=0; j<m_tangent_param_names.size(); ++j) {
290 const std::string tname =
291 desc->second.timeDerivative.second +
" SENSITIVITY " + m_tangent_param_names[j];
292 tfn.push_back(tname);
294 tangent_field_names->push_back(tfn);
300 ParameterList p(
"Gather");
301 p.set(
"Basis", basis_it->second.first);
302 p.set(
"DOF Names", t_field_names);
303 p.set(
"Indexer Names", t_dof_names);
304 p.set(
"Use Time Derivative Solution Vector",
true);
307 if (m_tangent_param_names.size() > 0)
308 p.set(
"Tangent Names", tangent_field_names);
310 RCP< PHX::Evaluator<panzer::Traits> > op = lof.
buildGather<EvalT>(p);
312 this->
template registerEvaluator<EvalT>(fm, op);
317 if (m_tangent_param_names.size() > 0) {
318 for (std::size_t i=0; i<m_tangent_param_names.size(); ++i) {
320 Teuchos::RCP< std::vector<std::string> > names =
321 rcp(
new std::vector<std::string>);
322 for (std::size_t j=0; j<tangent_field_names->size(); ++j)
323 names->push_back((*tangent_field_names)[j][i]);
325 ParameterList p(std::string(
"Gather Tangent ") + this->m_tangent_param_names[i]);
326 p.set(
"Basis", basis_it->second.first);
327 p.set(
"DOF Names", names);
328 p.set(
"Indexer Names", t_dof_names);
329 p.set(
"Use Time Derivative Solution Vector",
true);
330 p.set(
"Global Data Key",
"DXDT TANGENT GATHER CONTAINER: " + this->m_tangent_param_names[i]);
334 this->
template registerEvaluator<EvalT>(fm, op);
343 for (
BasisIterator basis_it = m_basis_to_dofs.begin(); basis_it != m_basis_to_dofs.end(); ++basis_it) {
344 if(basis_it->second.first->requiresOrientations()) {
345 ParameterList p(
"Gather Orientation");
346 p.set(
"Basis", basis_it->second.first);
347 p.set(
"DOF Names", basis_it->second.second);
348 p.set(
"Indexer Names", basis_it->second.second);
352 this->
template registerEvaluator<EvalT>(fm, op);
359 template <
typename EvalT>
363 const Teuchos::RCP<panzer::IntegrationRule>& ir,
365 const Teuchos::ParameterList& )
const 367 using Teuchos::ParameterList;
371 Teuchos::RCP<const panzer::GlobalIndexer> globalIndexer;
372 if(lof!=Teuchos::null)
373 globalIndexer = lof->getRangeGlobalIndexer();
376 for (
DescriptorIterator dof_iter = m_provided_dofs_desc.begin(); dof_iter != m_provided_dofs_desc.end(); ++dof_iter) {
379 p.set(
"Name", dof_iter->first);
383 if(globalIndexer!=Teuchos::null) {
385 int fieldNum = globalIndexer->getFieldNum(dof_iter->first);
386 RCP<const std::vector<int> >
offsets =
387 rcp(
new std::vector<int>(globalIndexer->getGIDFieldOffsets(m_block_id,fieldNum)));
388 p.set(
"Jacobian Offsets Vector",
offsets);
392 RCP< PHX::Evaluator<panzer::Traits> > op =
395 this->
template registerEvaluator<EvalT>(fm, op);
400 for(
typename std::map<std::string,DOFDescriptor>::const_iterator itr=m_provided_dofs_desc.begin();
401 itr!=m_provided_dofs_desc.end();++itr) {
403 if(itr->second.basis->supportsGrad()) {
406 if(!itr->second.grad.first)
409 const std::string dof_name = itr->first;
410 const std::string dof_grad_name = itr->second.grad.second;
413 p.set(
"Name", dof_name);
414 p.set(
"Gradient Name", dof_grad_name);
418 RCP< PHX::Evaluator<panzer::Traits> > op =
421 this->
template registerEvaluator<EvalT>(fm, op);
427 for(
typename std::map<std::string,DOFDescriptor>::const_iterator itr=m_provided_dofs_desc.begin();
428 itr!=m_provided_dofs_desc.end();++itr) {
430 if(itr->second.basis->supportsCurl()) {
433 if(!itr->second.curl.first)
436 const std::string dof_name = itr->first;
437 const std::string dof_curl_name = itr->second.curl.second;
440 p.set(
"Name", dof_name);
441 p.set(
"Curl Name", dof_curl_name);
446 if(globalIndexer!=Teuchos::null) {
448 int fieldNum = globalIndexer->getFieldNum(dof_name);
449 RCP<const std::vector<int> >
offsets =
450 rcp(
new std::vector<int>(globalIndexer->getGIDFieldOffsets(m_block_id,fieldNum)));
451 p.set(
"Jacobian Offsets Vector",
offsets);
456 RCP< PHX::Evaluator<panzer::Traits> > op =
459 this->
template registerEvaluator<EvalT>(fm, op);
466 for(
typename std::map<std::string,DOFDescriptor>::const_iterator itr=m_provided_dofs_desc.begin();
467 itr!=m_provided_dofs_desc.end();++itr) {
469 if(itr->second.basis->supportsDiv()) {
472 if(!itr->second.div.first)
475 const std::string dof_name = itr->first;
476 const std::string dof_div_name = itr->second.div.second;
479 p.set(
"Name", dof_name);
480 p.set(
"Div Name", dof_div_name);
485 if(globalIndexer!=Teuchos::null) {
487 int fieldNum = globalIndexer->getFieldNum(dof_name);
488 RCP<const std::vector<int> >
offsets =
489 rcp(
new std::vector<int>(globalIndexer->getGIDFieldOffsets(m_block_id,fieldNum)));
490 p.set(
"Jacobian Offsets Vector",
offsets);
495 RCP< PHX::Evaluator<panzer::Traits> > op =
498 this->
template registerEvaluator<EvalT>(fm, op);
503 for(
typename std::map<std::string,DOFDescriptor>::const_iterator itr=m_provided_dofs_desc.begin();
504 itr!=m_provided_dofs_desc.end();++itr) {
506 if(!itr->second.timeDerivative.first)
509 const std::string td_name = itr->second.timeDerivative.second;
512 p.set(
"Name", td_name);
516 if(globalIndexer!=Teuchos::null) {
518 int fieldNum = globalIndexer->getFieldNum(itr->first);
519 RCP<const std::vector<int> >
offsets =
520 rcp(
new std::vector<int>(globalIndexer->getGIDFieldOffsets(m_block_id,fieldNum)));
521 p.set(
"Jacobian Offsets Vector",
offsets);
527 if(itr->second.basis->requiresOrientations())
528 p.set(
"Orientation Field Name", itr->first+
" Orientation");
530 RCP< PHX::Evaluator<panzer::Traits> > op =
533 this->
template registerEvaluator<EvalT>(fm, op);
539 template <
typename EvalT>
544 const Teuchos::ParameterList& user_data)
const 546 using Teuchos::ParameterList;
552 bool ignoreScatter =
false;
553 if(user_data.isParameter(
"Ignore Scatter"))
554 ignoreScatter = user_data.get<
bool>(
"Ignore Scatter");
558 for(
typename std::map<std::string,DOFDescriptor>::const_iterator itr=m_provided_dofs_desc.begin();
559 itr!=m_provided_dofs_desc.end();++itr) {
561 RCP<std::map<std::string,std::string> > names_map = rcp(
new std::map<std::string,std::string>);
562 RCP< std::vector<std::string> > residual_names = rcp(
new std::vector<std::string>);
565 TEUCHOS_ASSERT(itr->second.residualName.first);
567 names_map->insert(std::make_pair(itr->second.residualName.second,itr->first));
568 residual_names->push_back(itr->second.residualName.second);
571 ParameterList p(
"Scatter");
572 p.set(
"Scatter Name", itr->second.scatterName);
573 p.set(
"Basis", itr->second.basis.getConst());
574 p.set(
"Dependent Names", residual_names);
575 p.set(
"Dependent Map", names_map);
577 RCP< PHX::Evaluator<panzer::Traits> > op = lof.
buildScatter<EvalT>(p);
579 this->
template registerEvaluator<EvalT>(fm, op);
584 PHX::Tag<typename EvalT::ScalarT> tag(itr->second.scatterName,
585 Teuchos::rcp(
new PHX::MDALayout<Dummy>(0)));
586 fm.template requireField<EvalT>(tag);
597 template <
typename EvalT>
601 const Teuchos::RCP<panzer::IntegrationRule>& ir,
603 const Teuchos::ParameterList& models,
604 const Teuchos::ParameterList& user_data)
const 606 for (std::vector<std::string>::const_iterator model_name = m_closure_model_ids.begin();
607 model_name != m_closure_model_ids.end(); ++model_name) {
609 this->buildAndRegisterClosureModelEvaluators(fm,fl,ir,factory,*model_name,models,user_data);
615 template <
typename EvalT>
619 const Teuchos::RCP<panzer::IntegrationRule>& ir,
621 const std::string& model_name,
622 const Teuchos::ParameterList& models,
623 const Teuchos::ParameterList& user_data)
const 625 Teuchos::RCP< std::vector< Teuchos::RCP<PHX::Evaluator<panzer::Traits> > > > evaluators =
626 factory.getAsObject<EvalT>()->buildClosureModels(model_name,
630 *(this->m_eval_plist),
632 this->getGlobalData(),
635 for (std::vector< Teuchos::RCP<PHX::Evaluator<panzer::Traits> > >::size_type i=0; i < evaluators->size(); ++i)
636 this->
template registerEvaluator<EvalT>(fm, (*evaluators)[i]);
640 template <
typename EvalT>
645 const std::string& model_name,
646 const Teuchos::ParameterList& models,
648 const Teuchos::ParameterList& user_data)
const 651 for (std::map<std::string,Teuchos::RCP<panzer::PureBasis> >::const_iterator basis = m_unique_bases.begin();
652 basis != m_unique_bases.end(); ++ basis) {
653 Teuchos::RCP< PHX::Evaluator<panzer::Traits> > basis_op
655 this->
template registerEvaluator<EvalT>(fm, basis_op);
658 for(
typename std::map<std::string,DOFDescriptor>::const_iterator itr=m_provided_dofs_desc.begin();
659 itr!=m_provided_dofs_desc.end();++itr) {
661 Teuchos::ParameterList p(
"Scatter");
662 p.set(
"Scatter Name", itr->second.scatterName);
663 p.set(
"Basis", itr->second.basis.getConst());
664 Teuchos::RCP<std::vector<std::string> > name = Teuchos::rcp(
new std::vector<std::string>);
665 name->push_back(itr->first);
666 p.set(
"Dependent Names", name);
669 Teuchos::RCP<std::map<std::string,std::string> > names_map = Teuchos::rcp(
new std::map<std::string,std::string>);
670 names_map->insert(std::make_pair(itr->first,itr->first));
671 p.set(
"Dependent Map", names_map);
674 p.set(
"Scatter Initial Condition",
true);
679 this->
template registerEvaluator<EvalT>(fm, op);
683 PHX::Tag<typename EvalT::ScalarT> tag(itr->second.scatterName,Teuchos::rcp(
new PHX::MDALayout<Dummy>(0)));
684 fm.template requireField<EvalT>(tag);
697 Teuchos::RCP<panzer::IntegrationRule> dummy_ir;
698 if (m_int_rules.size() > 0)
699 dummy_ir = m_int_rules.begin()->second;
702 Teuchos::RCP< std::vector< Teuchos::RCP<PHX::Evaluator<panzer::Traits> > > > evaluators =
703 factory.getAsObject<EvalT>()->buildClosureModels(model_name, models, *fll, dummy_ir, *(this->m_eval_plist), user_data, this->getGlobalData(), fm);
705 for (std::vector< Teuchos::RCP<PHX::Evaluator<panzer::Traits> > >::size_type i=0; i < evaluators->size(); ++i)
706 this->
template registerEvaluator<EvalT>(fm, (*evaluators)[i]);
713 for (
BasisIterator basis_it = m_basis_to_dofs.begin(); basis_it != m_basis_to_dofs.end(); ++basis_it) {
714 if(basis_it->second.first->requiresOrientations()) {
715 Teuchos::ParameterList p(
"Gather Orientation");
716 p.set(
"Basis", basis_it->second.first);
717 p.set(
"DOF Names", basis_it->second.second);
718 p.set(
"Indexer Names", basis_it->second.second);
722 this->
template registerEvaluator<EvalT>(fm, op);
729 template <
typename EvalT>
730 const Teuchos::RCP<Teuchos::ParameterList>
737 template <
typename EvalT>
738 const std::vector<std::pair<std::string,Teuchos::RCP<panzer::PureBasis> > >&
741 return m_provided_dofs;
745 template <
typename EvalT>
746 const std::vector<std::vector<std::string> > &
749 return m_coordinate_dofs;
753 template <
typename EvalT>
754 const std::map<int,Teuchos::RCP<panzer::IntegrationRule> > &
761 template <
typename EvalT>
765 TEUCHOS_ASSERT(m_block_id==
"");
766 m_block_id = blockId;
767 this->m_eval_plist->set(
"Block ID", getElementBlockId());
772 template <
typename EvalT>
780 template <
typename EvalT>
787 template <
typename EvalT>
790 m_tangent_param_names = tangent_param_names;
794 template <
typename EvalT>
797 return m_build_transient_support;
801 template <
typename EvalT>
806 for(
typename std::map<std::string,DOFDescriptor>::const_iterator itr=m_provided_dofs_desc.begin();
807 itr!=m_provided_dofs_desc.end();++itr)
808 dofNames.push_back(itr->first);
812 template <
typename EvalT>
816 int integrationOrder)
818 typename std::map<std::string,DOFDescriptor>::const_iterator itr = m_provided_dofs_desc.find(dofName);
820 TEUCHOS_TEST_FOR_EXCEPTION(itr==m_provided_dofs_desc.end(),std::runtime_error,
821 "EquationSet_DefaultImpl::updateDOF: DOF \"" << dofName <<
"\" has not been specified " 822 "by derived equation set \"" << this->getType() <<
"\".");
827 desc.basis = Teuchos::rcp(
new panzer::PureBasis(desc.basisType,desc.basisOrder,m_cell_data));
829 if (integrationOrder == -1)
830 desc.integrationOrder = m_default_integration_order;
832 desc.integrationOrder = integrationOrder;
838 template <
typename EvalT>
842 typename std::map<std::string,DOFDescriptor>::const_iterator itr = m_provided_dofs_desc.find(dofName);
844 TEUCHOS_TEST_FOR_EXCEPTION(itr==m_provided_dofs_desc.end(),std::runtime_error,
845 "EquationSet_DefaultImpl::getBasisOrder: DOF \"" << dofName <<
"\" has not been specified " 846 "by derived equation set \"" << this->getType() <<
"\".");
848 return itr->second.basisOrder;
852 template <
typename EvalT>
856 typename std::map<std::string,DOFDescriptor>::const_iterator itr = m_provided_dofs_desc.find(dofName);
858 TEUCHOS_TEST_FOR_EXCEPTION(itr==m_provided_dofs_desc.end(),std::runtime_error,
859 "EquationSet_DefaultImpl::getIntegrationOrder: DOF \"" << dofName <<
"\" has not been specified " 860 "by derived equation set \"" << this->getType() <<
"\".");
862 return itr->second.integrationOrder;
866 template <
typename EvalT>
869 const std::string & basisType,
870 const int & basisOrder,
871 const int integrationOrder,
872 const std::string residualName,
873 const std::string scatterName)
875 typename std::map<std::string,DOFDescriptor>::const_iterator itr = m_provided_dofs_desc.find(dofName);
877 TEUCHOS_TEST_FOR_EXCEPTION(itr!=m_provided_dofs_desc.end(),std::runtime_error,
878 "EquationSet_DefaultImpl::addProvidedDOF: DOF \"" << dofName <<
"\" was previously specified " 879 "by derived equation set \"" << this->getType() <<
"\".");
884 desc.basisType = basisType;
885 desc.basisOrder = basisOrder;
886 desc.basis = Teuchos::rcp(
new panzer::PureBasis(desc.basisType,desc.basisOrder,m_cell_data));
888 if (integrationOrder == -1)
889 desc.integrationOrder = m_default_integration_order;
891 desc.integrationOrder = integrationOrder;
896 desc.residualName.first =
true;
898 if (residualName ==
"")
899 desc.residualName.second =
"RESIDUAL_" + dofName;
901 desc.residualName.second = residualName;
903 if (scatterName ==
"")
904 desc.scatterName =
"SCATTER_" + dofName;
906 desc.scatterName = scatterName;
911 template <
typename EvalT>
914 const std::string & gradName)
916 typename std::map<std::string,DOFDescriptor>::iterator itr = m_provided_dofs_desc.find(dofName);
918 TEUCHOS_TEST_FOR_EXCEPTION(itr==m_provided_dofs_desc.end(),std::runtime_error,
919 "EquationSet_DefaultImpl::addDOFGrad: DOF \"" << dofName <<
"\" has not been specified as a DOF " 920 "by derived equation set \"" << this->getType() <<
"\".");
924 TEUCHOS_ASSERT(desc.dofName==dofName);
927 desc.grad = std::make_pair(
true,std::string(
"GRAD_")+dofName);
929 desc.grad = std::make_pair(
true,gradName);
933 template <
typename EvalT>
936 const std::string & curlName)
938 typename std::map<std::string,DOFDescriptor>::iterator itr = m_provided_dofs_desc.find(dofName);
940 TEUCHOS_TEST_FOR_EXCEPTION(itr==m_provided_dofs_desc.end(),std::runtime_error,
941 "EquationSet_DefaultImpl::addDOFCurl: DOF \"" << dofName <<
"\" has not been specified as a DOF " 942 "by derived equation set \"" << this->getType() <<
"\".");
946 TEUCHOS_ASSERT(desc.dofName==dofName);
949 desc.curl = std::make_pair(
true,std::string(
"CURL_")+dofName);
951 desc.curl = std::make_pair(
true,curlName);
955 template <
typename EvalT>
958 const std::string & divName)
960 typename std::map<std::string,DOFDescriptor>::iterator itr = m_provided_dofs_desc.find(dofName);
962 TEUCHOS_TEST_FOR_EXCEPTION(itr==m_provided_dofs_desc.end(),std::runtime_error,
963 "EquationSet_DefaultImpl::addDOFDiv: DOF \"" << dofName <<
"\" has not been specified as a DOF " 964 "by derived equation set \"" << this->getType() <<
"\".");
968 TEUCHOS_ASSERT(desc.dofName==dofName);
971 desc.div = std::make_pair(
true,std::string(
"DIV_")+dofName);
973 desc.div = std::make_pair(
true,divName);
977 template <
typename EvalT>
980 const std::string & dotName)
982 typename std::map<std::string,DOFDescriptor>::iterator itr = m_provided_dofs_desc.find(dofName);
984 TEUCHOS_TEST_FOR_EXCEPTION(itr==m_provided_dofs_desc.end(),std::runtime_error,
985 "EquationSet_DefaultImpl::addDOFTimeDerivative: DOF \"" << dofName <<
"\" has not been specified as a DOF " 986 "by derived equation set \"" << this->getType() <<
"\".");
990 TEUCHOS_ASSERT(desc.dofName==dofName);
993 desc.timeDerivative = std::make_pair(
true,std::string(
"DXDT_")+dofName);
995 desc.timeDerivative = std::make_pair(
true,dotName);
999 template <
typename EvalT>
1003 TEUCHOS_TEST_FOR_EXCEPTION(m_cell_data.baseCellDimension()!=Teuchos::as<int>(dofNames.size()),std::invalid_argument,
1004 "EquationSet_DefaultImpl::setCoordinateDOFs: Size of vector is not equal to the " 1005 "spatial dimension.");
1007 for(std::size_t d=0;d<dofNames.size();d++) {
1008 typename std::map<std::string,DOFDescriptor>::const_iterator desc_it = m_provided_dofs_desc.find(dofNames[d]);
1009 TEUCHOS_TEST_FOR_EXCEPTION(desc_it == m_provided_dofs_desc.end(),std::invalid_argument,
1010 "EquationSet_DefaultImpl::setCoordinateDOFs: DOF of name \"" + dofNames[d] +
"\" " 1011 "has not been added, thus cannot be set as a coordinate DOF.");
1014 m_coordinate_dofs.push_back(dofNames);
1018 template <
typename EvalT>
1022 std::string default_type =
"";
1023 valid_parameters.set(
"Type",default_type,
"The equation set type. This must corespond to the type keyword used to build the equation set in the equation set factory.");
1027 template <
typename EvalT>
1028 Teuchos::RCP<panzer::PureBasis>
1031 typename std::map<std::string,DOFDescriptor>::const_iterator desc_it = m_provided_dofs_desc.find(dof_name);
1032 TEUCHOS_ASSERT(desc_it != m_provided_dofs_desc.end());
1033 return desc_it->second.basis;
1037 template <
typename EvalT>
1038 Teuchos::RCP<panzer::IntegrationRule>
1041 typename std::map<std::string,DOFDescriptor>::const_iterator desc_it = m_provided_dofs_desc.find(dof_name);
1042 TEUCHOS_TEST_FOR_EXCEPTION(desc_it == m_provided_dofs_desc.end(),std::logic_error,
1043 "EquationSet_DefaultImpl::getIntRuleForDOF: Failed to find degree of freedom " 1044 "with name \"" << dof_name <<
"\".");
1045 return desc_it->second.intRule;
1049 template <
typename EvalT>
1050 Teuchos::RCP<panzer::BasisIRLayout>
1053 typename std::map<std::string,DOFDescriptor>::const_iterator desc_it = m_provided_dofs_desc.find(dof_name);
1054 TEUCHOS_TEST_FOR_EXCEPTION(desc_it == m_provided_dofs_desc.end(),std::logic_error,
1055 "EquationSet_DefaultImpl::getBasisIRLayoutForDOF: Failed to find degree of freedom " 1056 "with name \"" << dof_name <<
"\".");
1062 template <
typename EvalT>
1065 const std::string dof_name,
1066 const std::vector<std::string>& residual_contributions,
1067 const std::string residual_field_name)
const 1072 Teuchos::ParameterList p;
1074 if (residual_field_name !=
"")
1075 p.set(
"Sum Name", residual_field_name);
1077 p.set(
"Sum Name",
"RESIDUAL_" + dof_name);
1079 RCP<std::vector<std::string> > rcp_residual_contributions = rcp(
new std::vector<std::string>);
1080 *rcp_residual_contributions = residual_contributions;
1082 p.set(
"Values Names", rcp_residual_contributions);
1085 TEUCHOS_ASSERT(desc_it != m_provided_dofs_desc.end());
1087 p.set(
"Data Layout", desc_it->second.basis->functional);
1091 this->
template registerEvaluator<EvalT>(fm, op);
1095 template <
typename EvalT>
1098 const std::string dof_name,
1099 const std::vector<std::string>& residual_contributions,
1100 const std::vector<double>& scale_contributions,
1101 const std::string residual_field_name)
const 1106 Teuchos::ParameterList p;
1108 if (residual_field_name !=
"")
1109 p.set(
"Sum Name", residual_field_name);
1111 p.set(
"Sum Name",
"RESIDUAL_" + dof_name);
1113 RCP<std::vector<std::string> > rcp_residual_contributions = rcp(
new std::vector<std::string>);
1114 *rcp_residual_contributions = residual_contributions;
1115 p.set(
"Values Names", rcp_residual_contributions);
1117 RCP<const std::vector<double> > rcp_scale_contributions = rcp(
new std::vector<double>(scale_contributions));
1118 p.set(
"Scalars", rcp_scale_contributions);
1121 TEUCHOS_ASSERT(desc_it != m_provided_dofs_desc.end());
1123 p.set(
"Data Layout", desc_it->second.basis->functional);
1127 this->
template registerEvaluator<EvalT>(fm, op);
1131 template <
typename EvalT>
1134 m_closure_model_ids.push_back(closure_model);
1138 template <
typename EvalT>
1139 Teuchos::RCP<Teuchos::ParameterList>
1142 return m_input_params;
Teuchos::RCP< PHX::Evaluator< Traits > > buildScatterDirichlet(const Teuchos::ParameterList &pl) const
Use preconstructed dirichlet scatter evaluators.
Teuchos::RCP< panzer::PureBasis > getBasisForDOF(const std::string &dof_name) const
Returns the PureBasis associated with the residual contributions for the dof_name.
std::map< std::string, DOFDescriptor >::const_iterator DescriptorIterator
For convenience, declare the DOFDescriptor iterator.
void setupDeprecatedDOFsSupport()
virtual std::string getElementBlockId() const
Interpolates basis DOF values to IP DOF Gradient values.
void addDOFGrad(const std::string &dofName, const std::string &gradName="")
virtual void setTangentParamNames(const std::vector< std::string > &tangent_param_names)
Set the list of tangent parameter names.
void getAddedDOFs(std::vector< std::string > &dofNames) const
virtual void buildAndRegisterScatterEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::FieldLibrary &fl, const LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
Default implementation for accessing the GlobalData object.
Teuchos::RCP< panzer::BasisIRLayout > lookupLayout(const std::string &fieldName) const
Get the basis associated with a particular field.
Teuchos::RCP< panzer::BasisIRLayout > getBasisIRLayoutForDOF(const std::string &dof_name) const
Returns the BasisIRLayout for the dof_name.
Teuchos::RCP< Teuchos::ParameterList > m_eval_plist
Teuchos::RCP< PHX::Evaluator< Traits > > buildGatherTangent(const Teuchos::ParameterList &pl) const
Use preconstructed gather evaluators.
Interpolates basis DOF values to IP DOF Div values.
void setDefaultValidParameters(Teuchos::ParameterList &valid_parameters)
Teuchos::RCP< PHX::Evaluator< Traits > > buildGather(const Teuchos::ParameterList &pl) const
Use preconstructed gather evaluators.
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) ...
PHX::View< const int * > offsets
Teuchos::RCP< panzer::BasisIRLayout > basisIRLayout(std::string basis_type, const int basis_order, const PointRule &pt_rule)
Nonmember constructor.
void setCoordinateDOFs(const std::vector< std::string > &dofNames)
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
Data for determining cell topology and dimensionality.
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
void addDOFDiv(const std::string &dofName, const std::string &divName="")
Gathers coordinates for the quadrature from the workset and stores them in the field manager...
virtual void setupDOFs()
Builds the integration rule, basis, DOFs, and default parameter list. This MUST be called in the cons...
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.
Teuchos::RCP< Teuchos::ParameterList > getEquationSetParameterList() const
Returns the parameter list used to build this equation set.
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...
Teuchos::RCP< const FieldLayoutLibrary > buildFieldLayoutLibrary(panzer::PointRule &ir) const
virtual std::string getType() const
Returns the type of the equation set object. Corresponds to the keyword used by the equation set fact...
int getBasisOrder(const std::string &dofName) const
Get the basis order for an existing degree of freedom.
Interpolates basis DOF values to IP DOF Curl values.
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 buildAndRegisterGatherAndOrientationEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::FieldLibrary &fl, const LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
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="")
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
void updateDOF(const std::string &dofName, int basisOrder, int integrationOrder=-1)
Modifying an existing DOF's basis function and integration rule.
Teuchos::RCP< PHX::Evaluator< Traits > > buildScatter(const Teuchos::ParameterList &pl) const
Use preconstructed scatter evaluators.
int getIntegrationOrder(const std::string &dofName) const
Get the integration order for an existing degree of freedom.
const Teuchos::RCP< Teuchos::ParameterList > m_input_params
Teuchos::RCP< panzer::IntegrationRule > getIntRuleForDOF(const std::string &dof_name) const
Returns the integration rule associated with the residual contributions for the dof_name.
Interpolates basis DOF values to IP DOF values.
void addDOFTimeDerivative(const std::string &dofName, const std::string &dotName="")
Description and data layouts associated with a particular basis.
void addDOFCurl(const std::string &dofName, const std::string &curlName="")
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...
EquationSet_DefaultImpl(const Teuchos::RCP< Teuchos::ParameterList > ¶ms, const int &default_integration_order, const panzer::CellData &cell_data, const Teuchos::RCP< panzer::GlobalData > &global_data, const bool build_transient_support)
virtual void setElementBlockId(const std::string &blockId)
Gathers coordinates for the basis function from the workset and stores them in the field manager...
void addClosureModel(const std::string &closure_model)
virtual const std::vector< std::vector< std::string > > & getCoordinateDOFs() const
Return a vector of vectors that correspond to DOFs set as coordinate fields.
Teuchos::RCP< PHX::Evaluator< Traits > > buildGatherOrientation(const Teuchos::ParameterList &pl) const
Use preconstructed gather evaluators.
bool buildTransientSupport() const
Returns true if transient support should be enabled in the equation set.