Ensure elements in blocks are consecutive

Open
#25 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
performance

Research direction

Start by tracing where the mesh is read or generated and how element IDs are stored in blocks. Review JAX's ndarray indexing tools, especially indices_are_sorted and unique_indices, then determine whether sorting or adding block as a global array index is viable; done means block element IDs are consecutive and the performance-oriented loop can use the chosen design.

Written by the indexing model from the issue text.

Description

The element IDs in blocks are not enforced to be consecutive, which is bad for performance. We could sort the elements by block once the mesh is read in or generated. Look into the indices_are_sorted and unique_indices parameters on the jax ndarray indexing tools here.

Another possiblility is to make element block be another global array index, making the loop over blocks be vmap-able. For example, the shape function array would have 3 indices: [block][element][element node].

Dominant language
Python
Stars
54
Forks
24
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sandialabs/optimism

All issues in sandialabs/optimism

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.