Mesh transformation utilities for FEMTIC-based magnetotelluric inverse modeling.
MeshTran is a lightweight preprocessing toolkit designed to prepare spatial data and computational domains for the Finite Element Magnetotelluric Inversion Code, FEMTIC (Y. Usui, 2015). The objective of this project is not to replace FEMTIC utilities, but to provide a structured preprocessing layer that simplifies coordinate transformations, domain definition, and mesh preparation steps commonly required before running large-scale MT inversions.
The toolkit focuses on reproducible preparation of FEMTIC input files from observational data and geospatial datasets. In particular, MeshTran aims to reduce the complexity of preparing the FEMTIC preprocessing input data by allowing most mesh preparation steps to be controlled from a single configuration file.
MeshTran is also designed as a component of the broader MTIF (Magnetotelluric Inversion Framework) ecosystem, where it acts as the geometry and preprocessing layer prior to running the inversion workflow.
Current utilities support the following preprocessing tasks:
- Reading MT station information from EDI files
- Coordinate transformation (latitude/longitude → UTM → mesh coordinates)
- Domain centering and coordinate normalization
- DEM and bathymetry integration
- Automated generation of FEMTIC input files
- Preparation of geometry and inputs for
makeTetraMeshand TetGen - Simplified configuration of FEMTIC meshing parameters
- Basic validation utilities for domain consistency
A key goal of MeshTran is to simplify FEMTIC mesh configuration. Instead of manually editing multiple preprocessing files, users can define the required parameters in a single configuration input, from which MeshTran generates the corresponding FEMTIC input files.
The typical preprocessing pipeline implemented in MeshTran follows these steps:
- Read EDI files and extract station latitude, longitude, and elevation
- Convert geographic coordinates to UTM coordinates
- Convert spatial data from meters to kilometers
- Compute the geometric center of the station distribution
- Transform coordinates into the FEMTIC mesh reference system
- Define the computational analysis domain in mesh coordinates
- Validate domain coverage with DEM and padding constraints
- Generate FEMTIC input files
observe.dat
control.dat→ (mesh build)topography.datbathymetry.datcoastline.datobserving_site.datanalysis_domain.dat
makeMtr.paramobs_site.dat
output.X.nodeoutput.X.eleoutput.X.faceoutput.X.neighresistivity_attr.dat
resistivity_block_iter0.datmesh.datoutput.*.femtic.vtk
The general workflow takes information from DEM file, converts EDI files and wrap preprocessing utilities (makeTetraMesh and TetGen) to generate the final tetrahedral mesh used by FEMTIC to run an inversion.
The control.dat file (not generated by MeshTran), which defines the inversion parameters, should be created manually according to the desired configuration.
The repository is organized as follows:
MeshTran/
├─ Makefile
├── readme.md
├── computing
├── MeshTran (executable)
├── mod
├── bin
│ ├── set_meshtran.io
│
├── preprocessing
│ ├── buildMesh
│ ├── DEM
│ ├── edi_files
│ └── geometry
│
└── src
├── mesh_config.f90
├── mesh_entities.f90
└── meshTranFemtic.f90
The structure may evolve as the project matures.
A minimal preprocessing workflow using MeshTran typically follows these steps:
- Put the
DEM.xyzandEDI filesinpreprocessing/folder - Provide a configuration (
*.io) file describing the dataset and meshing parameters. - Run the MeshTran preprocessing pipeline.
- Generate FEMTIC input files automatically.
Run:
make
then
./meshTranPreprocessing
This command processes station data, prepares the computational domain, and generates the required FEMTIC preprocessing files.
In typical FEMTIC workflows, mesh preparation requires editing multiple configuration files and manually adjusting meshing parameters. MeshTran simplifies this process by centralizing these parameters into a single input configuration.
(in preparation)
MeshTran is designed to function as a preprocessing component within the MTIF (Magnetotelluric Inversion Framework).
Within MTIF, configuration is typically handled using structured configuration files (e.g. TOML), which are more expressive and easier to maintain than the traditional FEMTIC plaintext input files. MeshTran acts as the intermediate layer that translates these higher-level configuration parameters into the FEMTIC input format required by the meshing and inversion pipeline.
MeshTran depends on the FEMTIC mesh generation tools and standard Fortran compilers.
Requirements:
- makeTetraMesh
- TetGen
- makeMtr
- TetGen2Femtic
- Fortran compiler (
ifort,ifx, or compatible)
Additional geospatial preprocessing tools may be required depending on the workflow.
This project is currently under active development and is still in its early stages. However, it already covers the necessary preprocessing steps required to generate the input files needed to run land magnetotelluric inversion models with FEMTIC.
Interfaces and utilities may evolve as the preprocessing workflow matures. The code is primarily developed to support FEMTIC-based magnetotelluric inversion research.
Contributions, suggestions, and bug reports are welcome.
If you encounter an issue, have ideas for improvements, or would like to collaborate on the project, please open an Issue or submit a Pull Request.
Feedback from the magnetotelluric and geophysical modeling community is especially appreciated.