Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose sub-entity-type to Python interface #797

Open
jorgensd opened this issue Mar 25, 2024 · 0 comments
Open

Expose sub-entity-type to Python interface #797

jorgensd opened this issue Mar 25, 2024 · 0 comments

Comments

@jorgensd
Copy link
Sponsor Member

basix.cell.sub_entity_type is only available in C++:
https://github.com/search?q=repo%3AFEniCS%2Fbasix%20sub_entity_type&type=code

basix/cpp/basix/cell.cpp

Lines 379 to 400 in 0315c73

cell::type cell::sub_entity_type(cell::type celltype, int dim, int index)
{
const int tdim = cell::topological_dimension(celltype);
assert(dim >= 0 and dim <= tdim);
if (dim == 0)
return cell::type::point;
else if (dim == 1)
return cell::type::interval;
else if (dim == tdim)
return celltype;
const std::vector<std::vector<std::vector<int>>> t = cell::topology(celltype);
switch (t[dim][index].size())
{
case 3:
return cell::type::triangle;
case 4:
return cell::type::quadrilateral;
default:
throw std::runtime_error("Error in sub_entity_type");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant