Skip to main content

KRATOS Multiphysics ("Kratos") is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.

Project description

HDF5Application

The HDF5Application enables the serialization of a model part with or without MPI using the HDF5 library. The model part is stored in and HDF5 file, which can be used for:

  • Viewing a model part with HDFVIEW
  • Scientific visualization with tools supporting XDMF. Tools, which are known to work, include ParaView 5.4 and VisIt.
  • Checkpointing (under development).
  • Re-partitioning (not supported yet).

Installing HDF5 (minimum version 1.8)

The HDF5 C libraries are used with the HDF5Application. If Kratos is configured with MPI then the parallel HDF5 library must be installed. Otherwise, the serial HDF5 library is used.

Serial HDF5 Library

Ubuntu

    sudo apt-get install libhdf5-dev

Parallel HDF5 Library

Ubuntu

    sudo apt-get install libhdf5-openmpi-dev

Build Instructions

  1. Install serial or parallel HDF5 library

  2. Configure Kratos to build the HDF5Application (following the standard instructions)

    • For GNU/Linux:
    add_app ${KRATOS_APP_DIR}/HDF5Application
    
    • For Windows:
    CALL :add_app %KRATOS_APP_DIR%\HDF5Application;
    
  3. Build Kratos

Installing h5py

This package is needed to use some of the python-files, e.g. xdmf_utils.py

    sudo apt-get install python-h5py / python3-h5py

Note

The minimum version for the GCC compiler is 4.9. This is because earlier version don't fully support regular expressions.

Kratos processes

There are few available HDF5 processes which can be integrated into work flow via ProjectParameters.json file.

Initialization from hdf5 process

This process can be used to initialize a given model part using existing HDF5 files. Illustrated example reads in VELOCITY and PRESSURE variables from "hdf5_output/example_initialization_file.h5" file to nodal historical data value container, and nodal, elemental and condition non-historical data value containers. This process also can read FLAGS from HDF5 file and populate model part accordingly.

For the list_of_variables in either nodal_data_value_settings, element_data_value_settings, condition_data_value_settings one can specify ALL_VARIABLES_FROM_FILE which will read all the variables available in the input hdf5 file and will populate the model part accordingly. This ALL_VARIABLES_FROM_FILE should be used alone (There can be only this entry in the list if it is used).

            {
                "kratos_module": "KratosMultiphysics.HDF5Application",
                "python_module": "initialization_from_hdf5_process",
                "Parameters": {
                    "model_part_name": "MainModelPart",
                    "file_settings": {
                        "file_name": "hdf5_output/example_initialization_file.h5",
                        "echo_level": 1
                    },
                    "nodal_solution_step_data_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "nodal_data_value_settings": {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "element_data_value_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "condition_data_value_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "nodal_flag_value_settings": {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    },
                    "element_flag_value_settings" : {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    },
                    "condition_flag_value_settings" : {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    }
                }
            }

Single mesh temporal input process

This process is used to initialize model part variables at each time step from hdf5 files. You can specify the list of hdf5 files to read from by changing the "file_name" with tags <time> as shown in following example. If no <time> tag is present in "file_name", then same file will be read at each time step and the variables specified will be initialized. In this process, mesh is only read from the initial time step file. Results for each container will be read from time series h5 files.

For the list_of_variables in either nodal_data_value_settings, element_data_value_settings, condition_data_value_settings one can specify ALL_VARIABLES_FROM_FILE which will read all the variables available in the input hdf5 file and will populate the model part accordingly. This ALL_VARIABLES_FROM_FILE should be used alone (There can be only this entry in the list if it is used).

            {
                "kratos_module": "KratosMultiphysics.HDF5Application",
                "python_module": "single_mesh_temporal_input_process",
                "Parameters": {
                    "model_part_name": "MainModelPart",
                    "file_settings": {
                        "file_name": "hdf5_output/<model_part_name>-<time>.h5",
                        "time_format": "0.4f",
                        "echo_level": 1
                    },
                    "nodal_solution_step_data_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "nodal_data_value_settings": {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "element_data_value_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "condition_data_value_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "nodal_flag_value_settings": {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    },
                    "element_flag_value_settings" : {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    },
                    "condition_flag_value_settings" : {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    }
                }
            }

