Example #1
0
int get_entity_subcell_id(const BulkData& mesh,
        const Entity entity,
        const EntityRank subcell_rank,
        stk::topology subcell_topology,
        const std::vector<Entity>& subcell_nodes)
{
    ThrowAssert(subcell_rank <= stk::topology::ELEMENT_RANK);
    const int INVALID_SIDE = -1;

    stk::topology entity_topology = mesh.bucket(entity).topology();
    ThrowAssert(entity_topology.num_nodes() == mesh.num_nodes(entity));

    const Entity* entity_nodes = mesh.begin_nodes(entity);
    std::vector<Entity> topology_sub_nodes(subcell_nodes.size());

    for(size_t i = 0; i < entity_topology.num_sub_topology(subcell_rank); ++i)
    {
        entity_topology.sub_topology_nodes(entity_nodes, subcell_rank, i, topology_sub_nodes.begin());
        if(subcell_topology.equivalent(topology_sub_nodes, subcell_nodes).first)
        {
            return i;
        }
    }

    return INVALID_SIDE;
}
Example #2
0
stk::mesh::Permutation get_permutation_of_side_nodes(stk::topology sideTopology,
        const stk::mesh::Entity *sideNodes,
        const stk::mesh::Entity *elemSideNodes)
{
    std::pair<bool, unsigned> result = sideTopology.equivalent(sideNodes, elemSideNodes);
    return static_cast<stk::mesh::Permutation>(result.second);
}