Skip to content

Commit

Permalink
Add 'Auto-refinement' section at the end of README.md and reference it
Browse files Browse the repository at this point in the history
in CHANGELOG and the beginning of README.md.
  • Loading branch information
v-dobrev committed Jul 31, 2024
1 parent db0e2f6 commit 570e57d
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Version 4.2.1 (development)
data (mesh and grid function). The new refinement is chosen to be sufficient
for resolving the curvature of the data, but only if we can do that with less
than 2M vertices and 16 refinements. Otherwise, we print a warning and the
user may still needs to press 'o' to fully resolve the data.
user may still need to press 'o' to fully resolve the data. For more details,
see the section Auto-refinement in README.md.

- Significantly improved memory usage.

Expand Down
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ is a partial list of the available functionality. Some of these keys can also be
provided as input, using the `-k` command-line option and the `keys` script
command.

For high-order meshes and/or solution data, GLVis performs element subdivision
to try to represent the data more accurately. However, for highly-varying data
or large meshes, the auto-selected subdivision factor (see the
[Auto-refinement](#auto-refinement) section below) may not be sufficient -- use
the keys <kbd>o</kbd> / <kbd>O</kbd>, described below, to manually adjust the
subdivision factor.

SPDX-License-Identifier: BSD-3-Clause <br>
LLNL Release Number: LLNL-CODE-443271 <br>
Expand Down Expand Up @@ -298,3 +304,46 @@ Key commands
- `x`-component: `v_x`
- `y`-component: `v_y`
- `z`-component: `v_z`

## Auto-refinement

The GLVis auto-refinement algorithm selects a subdivision factor trying to
achieve an accurate representation of high-order meshes and solution data while
keeping the initial time to visualize the data reasonable. The algorithm can be
summarized as follows:
- GLVis draws surface elements; the number of drawn elements, `ne`, is either:
- the number of elements in the mesh for 2D meshes (including surface meshes,
i.e. 2D meshes embedded in 3D space), or
- the number of boundary mesh elements described by the mesh in 3D.
- A tentative upper limit on the number of vertices to be drawn is defined based
on the maximum order of the mesh and the solution, `max_order`:
```
max_vert = ne * (max_order + 1) * (max_order + 1)
```
- To allow more accurate representation for small meshes, this number is
potentially increased:
```
max_vert = max(max_vert, 100 000)
```
- To keep the time to initially visualize the data reasonable, this number is
potentially reduced:
```
max_vert = min(max_vert, 2 000 000)
```
- Finally, the subdivision factor `ref` is chosen to be the largest number such
that:
- the number of vertices needed to draw the `ne` surface elements with `ref`
subdivisions does not exceed `max_vert`:
```
ne * (ref + 1) * (ref + 1) <= max_vert
```
- for large meshes where the above limit cannot be satisfied, set `ref = 1`
- for small meshes, avoid excessive refinements:
```
ref <= 16
```
Note that, for highly-varying data or large meshes, this auto-selected
subdivision factor may not be sufficient for accurate representation. In such
cases the sudivision can be manually adjusted using the keys <kbd>o</kbd> /
<kbd>O</kbd>, described above.

0 comments on commit 570e57d

Please sign in to comment.