Projet

Général

Profil

IO

Conduit

  • Conduit is an open source project from Lawrence Livermore National Laboratory that provides an intuitive model for describing hierarchical scientific data in C++, C, Fortran, and Python.
    It is used for data coupling between packages in-core, serialization, and I/O tasks.

    Conduit’s Core API provides:

    • A flexible way to describe hierarchal data:
    • A JSON-inspired data model for describing hierarchical in-core scientific data.
    • A sane API to access hierarchal data:
    • A dynamic API for rapid construction and consumption of hierarchical objects.
  • Aide sur le module

$ module help lib/conduit/0.9.5
-------------------------------------------------------------------
Module Specific Help for /softs/modulefiles/lib/conduit/0.9.5:

loads the  CONDUIT environment
 Conduit: Simplified Data Exchange for HPC Simulations
Compiled with :
 gcc14 and MPI enabled, PYTHON_API with devel/python/3.12.7 module and HDF5
 see https://llnl-conduit.readthedocs.io/en/latest/index.html

         usage : module load compilers/gcc/14.2.0 mpi/openmpi/5.0.5 lib/conduit/0.9.5
  • Usage
$ module load compilers/gcc/14.2.0 mpi/openmpi/5.0.5 lib/conduit/0.9.5

Exemple (python)

module load compilers/gcc/14.2.0 mpi/openmpi/5.0.5 lib/conduit/0.9.5 devel/python/3.12.7
from conduit.relay import io
import conduit.blueprint as blueprint
from conduit import Node

io_about = io.about()
has_adios = io_about["protocols"]["adios"] == "enabled"  # currently disabled on jarvis
has_hdf5 = io_about["protocols"]["hdf5"] == "enabled"    # currently enabled on jarvis
has_json = io_about["protocols"]["json"] == "enabled"    # currently enabled on jarvis
has_yaml = io_about["protocols"]["yaml"] == "enabled"    # currently enabled on jarvis

print(io_about.to_yaml())


def write(vertices_coordinates,elements_connectivity,esets):

     mesh = Node()
     mesh["coordsets/coords/type"] = "explicit"
     mesh["coordsets/coords/values/x"].set_external(vertices_coordinates[:,0])
     mesh["coordsets/coords/values/y"].set_external(vertices_coordinates[:,1])
     mesh["coordsets/coords/values/z"].set_external(vertices_coordinates[:,2])

    # add an unstructured topology
    mesh["topologies/mesh/type"] = "unstructured"
    # reference the coordinate set by name
    mesh["topologies/mesh/coordset"] = "coords"
    # set topology shape type
    mesh["topologies/mesh/elements/shape"] = "tet"
    flat_conn = elements_connectivity.flatten()
    #flat_conn = elements_connectivity[:,1:-1].flatten()
    mesh["topologies/mesh/elements/connectivity"].set_external(flat_conn)

    if esets is not None:
        mesh["fields/Material-Sets/association"] = "element"
        mesh["fields/Material-Sets/topology"] = "mesh"
        mesh["fields/Material-Sets/values"].set_external(esets)

    verify_info = Node()
    if not blueprint.mesh.verify(mesh,verify_info):
        print("Mesh Verify failed!")
        print(verify_info.to_yaml())
    else:
        print("Mesh verify success!")
        print("Continue to write mesh in json protocol!")
        io.blueprint.write_mesh(mesh,fname)

VTK

9.4.0

$ module help lib/vtk/9.4.0
-------------------------------------------------------------------
Module Specific Help for /softs/modulefiles/lib/vtk/9.4.0:

        modules - loads the VTK library environment

        This adds /softs/lib/vtk/9.4.0/* to several of the

        environment variables.

        Compiled w OPENMP MPI ;

        and VTK_USE_PARALLEL=ON (with OPENMPI)

        and VTK_SMP_IMPLEMENTATION=OPENMP

        Version 9.4.0


         usage : module load compilers/gcc/14.2.0 mpi/openmpi/5.0.5  lib/vtk/9.4.0
-------------------------------------------------------------------

9.6.0

module help lib/vtk/9.6.0
-------------------------------------------------------------------
Module Specific Help for /softs/modulefiles/lib/vtk/9.6.0:

        modules - loads the VTK library environment

        This adds /softs/lib/vtk/9.6.0/* to several of the

        environment variables.

        Compiled w OPENMP MPI ;

        and VTK_USE_PARALLEL=ON (with OPENMPI)

        and VTK_SMP_IMPLEMENTATION=OPENMP

        and VTK_MODULE_ENABLE_VTK_FiltersONNX=ON

        Version 9.6.0


         usage : module load compilers/gcc/14.2.0 mpi/openmpi/5.0.5  lib/vtk/9.6.0
-------------------------------------------------------------------