Single mesh temporal output process

This process can be used to output data from model parts to HDF5. This will write mesh only in the first time step h5 file. Rest of the time series h5 files will contain only results for each nodal/element/condition containers.

For the list_of_variables in nodal_solution_step_data_settings, one can specify ALL_VARIABLES_FROM_VARIABLES_LIST as the only item (Then this list should only have that entry) so it will write all the variables in the corresponding model's solution step variable list.

            {
                "kratos_module": "KratosMultiphysics.HDF5Application",
                "python_module": "single_mesh_temporal_output_process",
                "Parameters": {
                    "model_part_name": "MainModelPart",
                    "file_settings": {
                        "file_name": "hdf5_output/<model_part_name>-<time>.h5",
                        "time_format": "0.4f",
                        "max_files_to_keep": "unlimited",
                        "echo_level": 1
                    },
                    "output_time_settings": {
                        "step_frequency": 1,
                        "time_frequency": 1.0
                    },
                    "nodal_solution_step_data_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "nodal_data_value_settings": {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "element_data_value_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "element_gauss_point_value_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "condition_data_value_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "condition_gauss_point_value_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "nodal_flag_value_settings": {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    },
                    "element_flag_value_settings" : {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    },
                    "condition_flag_value_settings" : {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    }
                }
            }

Multiple mesh temporal output process

This process is used to output model part variable data to HDF5 with mesh written for each time step. This is useful in the case if required to write down deformed mesh in each time step.

For the list_of_variables in nodal_solution_step_data_settings, one can specify ALL_VARIABLES_FROM_VARIABLES_LIST as the only item (Then this list should only have that entry) so it will write all the variables in the corresponding model's solution step variable list.

            {
                "kratos_module": "KratosMultiphysics.HDF5Application",
                "python_module": "multiple_mesh_temporal_output_process",
                "Parameters": {
                    "model_part_name": "MainModelPart",
                    "file_settings": {
                        "file_name": "hdf5_output/<model_part_name>-<time>.h5",
                        "time_format": "0.4f",
                        "max_files_to_keep": "unlimited",
                        "echo_level": 1
                    },
                    "output_time_settings": {
                        "step_frequency": 1,
                        "time_frequency": 1.0
                    },
                    "model_part_output_settings": {
                        "prefix": "/ModelData"
                    },
                    "nodal_solution_step_data_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "nodal_data_value_settings": {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "element_data_value_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "element_gauss_point_value_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "condition_data_value_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "condition_gauss_point_value_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "nodal_flag_value_settings": {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    },
                    "element_flag_value_settings" : {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    },
                    "condition_flag_value_settings" : {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    }
                }
            }

Single mesh xdmf output process for Paraview

This process outputs model part variable data for each time step, additionally it writes down the XDMF file after each time step which is required to visualize HDF5 data in paraview. This process requires h5py to be installed in the python version (which is compiled with Kratos Multiphysics)

For the list_of_variables in nodal_solution_step_data_settings, one can specify ALL_VARIABLES_FROM_VARIABLES_LIST as the only item (Then this list should only have that entry) so it will write all the variables in the corresponding model's solution step variable list.

            {
                "kratos_module": "KratosMultiphysics.HDF5Application",
                "python_module": "single_mesh_xdmf_output_process",
                "Parameters": {
                    "model_part_name": "MainModelPart",
                    "file_settings": {
                        "file_name": "hdf5_output/<model_part_name>-<time>.h5",
                        "time_format": "0.4f",
                        "max_files_to_keep": "unlimited",
                        "echo_level": 1
                    },
                    "output_time_settings": {
                        "step_frequency": 1,
                        "time_frequency": 1.0
                    },
                    "model_part_output_settings": {
                        "prefix": "/ModelData"
                    },
                    "nodal_solution_step_data_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "nodal_data_value_settings": {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "element_data_value_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "condition_data_value_settings" : {
                        "list_of_variables": [
                            "VELOCITY",
                            "PRESSURE"
                        ]
                    },
                    "nodal_flag_value_settings": {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    },
                    "element_flag_value_settings" : {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    },
                    "condition_flag_value_settings" : {
                        "list_of_variables": [
                            "SLIP"
                        ]
                    }
                }
            }

User defined I/O process

Users can build their own I/O processes by using components of HDF5 application. Following is such example. This example writes model part, and DISPLACEMENT values for each time step at finalize_solution_step

            {
                "kratos_module": "KratosMultiphysics.HDF5Application",
                "python_module": "user_defined_io_process",
                "Parameters": {
                    "model_part_name": "MainModelPart",
                    "process_step": "finalize_solution_step",
                    "controller_settings": {
                        "controller_type": "temporal_controller",
                        "time_frequency": 0.5
                    },
                    "io_settings": {
                        "file_name": "results/<model_part_name>-<time>.h5"
                    },
                    "list_of_operations": [
                        {
                            "operation_type": "model_part_output"
                        },
                        {
                            "operation_type": "nodal_solution_step_data_output",
                            "list_of_variables": ["DISPLACEMENT"]
                        }
                    ]
                }
            }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

KratosHDF5Application-10.1.0-cp312-cp312-win_amd64.whl (790.7 kB view details)

Uploaded CPython 3.12 Windows x86-64

KratosHDF5Application-10.1.0-cp311-cp311-win_amd64.whl (790.0 kB view details)

Uploaded CPython 3.11 Windows x86-64

KratosHDF5Application-10.1.0-cp310-cp310-win_amd64.whl (789.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

KratosHDF5Application-10.1.0-cp39-cp39-win_amd64.whl (785.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

KratosHDF5Application-10.1.0-cp38-cp38-win_amd64.whl (789.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

File details

Details for the file KratosHDF5Application-10.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: KratosHDF5Application-10.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 790.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.31.0 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/6.8.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for KratosHDF5Application-10.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1b44f6668aa551cac3699edaaa7d2b96ee53741dfc921e92c5d90189f550db79
MD5 3a2279f7dcd7ca2fcfb17a69b576968e
BLAKE2b-256 1e2c3cdf3d42a466e66169fe5a149e95bb1df4b4b94381c2ea6c34a181aca32a

See more details on using hashes here.

File details

Details for the file KratosHDF5Application-10.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: KratosHDF5Application-10.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 790.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.31.0 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/6.8.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for KratosHDF5Application-10.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4d8293604d6d6d9b47f8ce1cea0da64ca96504337fc2b9985da065394796a513
MD5 e1bd6b2d17a452e5a1871c453bb68b43
BLAKE2b-256 b1e54ab0d172c4e29e640632be74ac9f2807616aa2c5ce8ea05914414b9e1bce

See more details on using hashes here.

File details

Details for the file KratosHDF5Application-10.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: KratosHDF5Application-10.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 789.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.31.0 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/6.8.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for KratosHDF5Application-10.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b4deacb98415b4b481e54712a1bb4d19b591808dbafea0725bb0e77c9ca8566f
MD5 77568f0597141724af2511f1b48f089b
BLAKE2b-256 ff9a93e0d666757c3f1e12ec320a0b415e83769c7d9cae535c0135d405483a93

See more details on using hashes here.

File details

Details for the file KratosHDF5Application-10.1.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: KratosHDF5Application-10.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 785.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.31.0 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/6.8.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for KratosHDF5Application-10.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 54179af2d3542bc3c4b1c65ea86ed253e07801e83ba745952dc00c7f1f521db7
MD5 41e37bc2bcff924d38231fb8cfe9889a
BLAKE2b-256 834a10b0dae58c9f7aeb2495acea432cd8bd636942e0b1568d1c3bf3e631deed

See more details on using hashes here.

File details

Details for the file KratosHDF5Application-10.1.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: KratosHDF5Application-10.1.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 789.2 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.31.0 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/6.8.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for KratosHDF5Application-10.1.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 cd60c5a07a3d3979507d94cfc55bcbedac37c9f3b5da83e5872102585e37c6a4
MD5 fff9c1afddf6295609f4a6051b672205
BLAKE2b-256 942a026779c325356d8558b4a68f358badcd017d2a0f2c732fb070cfc9befec3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page