本文整理汇总了C++中Basis::getBaseCellTopology方法的典型用法代码示例。如果您正苦于以下问题:C++ Basis::getBaseCellTopology方法的具体用法?C++ Basis::getBaseCellTopology怎么用?C++ Basis::getBaseCellTopology使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Basis
的用法示例。
在下文中一共展示了Basis::getBaseCellTopology方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getLocalToGlobalMap
void getLocalToGlobalMap(int (*local2global)[2],
int &off_global,
const Basis<Scalar,ArrayType> &basis,
const int *element) {
const int local = 0, global = 1;
const int nbf = basis.getCardinality();
const shards::CellTopology cell = basis.getBaseCellTopology();
const int dim = cell.getDimension();
int cnt = 0, off_element = 0;
int subcell_verts[4], nids;
const int nvert = cell.getVertexCount();
for (int i=0;i<nvert;++i) {
const int ord_vert = (off_element < nbf ? basis.getDofOrdinal(0, i, 0) : 0);
const int dof_vert = (off_element < nbf ? basis.getDofTag(ord_vert)[3] : 0);
local2global[cnt][local] = off_element;
off_element += dof_vert;
Orientation::getElementNodeMap(subcell_verts, nids,
cell, element,
0, i);
if (!findNode(local2global[cnt][global], subcell_verts, nids, true)) {
addNode(subcell_verts, nids, off_global);
local2global[cnt][global] = off_global;
off_global += dof_vert;
}
++cnt;
}
const int nedge = cell.getEdgeCount();
for (int i=0;i<nedge;++i) {
const int ord_edge = (off_element < nbf ? basis.getDofOrdinal(1, i, 0) : 0);
const int dof_edge = (off_element < nbf ? basis.getDofTag(ord_edge)[3] : 0);
local2global[cnt][local] = off_element;
off_element += dof_edge;
Orientation::getElementNodeMap(subcell_verts, nids,
cell, element,
1, i);
if (!findNode(local2global[cnt][global], subcell_verts, nids, true)) {
addNode(subcell_verts, nids, off_global);
local2global[cnt][global] = off_global;
off_global += dof_edge;
}
++cnt;
}
const int nface = cell.getFaceCount();
for (int i=0;i<nface;++i) {
const int ord_face = (off_element < nbf ? basis.getDofOrdinal(2, i, 0) : 0);
const int dof_face = (off_element < nbf ? basis.getDofTag(ord_face)[3] : 0);
local2global[cnt][local] = off_element;
off_element += dof_face;
Orientation::getElementNodeMap(subcell_verts, nids,
cell, element,
2, i);
if (!findNode(local2global[cnt][global], subcell_verts, nids, true)) {
addNode(subcell_verts, nids, off_global);
local2global[cnt][global] = off_global;
off_global += dof_face;
}
++cnt;
}
{
const int i = 0;
const int ord_intr = (off_element < nbf ? basis.getDofOrdinal(dim, i, 0) : 0);
const int dof_intr = (off_element < nbf ? basis.getDofTag(ord_intr)[3] : 0);
local2global[cnt][local] = off_element;
off_element += dof_intr;
Orientation::getElementNodeMap(subcell_verts, nids,
cell, element,
dim, i);
if (!findNode(local2global[cnt][global], subcell_verts, nids, true)) {
addNode(subcell_verts, nids, off_global);
local2global[cnt][global] = off_global;
off_global += dof_intr;
}
++cnt;
}
// add the last offset
local2global[cnt][local] = off_element;
local2global[cnt][global] = -1; // invalid values
}