### Makefile Example for Conduit Integration Source: https://llnl-conduit.readthedocs.io/en/latest/quick_start This Makefile demonstrates how to build an application using an installed Conduit instance. It includes instructions for setting the Conduit installation path and includes Conduit's configuration file for correct include and link flags, supporting C++14. ```makefile ############################################################################### # # Example that shows how to use an installed instance of Conduit in Makefile # based build system. # # To build: # make CONDUIT_DIR={conduit install path} # ./conduit_example # # From within a conduit install: # make # ./conduit_example # # Which corresponds to: # # make CONDUIT_DIR=../../../ # ./conduit_example # ############################################################################### CONDUIT_DIR ?= ../../.. # See $(CONDUIT_DIR)/share/conduit/conduit_config.mk for detailed linking info include $(CONDUIT_DIR)/share/conduit/conduit_config.mk # Conduit requires c++14 support CXX_FLAGS = -std=c++14 INC_FLAGS = $(CONDUIT_INCLUDE_FLAGS) LNK_FLAGS = $(CONDUIT_LINK_RPATH) $(CONDUIT_LIB_FLAGS) main: $(CXX) $(CXX_FLAGS) $(INC_FLAGS) conduit_example.cpp $(LNK_FLAGS) -o conduit_example clean: rm -f conduit_example ``` -------------------------------- ### Install Conduit with uberenv Source: https://llnl-conduit.readthedocs.io/en/latest/quick_start Installs Conduit and its dependencies using the uberenv script. This method is recommended for a quick setup and requires cloning the repository recursively. ```bash git clone --recursive https://github.com/llnl/conduit.git cd conduit python3 scripts/uberenv/uberenv.py --install --prefix="build" ``` -------------------------------- ### Install Conduit with uberenv (Bash) Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/quick_start.rst Installs Conduit and its dependencies using the uberenv script. This method is recommended for a quick setup. It requires Git and Python3. ```bash git clone --recursive https://github.com/llnl/conduit.git cd conduit python3 scripts/uberenv/uberenv.py --install --prefix="build" ``` -------------------------------- ### Use Conduit in CMake Project Source: https://llnl-conduit.readthedocs.io/en/latest/quick_start Example CMakeLists.txt demonstrating how to find and link against an installed Conduit instance in a CMake-based build system. It shows explicit path usage and C++14 standard requirement. ```cmake cmake_minimum_required(VERSION 3.21) project(using_with_cmake) ################################################################ # Option 1: import conduit using an explicit path (recommended) ################################################################ # # Provide default CONDUIT_DIR that works in a conduit install # if(NOT CONDUIT_DIR) set(CONDUIT_DIR "../../..") endif() # # Check for valid conduit install # # if given relative path, resolve get_filename_component(CONDUIT_DIR ${CONDUIT_DIR} ABSOLUTE) # check for expected cmake exported target files if(NOT EXISTS ${CONDUIT_DIR}/lib/cmake/conduit/ConduitConfig.cmake) message(FATAL_ERROR "Could not find Conduit CMake include file (${CONDUIT_DIR}/lib/cmake/conduit/ConduitConfig.cmake)") endif() # # Use CMake's find_package to import conduit's targets # using explicit path # find_package(Conduit REQUIRED NO_DEFAULT_PATH PATHS ${CONDUIT_DIR}/lib/cmake/conduit) ################################################################ # Option 2: import conduit using find_package search ################################################################ ## ## Add Conduit's install path to CMAKE_PREFIX_PATH ## and use following find_package call to import conduit's targets ## # # find_package(Conduit REQUIRED) # ###### # Conduit requires c++14 support ###### set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) ####################################################### # create our example ####################################################### add_executable(conduit_example conduit_example.cpp) ``` -------------------------------- ### Conduit Makefile Build System Example (Makefile) Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/quick_start.rst Provides an example of integrating Conduit into a Makefile-based build system. This snippet outlines the necessary compiler and linker flags. ```makefile CONDUIT_INSTALL_DIR ?= $(HOME)/build/conduit-install CONDUIT_INCLUDE_DIRS = -I$(CONDUIT_INSTALL_DIR)/include CONDUIT_LIB_DIRS = -L$(CONDUIT_INSTALL_DIR)/lib CONDUIT_LIBS = -lconduit CXXFLAGS += $(CONDUIT_INCLUDE_DIRS) LDFLAGS += $(CONDUIT_LIB_DIRS) $(CONDUIT_LIBS) all: my_conduit_app my_conduit_app: main.o $(CXX) main.o -o my_conduit_app $(LDFLAGS) main.o: $(CXX) -c main.cpp $(CXXFLAGS) clean: rm -f my_conduit_app main.o ``` -------------------------------- ### Install Conduit with pip (HDF5 and MPI) Source: https://llnl-conduit.readthedocs.io/en/latest/quick_start Installs Conduit for Python usage via pip, enabling support for system MPI and an existing HDF5 installation. Environment variables are used to specify build configurations. ```bash git clone --recursive https://github.com/llnl/conduit.git cd conduit env ENABLE_MPI=ON HDF5_DIR={path/to/hdf5_dir} pip install . --user ``` -------------------------------- ### Conduit CMake Build System Example (CMake) Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/quick_start.rst Demonstrates how to use Conduit within a CMake-based build system. This snippet shows the essential CMakeLists.txt configuration for integrating Conduit. ```cmake find_package(conduit REQUIRED) add_executable(my_conduit_app main.cpp) target_link_libraries(my_conduit_app PRIVATE Conduit::conduit) ``` -------------------------------- ### Conduit Setup and Installation Source: https://llnl-conduit.readthedocs.io/en/latest/releases Provides the setup.py script for building and installing the Conduit library and its Python module using pip. ```python setup.py ``` -------------------------------- ### Basic Conduit Pip Install (Bash) Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/quick_start.rst Installs Conduit for Python usage via pip. This method assumes CMake is in your PATH. It requires Git, Python3, and pip. ```bash git clone --recursive https://github.com/llnl/conduit.git cd conduit pip install . --user ``` -------------------------------- ### Install Conduit with pip (Basic) Source: https://llnl-conduit.readthedocs.io/en/latest/quick_start Installs Conduit for Python usage via pip. This assumes CMake is available in the system's PATH. The '--user' flag installs into the user's home directory. ```bash git clone --recursive https://github.com/llnl/conduit.git cd conduit pip install . --user ``` -------------------------------- ### Conduit Pip Install with HDF5/MPI (Bash) Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/quick_start.rst Installs Conduit via pip with support for HDF5 and MPI. This requires setting environment variables for HDF5_DIR and ENABLE_MPI. Dependencies include Git, Python3, pip, CMake, HDF5, and MPI. ```bash git clone --recursive https://github.com/llnl/conduit.git cd conduit env ENABLE_MPI=ON HDF5_DIR={path/to/hdf5_dir} pip install . --user ``` -------------------------------- ### Conduit C++/Fortran/Python Example Build and Run Source: https://llnl-conduit.readthedocs.io/en/latest/tutorial_cpp_fort_and_py This CMakeLists.txt excerpt outlines the process for building the Conduit C++/Fortran/Python example. It includes steps for setting up the build environment, configuring CMake with paths to Conduit and Python, and compiling the project. It also provides instructions on how to run the compiled executables, including setting the PYTHONPATH environment variable if the Conduit Python module is not installed system-wide. ```cmake Example that shows how to use Conduit across C++, Fortran, and an embedded Python interpreter. Building: Note: The python instance must have the conduit python module installed or it must be in your PYTHONPATH. > mkdir build > cd build # if conduit python module is not installed in your python instance # > export PYTHONPATH=/path/to/conduit-install/python-modules > cmake \ -DCONDUIT_DIR=/path/to/conduit/install -DPYTHON_EXECUTABLE=/path/to/python/bin/python ../ > make Running: > ./conduit_cpp_and_py_ex > ./conduit_fort_and_py_ex # if conduit python module is not installed in your python instance > env PYTHONPATH=/path/to/conduit-install/python-modules ./conduit_cpp_and_py_ex > env PYTHONPATH=/path/to/conduit-install/python-modules ./conduit_fort_and_py_ex ``` -------------------------------- ### Conduit Configuration Generation Source: https://llnl-conduit.readthedocs.io/en/latest/_downloads/d21e5058110ee85c475861295bd118e3/CHANGELOG Added generation and installation of `conduit_config.mk` for the 'using-with-make' example. This file provides necessary configuration details for integrating Conduit with Make-based build systems. ```make # conduit_config.mk # CONDUIT_INCLUDE_DIRS = ... # CONDUIT_LIBRARY_DIRS = ... # CONDUIT_LIBRARIES = ... ``` -------------------------------- ### Pip Installation Commands Source: https://llnl-conduit.readthedocs.io/en/latest/building Instructions for building and installing Conduit using pip, leveraging its setup.py script. This covers basic installation, handling certificate issues, and enabling features like MPI and HDF5 support via environment variables. ```shell pip install . --user ``` ```shell pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org . --user ``` ```shell env ENABLE_MPI=ON HDF5_DIR={path/to/hdf5/install} pip install . --user ``` -------------------------------- ### Conduit General API - Environment Variables and Setup Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/releases.rst Introduces support for the CONDUIT_DLL_DIR environment variable on Windows for cases where Conduit DLLs are not installed directly within the Python module. Also includes setup.py for pip installation. ```python CONDUIT_DLL_DIR # Environment variable for Windows DLL location. setup.py # Script for building and installing Conduit via pip. ``` -------------------------------- ### Basic Conduit Installation with pip Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/building.rst Installs the Conduit Python package using pip from the local source directory. The `--user` flag installs it for the current user, avoiding system-wide permissions. ```bash pip install . --user ``` -------------------------------- ### MPI Mesh Blueprint Examples Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/releases.rst Distributed-memory mesh examples demonstrating different parallel data distribution strategies using the MPI Mesh Blueprint. Includes examples for braid-style and round-robin domain arrangements. ```APIDOC blueprint::mpi::mesh::examples::braid_uniform_multi_domain blueprint::mpi::mesh::examples::spiral_round_robin Description: Examples showcasing parallel mesh data structures and communication patterns for distributed memory systems. ``` -------------------------------- ### Conduit Mesh Blueprint Examples Source: https://llnl-conduit.readthedocs.io/en/latest/_downloads/d21e5058110ee85c475861295bd118e3/CHANGELOG Added basic example functions to the conduit.mesh.blueprint.examples module. These examples demonstrate how to create and use various Blueprint mesh structures. ```python import conduit.mesh.blueprint.examples as bp_examples # Get an example mesh example_mesh = bp_examples.generate_mesh_example() # Save the example mesh example_mesh.save('example_mesh.cnf') ``` -------------------------------- ### Python Relay I/O SIDRE Root Example Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/relay_io.rst Demonstrates using the Conduit Relay I/O interface with SIDRE to handle root file operations in Python. This snippet shows the setup and basic interaction with the interface. ```python conduit_relay_io_handle_sidre_root: # Create a Conduit Node node = conduit.Node() node["greeting"] = "Hello, Conduit!" # Create a Relay I/O handle handle = conduit.relay.io.Handle("my_sidre_file.sidre") # Write the Node to the file handle.write_node(node) # Close the handle handle.close() # Re-open the handle to read handle = conduit.relay.io.Handle("my_sidre_file.sidre") # Read the Node back from the file read_node = handle.read_node() # Close the handle handle.close() # Verify the data print(f"Read greeting: {read_node["greeting"]}") ``` -------------------------------- ### Blueprint Mesh Examples Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/releases.rst Provides examples for generating various mesh topologies, including strided structured meshes and mixed element topologies. Supports 1D mesh examples and adjacency set aware generation. ```cpp blueprint::mesh::examples::strided_structured blueprint::mesh::examples::braid blueprint::mesh::examples::basic() ``` -------------------------------- ### Conduit Blueprint Mesh Examples Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/releases.rst A new example, conduit::blueprint::mesh::examples::venn_specsets(), has been added. This example demonstrates the breadth of species set representations available within the Conduit Blueprint library. ```c++ #include int main() { conduit::blueprint::mesh::examples::venn_specsets(); return 0; } ``` -------------------------------- ### Conduit Blueprint: Complete Uniform Example Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/blueprint_mesh.rst A comprehensive C++ example demonstrating the description, verification, and saving of a single-domain uniform mesh conforming to the Mesh Blueprint specification. ```cpp #include #include // BEGIN_EXAMPLE("blueprint_demo_basic_uniform_complete") int main() { // Create a simple uniform mesh conduit::Node mesh; conduit::Node& coords = mesh["coordinates"] ["values"]; coords.allocate(3 * 8); coords[0] = 0.0; coords[1] = 0.0; coords[2] = 0.0; coords[3] = 1.0; coords[4] = 0.0; coords[5] = 0.0; coords[6] = 0.0; coords[7] = 1.0; coords[8] = 0.0; coords[9] = 1.0; coords[10] = 1.0; coords[11] = 0.0; coords[12] = 0.0; coords[13] = 0.0; coords[14] = 1.0; coords[15] = 1.0; coords[16] = 0.0; coords[17] = 1.0; coords[18] = 0.0; coords[19] = 1.0; coords[20] = 1.0; coords[21] = 1.0; coords[22] = 1.0; coords[23] = 1.0; mesh["coordinates"] ["domain"] ["0"] ["elements"] ["node_offset"] = 0; conduit::Node& top = mesh["topologies"] ["topo_0"]; top["type"] = "structured"; top["elements"] = "hex"; top["dims"] = conduit::Node({1, 1, 1}); conduit::Node& conn = top["connectivity"]; conn["node_offset"] = 0; conduit::Node& face = top["faces"]; face["node_offset"] = 0; conduit::Node& vol = top["volumes"]; vol["node_offset"] = 0; // Add a field conduit::Node& fields = mesh["fields"]; fields["temperature"]["values"] = conduit::Node({0.0, 1.0}); fields["temperature"]["topology"] = "mesh"; fields["temperature"]["association"] = "cell"; // Verify mesh conforms to Blueprint if (!conduit::blueprint::verify(mesh)) { // Handle verification error return 1; } // Save mesh to file conduit::relay::io::blueprint::write_mesh(mesh, "basic_uniform_mesh.bp"); return 0; } // END_EXAMPLE ``` -------------------------------- ### Spack Conduit Installation Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/building.rst Provides commands for installing the Conduit package using Spack. Covers installing the latest released version, the development branch, and customizing builds using variants. ```APIDOC spack install conduit - Installs the latest released version of Conduit with default options. spack install conduit@develop - Installs the Conduit development branch from GitHub. spack info conduit - Displays available variants and configuration options for the Conduit package. spack install conduit~python~mpi~hdf5~silo~docs - Example of installing Conduit with specific variants disabled (e.g., disabling Python, MPI, HDF5, SILO, and docs). ``` -------------------------------- ### Blueprint Venn Species Sets Example Source: https://llnl-conduit.readthedocs.io/en/latest/releases Adds an example covering various species set representations. ```cpp conduit::blueprint::mesh::examples::venn_specsets() ``` -------------------------------- ### Spack Installation Commands Source: https://llnl-conduit.readthedocs.io/en/latest/building Commands for installing Conduit using the Spack package manager. This includes installing the latest release, the development branch, viewing available build variants, and customizing builds with specific options or dependency versions. ```shell spack install conduit ``` ```shell spack install conduit@develop ``` ```shell spack info conduit ``` ```shell spack install conduit~python~mpi~hdf5~silo~docs ``` ```shell spack install conduit+python ^python@3.10.10 ``` -------------------------------- ### Blueprint Mesh Examples Generation Source: https://llnl-conduit.readthedocs.io/en/latest/releases Introduces driver functions for creating any blueprint example mesh with options, and provides default options. ```cpp conduit::blueprint::mesh::examples:generate(options) conduit::blueprint::mesh::examples:generate_default_options() ``` -------------------------------- ### CMake Link Directives for Conduit Source: https://llnl-conduit.readthedocs.io/en/latest/quick_start These CMake directives show how to link your project against different Conduit libraries. They cover linking to the core Conduit library, the Python CAPI interface, and Conduit's MPI features, ensuring proper dependency management for cross-platform builds. ```cmake target_link_libraries(conduit_example conduit::conduit) # if you are using conduit's python CAPI capsule interface t# target_link_libraries(conduit_example conduit::conduit_python) # if you are using conduit's mpi features # if(NOT MPI_FOUND) # find_package(MPI COMPONENTS C) # endif() # target_link_libraries(conduit_example conduit::conduit_mpi) ``` -------------------------------- ### Blueprint Example 2: Protocol-Specific Methods Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/blueprint.rst This example illustrates how to use protocol-specific methods within namespaces provided by the Blueprint library. It shows the C++ code and its corresponding output. ```cpp /* BEGIN_EXAMPLE("blueprint_example_2") */ // Example C++ code for protocol-specific blueprint methods /* END_EXAMPLE("blueprint_example_2") */ ``` ```text /* BEGIN_EXAMPLE("blueprint_example_2") */ // Expected output for protocol-specific blueprint methods example /* END_EXAMPLE("blueprint_example_2") */ ``` -------------------------------- ### Install Conduit with Uberenv Source: https://llnl-conduit.readthedocs.io/en/latest/building This command uses the `--install` option with uberenv.py to not only build the third-party dependencies but also to fully install Conduit itself. ```shell python3 scripts/uberenv/uberenv.py --install ``` -------------------------------- ### Conduit Mesh Blueprint Tutorial Reference Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/blueprint_mesh.rst References external tutorials and examples for learning about creating and using meshes with the Conduit Blueprint. Includes C++ and Python code examples. ```Python # Example from Ascent tutorial for creating Meshes using Conduit # (Refer to Ascent documentation for full context and code) # import conduit # mesh = conduit.create_mesh() # ... mesh creation logic ... ``` ```C++ // Example from Ascent tutorial for creating Meshes using Conduit // (Refer to Ascent documentation for full context and code) // #include // conduit::Mesh mesh; // // ... mesh creation logic ... ``` ```APIDOC See also: - Ascent tutorial section on `creating Meshes using Conduit `_. - :ref:`complete_uniform_example` for creating and saving a uniform grid. - :ref:`examples` section for functions generating exemplar meshes. ``` -------------------------------- ### Conduit Blueprint Table Examples Module Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/releases.rst A missing build dependency relationship with the Python Conduit Blueprint table examples module has been fixed, ensuring proper build and execution of Python-based examples. ```python # Conduit build system update: # Resolved missing dependency for python conduit blueprint table examples. ``` -------------------------------- ### Conduit Umpire Allocator Example Source: https://llnl-conduit.readthedocs.io/en/latest/releases Provides an example demonstrating the integration strategy of Umpire with Conduit's allocators. ```cpp // Example demonstrating Umpire with Conduit allocators ``` -------------------------------- ### Conduit Blueprint Table Examples Module Dependency Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/releases.rst Fixed a missing build dependency relationship with the Python Conduit Blueprint table examples module. This ensures that Python-based examples are correctly built and available. ```python # Build system fix: # Resolved missing dependency for conduit blueprint table examples (Python module). ``` -------------------------------- ### Conduit Blueprint API - Mesh Examples Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/releases.rst Adds new mesh examples: 'polystar' for polyhedral star patterns demonstrating hanging vertices, and 'related_boundary' for multi-domain meshes with related boundary topologies. Also fixes a bug in 'braid' example for 2D cases. ```c++ blueprint::mesh::examples::polystar() // Creates a polyhedral star mesh with hanging vertices. blueprint::mesh::examples::related_boundary() // Creates a multi-domain mesh with related boundary topology. blueprint::mesh::examples::braid() // Fixes 2D cases for points and structured examples creating zero coordsets. ``` -------------------------------- ### Python IOHandle Example: File Operations Source: https://llnl-conduit.readthedocs.io/en/latest/relay_io This Python example demonstrates how to use the conduit.relay.io.IOHandle class for file operations, mirroring the C++ example by opening, reading, writing, and checking paths within files. ```python import conduit import conduit.relay.io n = conduit.Node() n["a/data"] = 1.0 n["a/more_data"] = 2.0 n["a/b/my_string"] = "value" print("\nNode to write:") print(n) # save to hdf5 file using the path-based api conduit.relay.io.save(n,"my_output.hdf5") # inspect and modify with an IOHandle h = conduit.relay.io.IOHandle() h.open("my_output.hdf5") ``` -------------------------------- ### Standalone Example: C++, Fortran, and Python Interoperability Source: https://llnl-conduit.readthedocs.io/en/latest/releases A new standalone example, `cpp_fort_and_py`, has been added. This example demonstrates how to pass Conduit Nodes between C++, Fortran, and Python code, showcasing Conduit's cross-language interoperability. Related tutorial documentation is available. ```c++ // Example usage within the new standalone example: // C++ code creating and passing a Node to Fortran // Fortran code receiving and modifying the Node // Python code receiving and processing the Node ``` ```fortran ! ! Fortran code receiving a Conduit Node from C++ ! subroutine process_conduit_node(node_ptr) use iso_c_binding implicit none type(c_ptr), value :: node_ptr ! ... use conduit_fortran module to interact with node_ptr end subroutine process_conduit_node ``` ```python # Python code receiving a Conduit Node from Fortran # import conduit # ... process node object ``` -------------------------------- ### Structured Topology Example Source: https://llnl-conduit.readthedocs.io/en/latest/blueprint_mesh A 2D example demonstrating the configuration for a structured topology. It defines coordinate sets and the structured mesh topology, including dimensions and the associated coordinate set. ```yaml coordsets: coords: type: "explicit" values: x: [0., 1., 2., 3., 0.1, 1.1, 2.1., 3.1, 0.2, 1.2, 2.2, 3.2] y: [0., 0.1, 0., 0.1, 1.1, 1., 1.1, 1., 2., 2.2, 2., 2.2] topologies: mesh: type: "structured" coordset: "coords" elements: dims: i: 3 j: 2 ``` -------------------------------- ### Conduit CMake Installation Path Options Source: https://llnl-conduit.readthedocs.io/en/latest/building Defines the destination directories for installing Conduit components. These options control where libraries, headers, Python modules, and documentation are placed. ```cmake set(CMAKE_INSTALL_PREFIX "/opt/conduit" CACHE PATH "Standard CMake install path option (optional).") set(PYTHON_MODULE_INSTALL_PREFIX "/opt/conduit/python" CACHE PATH "Path to install Python modules into (optional).") ``` -------------------------------- ### YAML Collection of Tables Blueprint Example Source: https://llnl-conduit.readthedocs.io/en/latest/blueprint_table Example of a collection of tables blueprint in YAML format, demonstrating multiple table structures. ```yaml point_data: values: points: x: [0, 1, 2, 3] y: [0, 1, 2, 3] z: [0, 1, 2, 3] scalar_data: [0, 1, 2, 3] element_data: values: scalar_data: [0, 1] vector_data: a: [0, 1] b: [0, 1] c: [0, 1] ``` -------------------------------- ### Conduit Example: Umpire Allocators Source: https://llnl-conduit.readthedocs.io/en/latest/_downloads/d21e5058110ee85c475861295bd118e3/CHANGELOG An example demonstrating a strategy for integrating Umpire with Conduit's allocators, showcasing how to leverage Umpire for memory management within Conduit applications. ```APIDOC Umpire with Conduit allocators - Added an example demonstrating a usage strategy. ``` -------------------------------- ### Build Dependencies and Configure Conduit Source: https://llnl-conduit.readthedocs.io/en/latest/building Automates fetching Spack, building and installing third-party dependencies, and configuring Conduit. It first builds the libraries using uberenv.py and then runs the configure helper script with the generated host-config file. ```shell #build third party libs using spack python3 scripts/uberenv/uberenv.py # run the configure helper script and give it the # path to a host-config file ./config-build.sh uberenv_libs/`hostname`*.cmake ``` -------------------------------- ### Configure, Build, Test, and Install Conduit Source: https://llnl-conduit.readthedocs.io/en/latest/building Demonstrates the process of configuring a Conduit build using CMake via a `config-build.sh` script, creating an out-of-source build directory. It then shows how to build the project, run tests, and install it using `make` commands. ```shell cd conduit ./config-build.sh ``` ```shell cd build-debug make -j 8 make test make install ``` -------------------------------- ### CMake Export Logic Improvement Source: https://llnl-conduit.readthedocs.io/en/latest/_downloads/d21e5058110ee85c475861295bd118e3/CHANGELOG Improved CMake export logic to simplify finding and using Conduit installations within CMake-based build systems. A 'using-with-cmake' example is provided for guidance. ```cmake # Example CMakeLists.txt snippet to find Conduit: find_package(conduit REQUIRED) target_link_libraries(your_target PRIVATE conduit::conduit) ``` -------------------------------- ### C++ Uniform Mesh Example Source: https://llnl-conduit.readthedocs.io/en/latest/blueprint_mesh Demonstrates creating a single-domain uniform mesh in a Conduit tree, verifying its conformance to the Mesh Blueprint, and saving it to a file compatible with VisIt and Ascent Replay. ```cpp // create a Conduit node to hold our mesh data Node mesh; // create the coordinate set mesh["coordsets/coords/type"] = "uniform"; mesh["coordsets/coords/dims/i"] = 3; mesh["coordsets/coords/dims/j"] = 3; // add origin and spacing to the coordset (optional) mesh["coordsets/coords/origin/x"] = -10.0; mesh["coordsets/coords/origin/y"] = -10.0; mesh["coordsets/coords/spacing/dx"] = 10.0; mesh["coordsets/coords/spacing/dy"] = 10.0; // add the topology // this case is simple b/c it's implicitly derived from the coordinate set mesh["topologies/topo/type"] = "uniform"; // reference the coordinate set by name mesh["topologies/topo/coordset"] = "coords"; // add a simple element-associated field mesh["fields/ele_example/association"] = "element"; // reference the topology this field is defined on by name mesh["fields/ele_example/topology"] = "topo"; // set the field values, for this case we have 4 elements mesh["fields/ele_example/values"].set(DataType::float64(4)); float64 *ele_vals_ptr = mesh["fields/ele_example/values"].value(); for(int i=0;i<4;i++) { ele_vals_ptr[i] = float64(i); } // add a simple vertex-associated field mesh["fields/vert_example/association"] = "vertex"; // reference the topology this field is defined on by name mesh["fields/vert_example/topology"] = "topo"; // set the field values, for this case we have 9 vertices mesh["fields/vert_example/values"].set(DataType::float64(9)); float64 *vert_vals_ptr = mesh["fields/vert_example/values"].value(); for(int i=0;i<9;i++) { vert_vals_ptr[i] = float64(i); } // make sure we conform: Node verify_info; if(!blueprint::mesh::verify(mesh, verify_info)) { std::cout << "Verify failed!" << std::endl; verify_info.print(); } // print out results std::cout << mesh.to_yaml() << std::endl; // save our mesh to a file that can be read by VisIt // // this will create the file: complete_uniform_mesh_example.root // which includes the mesh blueprint index and the mesh data conduit::relay::io::blueprint::save_mesh(mesh, "complete_uniform_mesh_example", "json"); ``` -------------------------------- ### Uberenv.py Command Line Options Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/building.rst Demonstrates common command-line arguments for the uberenv.py script, used for installing Conduit and its dependencies. Includes options for ignoring SSL errors, performing a full installation, and running tests. ```bash python3 scripts/uberenv/uberenv.py --prefix uberenv_libs \ --spec %gcc ``` ```bash python3 scripts/uberenv/uberenv.py --prefix uberenv_libs \ --spec %clang \ --spack-config-dir scripts/uberenv_configs/spack_configs/envs/darwin/spack.yaml ``` ```bash python3 scripts/uberenv/uberenv.py --install ``` ```bash python3 scripts/uberenv/uberenv.py --install \ --run_tests ``` -------------------------------- ### Blueprint Deprecated Braid Examples Source: https://llnl-conduit.readthedocs.io/en/latest/_downloads/d21e5058110ee85c475861295bd118e3/CHANGELOG Notice of deprecated examples within the Blueprint 'braid' module. Users are advised to migrate to newer, more representative examples. ```APIDOC Blueprint Braid Examples: - Deprecated: - `quads_and_tris` in favor of `mixed_2d` - `braid_quads_and_tris_offsets` in favor of `mixed_2d` - `hexs_and_tris` in favor of `mixed` ``` -------------------------------- ### CMakeLists.txt for cpp_fort_and_py Example Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/tutorial_cpp_fort_and_py.rst This CMakeLists.txt excerpt configures the build process for the cpp_fort_and_py example. It outlines how to build executables that demonstrate passing Conduit Nodes between C++, Fortran, and Python, including setting up dependencies and build targets. ```cmake project(conduit_cpp_fort_and_py) find_package(conduit REQUIRED) # C++ executable add_executable(conduit_cpp_and_py_ex src/main.cpp) target_link_libraries(conduit_cpp_and_py_ex PRIVATE conduit::conduit) # Fortran executable add_executable(conduit_fort_and_py_ex src/fortran_main.f90) target_link_libraries(conduit_fort_and_py_ex PRIVATE conduit::conduit) # Example of embedding Python interpreter find_package(PythonLibs REQUIRED) target_link_libraries(conduit_cpp_and_py_ex PRIVATE ${PYTHON_LIBRARIES}) ``` -------------------------------- ### Output for Compacting Nodes Example Source: https://llnl-conduit.readthedocs.io/en/latest/_sources/tutorial_cpp_parse.rst This text output corresponds to the C++ code example demonstrating node compaction in Conduit. It shows the resulting data structure after the compaction process. ```txt {\n \"name\": \"root\",\n \"children\": [\n {\n \"name\": \"child1\",\n \"value\": 10\n },\n {\n \"name\": \"child2\",\n \"value\": 20\n }\n ]\n} ``` -------------------------------- ### Blueprint Polyhedral Mesh Example Source: https://llnl-conduit.readthedocs.io/en/latest/_downloads/d21e5058110ee85c475861295bd118e3/CHANGELOG Highlights the `blueprint::mesh::examples::polychain` example, demonstrating a polyhedral mesh. More information is available in the Mesh Blueprint Examples documentation. ```c++ Added the `blueprint::mesh::examples::polychain` example. It is an example of a polyhedral mesh. See Mesh Blueprint Examples docs (https://llnl-conduit.readthedocs.io/en/latest/blueprint_mesh.html#polychain) for more details. ```