medio

medio is a library that enables input and output of mesh files for FreeFEM in .med format.

https://github.com/mohd-afeef-badri/medio

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.7%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

medio is a library that enables input and output of mesh files for FreeFEM in .med format.

Basic Info
  • Host: GitHub
  • Owner: mohd-afeef-badri
  • License: lgpl-2.1
  • Language: C++
  • Default Branch: main
  • Homepage:
  • Size: 155 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 1
  • Releases: 1
Created over 2 years ago · Last pushed 9 months ago
Metadata Files
Readme License Citation

Readme.md

Medio is a library designed to facilitate the input and output of mesh files for FreeFEM in the med format, which is the native mesh format utilized by SALOME, an open-source pre/post-processing tool known for its robust capabilities in computational engineering and simulation.

Medio bridges the gap between FreeFEM and SALOME, enabling seamless data exchange and promoting interoperability between these powerful tools.

Dependencies

To compile and use Medio, you will need the following dependencies: - FreeFEM (version 4.15) - MedCoupling (version 9.14) - MPI

Compilation

Compilation with precompiled MedCoupling (install procedure 1)

Below, we present a step-by-step guide on how to compile and install Medio with precompiled MedCoupling support for FreeFEM:

Prepare the Build Configuration:

Run the following command to prepare the build configuration: bash autoreconf -i

Configure the Build:

Now, let's configure the build by specifying the necessary options using the configure script: bash ./configure \ --prefix=/home/Work/tmp/medio \ --with-medcoupling=/home/Install/TarPackages/SALOME-9.14.0-native-UB24.04/BINARIES-UB24.04/MEDCOUPLING \ --with-medfile=/home/Install/TarPackages/SALOME-9.14.0-native-UB24.04/BINARIES-UB24.04/medfile \ --with-hdf5=/home/Install/TarPackages/SALOME-9.14.0-native-UB24.04/BINARIES-UB24.04/hdf5

In this configuration: - medio will be installed in the /home/Work/tmp/medio/lib directory. You can choose a directory that you wish to install medio.
- The root directories for medcoupling , medfile, and hdf5 which come as precompiled with SALOME are provided /home/Install/TarPackages/SALOME-9.14.0-native-UB24.04/BINARIES-UB24.04/. To get your precompiled SALOME click here. - To proceed with the build, ensure that FreeFEM is already installed and available in your $PATH. If not use flag --with-FreeFEM to configure with FreeFEM installed elsewhere.

Please note you will need to adapt each flag to your specific system.

Compile medio:

With the configuration set, it's time to compile medio and make sure it is ready for use: bash make

Install medio:

Once the compilation process is successful, proceed to install medio using the following command: bash make install By following these steps, you should have successfully compiled and installed medio linked with precompiled MedCoupling support for FreeFEM.

Compilation with MedCoupling (install procedure 2)

Here is a step-by-step guide for the typical compilation process:

Prepare the Build Configuration:

Begin by running the following command to set up the build configuration: bash autoreconf -i

Configure the Build:

Next, use the configure script to configure the build with the required options: bash ./configure \ --prefix=/home/Work/tmp/medio \ --with-dependencies

In this configuration:

  • medio will be installed in the /home/Work/tmp/medio/lib directory. You can choose a directory that you wish to install medio.
  • After successfull install, the root directories for medcoupling, medfile, and hdf5 will be automatically located in ext/MEDCOUPLING-9.14.0-MPI/INSTALL.
  • Ensure that FreeFEM is already installed and available in your $PATH. If not use flag --with-FreeFEM to configure with FreeFEM installed elsewhere.
Compile medio:

With the configuration set, it's time to compile medio and make sure it is ready for use: bash make

Install medio:

Once the compilation process is successful, proceed to install medio using the following command: bash make install By following these steps, you should have successfully compiled and installed medio linked with MedCoupling support for FreeFEM.

Check the compilation

To ensure a successful compilation, you can run the following command to perform checks: make check

Note

