本文整理汇总了C++中panzer::PhysicsBlock::getProvidedDOFs方法的典型用法代码示例。如果您正苦于以下问题:C++ PhysicsBlock::getProvidedDOFs方法的具体用法?C++ PhysicsBlock::getProvidedDOFs怎么用?C++ PhysicsBlock::getProvidedDOFs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panzer::PhysicsBlock
的用法示例。
在下文中一共展示了PhysicsBlock::getProvidedDOFs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void user_app::BCStrategy_Dirichlet_Constant<EvalT>::
setup(const panzer::PhysicsBlock& side_pb,
const Teuchos::ParameterList& user_data)
{
using Teuchos::RCP;
using std::vector;
using std::string;
using std::pair;
/*
// need the dof value to form the residual
this->required_dof_names.push_back(this->m_bc.equationSetName());
// unique residual name
this->residual_name = "Residual_" + this->m_bc.identifier();
// map residual to dof
this->residual_to_dof_names_map[residual_name] = this->m_bc.equationSetName();
// map residual to target field
this->residual_to_target_field_map[residual_name] = "Constant_" + this->m_bc.equationSetName();
*/
// gather the DOF
this->addDOF(this->m_bc.equationSetName()); // DOF Name
// add in the targert
this->addTarget("Constant_"+this->m_bc.equationSetName(), // Target Name
this->m_bc.equationSetName(), // DOF Name
"Residual_"+this->m_bc.identifier()); // Residual Name
// find the basis for this dof
const vector<pair<string,RCP<panzer::PureBasis> > >& dofs = side_pb.getProvidedDOFs();
for (vector<pair<string,RCP<panzer::PureBasis> > >::const_iterator dof_it =
dofs.begin(); dof_it != dofs.end(); ++dof_it) {
if (dof_it->first == this->m_bc.equationSetName())
this->basis = dof_it->second;
}
TEUCHOS_TEST_FOR_EXCEPTION(Teuchos::is_null(this->basis), std::runtime_error,
"Error the name \"" << this->m_bc.equationSetName()
<< "\" is not a valid DOF for the boundary condition:\n"
<< this->m_bc << "\n");
}
示例2:
Teuchos::RCP<panzer::PureBasis>
panzer::BCStrategy_Interface_DefaultImpl<EvalT>::
getBasis(const std::string dof_name,const panzer::PhysicsBlock& side_pb) const
{
const std::vector<std::pair<std::string,Teuchos::RCP<panzer::PureBasis> > >& dofBasisPair = side_pb.getProvidedDOFs();
Teuchos::RCP<panzer::PureBasis> basis;
for (std::vector<std::pair<std::string,Teuchos::RCP<panzer::PureBasis> > >::const_iterator it =
dofBasisPair.begin(); it != dofBasisPair.end(); ++it) {
if (it->first == dof_name)
basis = it->second;
}
TEUCHOS_TEST_FOR_EXCEPTION(is_null(basis), std::runtime_error,
"Error the name \"" << dof_name
<< "\" is not a valid DOF for the boundary condition:\n"
<< this->m_bc << "\n");
return basis;
}