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

Create tiled mesh example function. #1167

Merged
merged 51 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
6ea3c7f
Added code to generate tiled meshes, plus a data generation program.
BradWhitlock Aug 28, 2023
e2b0e3b
Fixed a bug
BradWhitlock Aug 28, 2023
98f936e
2D boundaries
BradWhitlock Aug 28, 2023
300794e
Boundary fix
BradWhitlock Aug 28, 2023
20032bb
Roughed in 3D boundaries
BradWhitlock Aug 28, 2023
984a541
Remove obsolete comment
BradWhitlock Aug 28, 2023
d3a6c8c
Added method to access sorted index.
BradWhitlock Sep 2, 2023
b71f2c4
Prototyping zone reordering function - needs fixes + cleanup still.
BradWhitlock Sep 2, 2023
7fce7d7
Fixed indexing bug
BradWhitlock Sep 5, 2023
7a7a5bd
change a template type from T to CoordinateType
BradWhitlock Sep 6, 2023
50e6cba
Clean up
BradWhitlock Sep 6, 2023
4ef1a3b
Moved a function. Converted code to use index_t.
BradWhitlock Sep 6, 2023
40a54f2
Made kdtree findPoint return conduit::index_t
BradWhitlock Sep 6, 2023
cdc7623
Moved slice_array from partitioner to mesh utils.
BradWhitlock Sep 6, 2023
888bb34
Allow reorder into the same topo nodes.
BradWhitlock Sep 6, 2023
781d67f
Remove some std::move in return statements as it is not needed.
BradWhitlock Sep 6, 2023
bea2218
Renumber boundary nodes if we are reordering the elements.
BradWhitlock Sep 6, 2023
7d6a20c
Explored using partition for reordering. Moved reorder function.
BradWhitlock Sep 7, 2023
16eefc4
Make the index type selectable through options in tiled function.
BradWhitlock Sep 7, 2023
50358cb
Added coordset to_expicit function.
BradWhitlock Sep 7, 2023
a146c4e
Added a fast path in spatial_ordering.
BradWhitlock Sep 7, 2023
fbaf607
Removed stray prints.
BradWhitlock Sep 7, 2023
8cab634
Allow extents to be provided and used to generate tiled mesh.
BradWhitlock Sep 7, 2023
bb44160
Changed boundary routines so they are based on iteration that calls a…
BradWhitlock Sep 8, 2023
cedd002
Added adjset generation.
BradWhitlock Sep 8, 2023
0ecbb61
Small braid fix
BradWhitlock Sep 8, 2023
9a60344
Allow setting mesh and boundary names via options node for tiler.
BradWhitlock Sep 8, 2023
25ca426
Rename a field.
BradWhitlock Sep 9, 2023
8ffa16b
Make boundary_attribute values 1-origin.
BradWhitlock Sep 11, 2023
891f19c
Changes to face traversal order to make better adjset
BradWhitlock Sep 13, 2023
3b29b7a
Added adjset comparison function that lets us make sure each point is…
BradWhitlock Sep 14, 2023
b6b47f5
More adjset testing
BradWhitlock Sep 14, 2023
e45fe6e
Change adjset to_pairwise function so it appends points starting with…
BradWhitlock Sep 14, 2023
2bb934f
Added a new test that makes tiled meshes in parallel, makes their cor…
BradWhitlock Sep 14, 2023
ddda2ef
Compiler warnings.
BradWhitlock Sep 15, 2023
8998d79
Added a 12 domain test case that finds a bug.
BradWhitlock Sep 15, 2023
d5a79b7
Support reading alternate tiles in blueprint form.
BradWhitlock Sep 15, 2023
f5b6223
Fixes for tiling
BradWhitlock Sep 15, 2023
2e350aa
Working on adjset
BradWhitlock Sep 19, 2023
5bc4bf1
Undo to_pairwise changes.
BradWhitlock Sep 19, 2023
9bd4a0d
Changed how 3D adjsets work in tiled mesh generator.
BradWhitlock Sep 19, 2023
7718f66
Added a test for 3D meshes that had failed before.
BradWhitlock Sep 19, 2023
512ff37
Added some doc for the tiled function.
BradWhitlock Sep 20, 2023
e581e5f
Changed the reorder option for tiled to a string.
BradWhitlock Sep 20, 2023
818b575
Upped Conduit version.
BradWhitlock Sep 20, 2023
444531f
Added some missing items in CHANGELOG.md.
BradWhitlock Sep 20, 2023
7d573c8
Merged develop into branch.
BradWhitlock Sep 20, 2023
a97e13a
Removed errant ifdef guard in a cpp file.
BradWhitlock Sep 20, 2023
330719e
Fixed a comment. Fixed a typo in CHANGELOG.md.
BradWhitlock Sep 20, 2023
fba4998
Added missing include.
BradWhitlock Sep 20, 2023
7f8be28
Add float32/float64 cases in slice_array. Fix typos in tiled sphinx doc.
BradWhitlock Sep 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ and this project aspires to adhere to [Semantic Versioning](https://semver.org/s

#### General
- Added `conduit_json_external` protocol. Creates a json schema representation of a node that includes all addresses that the node is pointing to. Parsing this schema will create a node equivalent to `set_external()`.
- Added a `conduit_generate_data` executable that can generate datasets using the `tiled()` and `braid()` functions and save the datasets to files.

#### Relay
- Added ability to read N-dimensional hyperslabs from HDF5 leaf arrays into linear memory arrays.

#### Blueprint
- Added a `conduit::blueprint::mesh::examples::tiled()` function that can generate meshes by repeating a tiled pattern.
- Added a `conduit::blueprint::mpi::mesh::utils::adjset::compare_pointwise()` function that can compare adjsets for multi-domain meshes in parallel. The function is used to diagnose adjsets with points that are out of order on either side of the boundary. The comparison is done point by point within each group and it checks to ensure that the points reference the same spatial location.
- Added a `conduit::blueprint::mesh::utils::reorder()` function that can accept a vector of element ids and create a reordered topology. The points and coordinates are re-ordered according to their first use in the new element ordering.
- Added a `conduit::blueprint::mesh::utils::topology::spatial_ordering()` function that takes a topology and computes centroids for each element, passes them through a kdtree, and returns the new element ordering. The new ordering can be used with the `reorder()` function.
- Added a `conduit::blueprint::mesh::utils::slice_array()` function that can slice Conduit nodes that contain arrays. A new node with the same type is created but it contains only the selected indices.
- Added a `conduit::blueprint::mesh::utils::slice_field()` function. It is like `slice_array()` but it can handle the mcarray protocol. This functionality was generalized from the partitioner.

### Changed

Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ endif()
# Conduit
################################

project(conduit VERSION "0.8.8")
project(conduit VERSION "0.8.9")

################################
# Build Options
Expand Down
85 changes: 85 additions & 0 deletions src/docs/sphinx/blueprint_mesh.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,91 @@ equal to half the number of prisms.

The resulting data is placed the Node ``res``, which is passed in via reference.


tiled
+++++++++

The ``tiled()`` function repeats a tile (given as a 2D Blueprint topology) into a larger mesh composed of
a regular square tiling of the supplied tile. If no topology is given, a default pattern consisting of quads
is used. The output mesh can be either 2D or 3D. For 3D, supply a ``nz`` parameter greater than zero. Note
that the input tile must consist of a homogeneous set of triangles or quads to extrude the tile into 3D since
polyhedral output is not yet supported. The ``tiled()`` function produces a single domain comprised of a
main mesh, a boundary mesh, and adjacency sets if the output mesh is to be part of a multi-domain dataset.

.. code:: cpp

conduit::blueprint::mesh::examples::tiled(index_t nx, // number of tiles along x
index_t ny, // number of tiles along y
index_t nz, // number of elements along z (0 for 2D)
conduit::Node &res, // result container
const conduit::Node &options);// options node

The ``tiled()`` function accepts a Conduit node containing options that influence how the mesh is generated.
If the options contain a ``tile`` node that contains a 2D blueprint topology, the first supplied topology will
be used to override the default tile pattern. The ``reorder`` option indicates the type of point and element
reordering that will be done. Reordering can improve cache-friendliness. The default is to reorder points
and elements, using "kdtree" method. Passing "none" or an empty string will prevent reordering.
The name of the mesh can be given by passing a ``meshname`` option string. Likewise, the name of the boundary
mesh can be supplied using the ``boundarymeshname`` option. The optional ``translate/x`` and ``translate/y``
options determine the tile spacing. If the translation values are not given, they will be determined from
the coordset extents. The output mesh topology will store its integer connectivity information as index_t
by default. The precision of the integer output can turned to int32 by passing a ``datatype`` option containing
the "int", "int32", "integer" strings.

An important set of options define the left, right, bottom, and top sets of points within the supplied tile
pattern. The values in the ``left`` option identify the list of points that define the left edge of the tile.
These are indices into the coordset and the values should be in consecutive order along the edge. Opposite point
sets must match. In other words, the left and right point sets must contain the same number of points and
they need to proceed along their edges in the same order. The same is true of the bottom and top point sets.

The ``tiled()`` function also accepts options that simplify the task of generating
mesh domains for a multi-domain dataset. The coordinate extents of the current mesh domain are given using
the ``extents`` option, which contains 6 double values: {xmin, xmax, ymin, ymax, zmin, zmax}. The ``domains``
option contains a triple of {domainsI, domainsJ, domainsK} values that indicate how many divisions there are
of the extents in the I,J,K dimensions. The product of these numbers determines the total number of domains.
The ``domain`` option specifies a triple indicating the I,J,K domain id within the overall set of domains.
This is used to help construct adjacency sets.

.. code:: yaml

# Define the tile topology
tile:
coordsets:
coords:
type: explicit
values:
x: [0., 1., 2., 0., 1., 2., 0., 1., 2.]
y: [0., 0.5, 0., 1., 1.5, 1., 2., 2.5, 2.]
topologies:
tile:
type: unstructured
coordset: coords
elements:
shape: tri
connectivity: [0,1,4, 0,4,3, 1,2,5, 1,5,4, 3,4,7, 3,7,6, 4,5,8, 4,8,7]
# Set some options that aid tiling.
reorder: 1
left: [0,3,6]
right: [2,5,8]
bottom: [0,1,2]
top: [6,7,8]
translate:
x: 2.
y: 2.

.. figure:: tiled_single.png
:width: 400px
:align: center

Pseudocolor plot of zoneid for default tile mesh that has been reordered.

.. figure:: tiled.png
:width: 600px
:align: center

Subset plots of multi-domain datasets created using the ``tiled()`` function.


miscellaneous
++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion src/docs/sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Contributors
- Mark Miller (LLNL)
- Todd Gamblin (LLNL)
- Kevin Huynh (LLNL)
- Brad Whitlock (Intelligent Light)
- Brad Whitlock (LLNL)
- Chris Laganella (Intelligent Light)
- George Aspesi (Harvey Mudd)
- Justin Bai (Harvey Mudd)
Expand Down
Binary file added src/docs/sphinx/tiled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/docs/sphinx/tiled_single.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/executables/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
# other details. No copyright assignment is required to contribute to Conduit.

add_subdirectory(adjset_validate)
add_subdirectory(generate_data)
36 changes: 36 additions & 0 deletions src/executables/generate_data/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) Lawrence Livermore National Security, LLC and other Conduit
# Project developers. See top-level LICENSE AND COPYRIGHT files for dates and
# other details. No copyright assignment is required to contribute to Conduit.

if(ENABLE_UTILS)
blt_add_executable(
NAME conduit_generate_data
SOURCES conduit_generate_data.cpp
OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS_ON conduit conduit_blueprint conduit_relay
FOLDER utils
)

# add install target
install(TARGETS conduit_generate_data
RUNTIME DESTINATION bin)

################################################################
# If we have mpi, add a parallel version.
################################################################

if(MPI_FOUND)
blt_add_executable(
NAME conduit_generate_data_mpi
SOURCES conduit_generate_data.cpp
OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}
DEFINES CONDUIT_PARALLEL
DEPENDS_ON conduit conduit_blueprint conduit_relay conduit_relay_mpi_io ${conduit_blt_mpi_deps}
FOLDER utils
)

# add install target
install(TARGETS conduit_generate_data_mpi
RUNTIME DESTINATION bin)
endif()
endif()
Loading
Loading