to use and run medio please make sure that your $LD_LIBRARY_PATH variable contains medcoupling, medfile, and hdf5 paths. For example for the install above

bash export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/Install/TarPackages/SALOME-9.14.0-native-UB24.04/BINARIES-UB24.04/MEDCOUPLING/lib:/home/Install/TarPackages/SALOME-9.14.0-native-UB24.04/BINARIES-UB24.04/medfile/lib:/home/Install/TarPackages/SALOME-9.14.0-native-UB24.04/BINARIES-UB24.04/hdf5/lib By following these steps, you will have successfully compiled and installed Medio with MedCoupling support for FreeFEM, allowing smooth mesh file handling and data exchange between FreeFEM and SALOME. Don't forget to set the necessary environment variables to ensure seamless operation. Enjoy utilizing the power and efficiency of medio in your computational simulations!

Examples

Example 1: saving the med mesh

savemedmesh([MESH], [STRING]) used to save two-dimensional (mesh), three-dimensional (mesh3), three-dimensional surfasic(meshS), three-dimensional curve (meshL) meshes from FreeFEM. Simple example is shown for two-dimensional (mesh) case, the same logic works for others. find more examples in test/FreeFEM/Test_1.edp

load "medio"; // load medio lib mesh Th = square (12,12); // 2D mesh savemedmesh(Th, "test2D.med"); // save to med format

Example 2: loading the med mesh

[MESH] = loadmedmesh([STRING], meshname = [STRING]) used to load two-dimensional (mesh), three-dimensional (mesh3), three-dimensional surfasic(meshS), three-dimensional curve (meshL) meshes from FreeFEM. Simple example is shown for two-dimensional (mesh) case, the same logic works for others. find more examples in test/FreeFEM/Test_2.edp

load "medio"; // load medio lib mesh Th = square (31,1); savemedmesh(Th, "test2DLoad.med"); Th=loadmedmesh("test2DLoad.med", meshname = "TriangularMesh"); plot (Th,wait=1);

Example 3: getting boundary tags via group names

For any finite element mesh SALOME lets you create groups which can be named [STRINGS] so that boundary conditions or other conditions (initilization, multi-material..) can be applied upon these during solving. However within FreeFEM world these groups are represented by [INTEGER] tags. medio function getMedLabelsOnGroup(INT[INT], [STRING],[STRING]) provides interface so that [STRING] group lables can be used in FreeFEM. As an example

``` load "medio"; // load medio lib int[int] labelMed; getMedLabelsOnGroup( labelMed,"test2DLoad.med","edgegroup1"); cout << labelMed << endl;

varf Dirichlet(u,v) = on(labelMed, u =0); ```

Owner

  • Name: Mohd Afeef Badri
  • Login: mohd-afeef-badri
  • Kind: user
  • Location: France
  • Company: CEA -- French Alternative Energies and Atomic Energy Commission

Researcher at CEA - French Alternative Energies and Atomic Energy Commission

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: >-
  medio: An Open-source Library Bridging Finite Element
  Kernels and SALOME for Enhanced Mesh Data Interoperability
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Mohd Afeef
    family-names: Badri
    affiliation: CEA
    orcid: 'https://orcid.org/0000-0002-4646-8309'
repository-code: 'https://github.com/mohd-afeef-badri/medio'
abstract: >-
  Medio is a library designed to facilitate the input and
  output of mesh files for finite element kernels (e.g.,
  FreeFEM) in the med format, which is the native mesh
  format utilized by SALOME, an open-source
  pre/post-processing tool known for its robust capabilities
  in computational engineering and simulation.

  Medio bridges the gap between finite element kernels and
  SALOME, enabling seamless data exchange and promoting
  interoperability between the worlds of finite element and
  meshing.
keywords:
  - meshing
  - finite element method
license: LGPL-2.1

GitHub Events

Total
  • Delete event: 2
  • Push event: 2
  • Pull request event: 2
Last Year
  • Delete event: 2
  • Push event: 2
  • Pull request event: 2

Dependencies

.github/workflows/UB24.04.yml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v4 composite