本文整理汇总了C++中shards::CellTopology::getCellTopologyData方法的典型用法代码示例。如果您正苦于以下问题:C++ CellTopology::getCellTopologyData方法的具体用法?C++ CellTopology::getCellTopologyData怎么用?C++ CellTopology::getCellTopologyData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shards::CellTopology
的用法示例。
在下文中一共展示了CellTopology::getCellTopologyData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void Intrepid2FieldPattern::buildSubcellClosure(const shards::CellTopology & cellTopo,unsigned dim,unsigned subCell,
std::set<std::pair<unsigned,unsigned> > & closure)
{
switch(dim) {
case 0:
closure.insert(std::make_pair(0,subCell));
break;
case 1:
closure.insert(std::make_pair(0,cellTopo.getNodeMap(dim,subCell,0)));
closure.insert(std::make_pair(0,cellTopo.getNodeMap(dim,subCell,1)));
closure.insert(std::make_pair(1,subCell));
break;
case 2:
{
unsigned cnt = (shards::CellTopology(cellTopo.getCellTopologyData(dim,subCell))).getSubcellCount(dim-1);
for(unsigned i=0;i<cnt;i++) {
int edge = mapCellFaceEdge(cellTopo.getCellTopologyData(),subCell,i);
buildSubcellClosure(cellTopo,dim-1,edge,closure);
}
closure.insert(std::make_pair(2,subCell));
}
break;
default:
// beyond a two dimension surface this thing crashes!
TEUCHOS_ASSERT(false);
};
}
示例2: getLocalSideIndexFromGlobalNodeList
unsigned
getLocalSideIndexFromGlobalNodeList(const ArrayCellGIDs& cellGIDs,
const ArraySideGIDs& sideGIDs,
const shards::CellTopology& cell)
{
unsigned cell_dim = cell.getDimension();
//TEUCHOS_TEST_FOR_EXCEPTION(!cell.getSubcellHomogeneity(cell_dim - 1),
// std::runtime_error, "Sides are not homogeneous!");
unsigned local_side;
bool found_local_side = false;
unsigned side = 0;
while ( (side < cell.getSideCount()) && (!found_local_side) ) {
const shards::CellTopology
side_topo(cell.getCellTopologyData(cell.getDimension()-1, side));
unsigned num_side_nodes =
cell.getCellTopologyData()->side[side].topology->node_count;
std::list<unsigned> tmp_side_gid_list;
for (unsigned node = 0; node < num_side_nodes; ++node)
tmp_side_gid_list.push_back(cellGIDs[cell.getNodeMap(cell_dim - 1,
side, node)]);
bool side_matches = true;
unsigned node = 0;
while ( side_matches && (node < num_side_nodes) ) {
std::list<unsigned>::iterator search =
std::find(tmp_side_gid_list.begin(), tmp_side_gid_list.end(),
sideGIDs[node]);
if (search == tmp_side_gid_list.end())
side_matches = false;
++node;
}
if (side_matches) {
found_local_side = true;
local_side = side;
}
++side;
}
TEUCHOS_TEST_FOR_EXCEPTION(!found_local_side, std::runtime_error,
"Failed to find side!");
return local_side;
}
示例3: getLocalSubcellIndexFromGlobalNodeList
unsigned
getLocalSubcellIndexFromGlobalNodeList(const ArrayCellGIDs& cellGIDs,
const ArraySideGIDs& subcellGIDs,
const shards::CellTopology& cell,unsigned subcell_dim)
{
unsigned local_subcell;
bool found_local_subcell = false;
unsigned subcell = 0;
while ( (subcell < cell.getSubcellCount(subcell_dim)) && (!found_local_subcell) ) {
unsigned num_subcell_nodes =
cell.getCellTopologyData()->subcell[subcell_dim][subcell].topology->node_count;
std::list<unsigned> tmp_subcell_gid_list;
for (unsigned node = 0; node < num_subcell_nodes; ++node)
tmp_subcell_gid_list.push_back(cellGIDs[cell.getNodeMap(subcell_dim,
subcell, node)]);
bool subcell_matches = true;
unsigned node = 0;
while ( subcell_matches && (node < num_subcell_nodes) ) {
std::list<unsigned>::iterator search =
std::find(tmp_subcell_gid_list.begin(), tmp_subcell_gid_list.end(),
subcellGIDs[node]);
if (search == tmp_subcell_gid_list.end())
subcell_matches = false;
++node;
}
if (subcell_matches) {
found_local_subcell = true;
local_subcell = subcell;
}
++subcell;
}
TEUCHOS_TEST_FOR_EXCEPTION(!found_local_subcell, std::runtime_error,
"Failed to find subcell!");
return local_subcell;
}