当前位置: 首页>>代码示例>>C++>>正文


C++ PhysicsBlock::copyWithCellData方法代码示例

本文整理汇总了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);
    }
  }
}
开发者ID:00liujj,项目名称:trilinos,代码行数:65,代码来源:Panzer_Workset_Builder.cpp


注:本文中的panzer::PhysicsBlock::copyWithCellData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。