本文整理汇总了C++中panzer::PhysicsBlock::copyWithCellData方法的典型用法代码示例。如果您正苦于以下问题:C++ PhysicsBlock::copyWithCellData方法的具体用法?C++ PhysicsBlock::copyWithCellData怎么用?C++ PhysicsBlock::copyWithCellData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panzer::PhysicsBlock
的用法示例。
在下文中一共展示了PhysicsBlock::copyWithCellData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: populateValueArrays
void populateValueArrays(std::size_t num_cells,bool isSide,const panzer::PhysicsBlock & in_pb,WorksetDetails & details)
{
using Teuchos::RCP;
using Teuchos::rcp;
panzer::IntrepidFieldContainerFactory arrayFactory;
// setup the integration rules and bases
RCP<const panzer::PhysicsBlock> pb = Teuchos::rcpFromRef(in_pb);
if(isSide) {
const panzer::CellData side_cell_data(num_cells,
details.subcell_index,
in_pb.cellData().getCellTopology());
pb = in_pb.copyWithCellData(side_cell_data);
}
const std::map<int,RCP<panzer::IntegrationRule> >& int_rules = pb->getIntegrationRules();
details.ir_degrees = rcp(new std::vector<int>(0));
details.basis_names = rcp(new std::vector<std::string>(0));
for (std::map<int,RCP<panzer::IntegrationRule> >::const_iterator ir_itr = int_rules.begin();
ir_itr != int_rules.end(); ++ir_itr) {
details.ir_degrees->push_back(ir_itr->first);
RCP<panzer::IntegrationValues<double,Intrepid::FieldContainer<double> > > iv =
rcp(new panzer::IntegrationValues<double,Intrepid::FieldContainer<double> >);
iv->setupArrays(ir_itr->second);
iv->evaluateValues(details.cell_vertex_coordinates);
details.int_rules.push_back(iv);
// Need to create all combinations of basis/ir pairings
const std::map<std::string,Teuchos::RCP<panzer::PureBasis> >& bases = pb->getBases();
for (std::map<std::string,Teuchos::RCP<panzer::PureBasis> >::const_iterator b_itr = bases.begin();
b_itr != bases.end(); ++b_itr) {
RCP<panzer::BasisIRLayout> b_layout = rcp(new panzer::BasisIRLayout(b_itr->second,*ir_itr->second));
details.basis_names->push_back(b_layout->name());
RCP<panzer::BasisValues<double,Intrepid::FieldContainer<double> > > bv =
rcp(new panzer::BasisValues<double,Intrepid::FieldContainer<double> >);
bv->setupArrays(b_layout,arrayFactory);
std::size_t int_degree_index = std::distance(details.ir_degrees->begin(),
std::find(details.ir_degrees->begin(),
details.ir_degrees->end(),
ir_itr->second->order()));
bv->evaluateValues(details.int_rules[int_degree_index]->cub_points,
details.int_rules[int_degree_index]->jac,
details.int_rules[int_degree_index]->jac_det,
details.int_rules[int_degree_index]->jac_inv,
details.int_rules[int_degree_index]->weighted_measure,
details.cell_vertex_coordinates);
details.bases.push_back(bv);
}
}
}