[](https://zenodo.org/badge/latestdoi/276864022)
# FEMT2D
This repository contains the MATLAB toolbox `FEMT2D`.
It provides a discretization of Helmholtz type PDE's in two dimensions using first or second order Lagrange elements on triangular meshes.
## Requirements
Besides a basic MATLAB installation, a mesh generator is required for setting up the triangulation. Currently, only triangular meshes generated by the [_Triangle_ library](https://www.cs.cmu.edu/~quake/triangle.html) (references see below) are supported.
To make the creation of 2-D triangular meshes more user-friendly, the installation of [PyGIMLi](http://www.pygimli.org) is strongly recommended.
`FEMT2D` has been tested with MATLAB R2020a. Earlier releases work well also. Also note that compatibility with [Octave](http://www.octave.org) has not been tested.
To activate rendering of $\LaTeX$ expressions within this `README.md`, download and activate this [Chrome extension](https://chrome.google.com/webstore/detail/mathjax-plugin-for-github/ioemnmodlmafdkllaclgeombjnmnbima).
#### References
* FEMT2D: FE simulation of 2D Magnetotellurics in MATLAB. https://doi.org/10.5281/zenodo.3955407
* Jonathan Richard Shewchuk, _Triangle: Engineering a 2D Quality Mesh Generator and Delaunay Triangulator_, in "Applied Computational Geometry: Towards Geometric Engineering" (Ming C. Lin and Dinesh Manocha, editors), volume 1148 of Lecture Notes in Computer Science, pages 203-222, Springer-Verlag, Berlin, May 1996.
* Jonathan Richard Shewchuk, _Delaunay Refinement Algorithms for Triangular Mesh Generation_, Computational Geometry: Theory and Applications 22(1-3):21-74, May 2002.
* Franke, A., Börner, R. U., & Spitzer, K. (2007). *Adaptive unstructured grid finite element simulation of two-dimensional magnetotelluric fields for arbitrary surface and seafloor topography*. Geophysical Journal International, 171(1), 71-86.
* Börner, R. U. (2010). Numerical modelling in geo-electromagnetics: advances and challenges. Surveys in Geophysics, 31(2), 225-245.
* Rücker, C., Günther, T., Wagner, F.M., 2017. pyGIMLi: An open-source library for modelling and inversion in geophysics, Computers and Geosciences, 109, 106-123, doi: 10.1016/j.cageo.2017.07.011.
## Installation
Clone this repository.
```bash
git clone https://github.com/ruboerner/FEMT2D.git
```
Then enter the newly created folder `FEMT2D`:
```bash
cd FEMT2D
```
## Quick start
For a quick demonstration, simply call
```matlab
>> demo.driverWeaver
```
which loads a triangular mesh, and evaluates the response of two quarter-spaces for a given period at predefined observation points.
A few typical plots, such as profiles of apparent resistivities, phases, and magnetic transfer functions will be generated.
## Folder structure
Inside the `FEMT2D` folder, there are a few subfolders. The folders with leading `+`, e.g., `+fe`, contain _packages_ and have their own namespace.
```
FEMT2D
├── +demo
├── +fe
├── +mesh
├── +mt
├── +plot
├── +tools
├── Notebooks
├── meshes
```
From the top-level folder `FEMT2D` you can start a demonstration by typing, e.g.,
```matlab
demo.driverCOMMEMI_2D_0
```
which will calculate the model responses of model 2D-0 from the _COMMEMI_ model suite.
The folder `Notebooks` contains example _Jupyter Notebooks_ which introduce the user into the process of mesh generation using _PyGIMLi_.
Each of these Notebooks creates a particular set of files in the folder `meshes`. The meshes can later be read by routines which reside in the `+mesh` folder.
## Details of the toolbox
After reading in a _Triangle_ triangulation file, the mesh topology is stored within a MATLAB `struct`.
```matlab
mesh = mesh.getMesh('filename', 'meshes/commemi2d0.1', 'format', 'triangle');
```
`'filename'` corresponds to the basename of a mesh file in the `meshes` folder. Note that the actual files have the extensions `.poly`, `.ele`, and `.node`.
If the files in the `meshes` folder are, e.g.,
```
meshes
├── commemi2d0.1.ele
├── commemi2d0.1.node
├── commemi2d0.1.poly
```
then the corresponding `filename` in the parameter list of `mesh.getMesh()` would be `commemi2d0.1`.
### The `mesh` structure
The `mesh` structure contains the following fields:
| field name | dimension | description |
|------------|:--------------------|-------------|
| `node` | `2 x np` | node coordinates |
| `tri2node` | `3 x nt` | table of triangles defined by their indices as listed in the array `node` |
| `tri2subdomain` | `1 x nt` | array of subdomain number each triangle belongs to |
| `marker` | `1 x nt` | array of attributes associated with nodes |
| `edge2node` | `2 x ne` | table of edges and their node indices |
| `tri2edge`| `3 x nt` | table of edges and their associated triangle index |
| `nt` | scalar | number of triangles $n_t$ |
| `np` | scalar | number of nodes $n_p$ |
| `ne` | scalar | number of edges $n_e$ |
| `bdEdges` | vector | indices of boundary edges |
| `bdNodes` | vector | indices of boundary nodes |
| `Bk` | `2 x 2 x nt` | array of matrices defining the affine map $B_k$ from reference element to each of the $k=1,\dots,n_t$ domain elements |
| `Binv` | `2 x 2 x nt` | array of matrices $B_k^{-1}$ |
| `detBk` | `nt x 1` | array of determinants of $B_k$, $\text{det}(B_k)$ |
| `area` | `nt x 1` | array of all $k=1,\dots,n_t$ triangular element surface areas, i.e., `area = 0.5 * detBk` |
|
### The `fem` structure
The finite element method associates the triangulation with specific basis functions defined on the elements and identifies the degrees of freedom (DOFS).
```matlab
freq = 0.01;
sigma = [1e-1, 1e-1, 1e-2, 1e-2, 1e-14];
mu = ones(size(sigma));
fem = fe.FEMproblem('mesh', mesh, ...
'elementtype', 'Lagrange', ...
'order', 2, 'dimension', 2, ...
'sigma', sigma, 'mu', mu, ...
'polarization', 'both', ...
'frequency', freq, ...
'verbose', true);
```
As one can conclude from the above example, the mesh consists of five subdomains each of which is associated with a unique parameter (here `sigma` denotes the electrical conductivity $\sigma$ given in S/m and `mu` is the relative magnetic permeability $\mu_r$, such that $\mu = \mu_r \mu_0$ with $\mu_0 = 4 \pi \cdot10^{-7}$ Vs/Am).
In the given example, the solutions of the Helmholtz equations (for both magnetotelluric polarizations) are desired at a frequency `freq` of 0.01 Hz. The polynomial order `order` of the Lagrange elements is 2, i.e., we use quadratic (second order) finite element basis functions.
The numerical accuracy is always much better when second-order elements are employed.
After calling `FEMproblem`, the `fem` structure contains the following fields:
| field name | dimension | description | default |
|------------|:----------|-----------------------|---------|
| `mesh` | struct | copy of `mesh` struct | - |
| `order` | scalar | 1 or 2 for linear or quadratic elements, resp. | 1 |
| `dimension` | scalar | spatial dimension (currently only 2D is implemented) | 2 |
| `app` | struct | contains application (PDE) specific parameters, e.g., the frequency `frequency` for the MT case | - |
| `polarization` | string | indicates whether E- (`'epol'`), H- (`'hpol'`) or both (`'both'`) polarizations are desired | `'both'` |
| `elementtype` | type of finite elements | `'Lagrange'` |
| `sigma` | `nt x 1` | elementwise electrical conductivities $\sigma$ in S/m | - |
| `mu` | `nt x 1` | elementwise relative permeabilities $\mu_r$ | - |
| `stripair` | scalar | indicator that controls whether the Air halfspace has to be excluded (e.g., for the MT for H-polarization) | - |
| `istrip` | scalar | subdomain number associated with the Air halfspace that has to be stripped from mesh for MT | - |
| `coorddofs` | `2 x ndofs` | coordinates of the DOFS | - |
| `elem2dofs` | `(order * 3) x nt` | array of elements and their associated DO
没有合适的资源?快使用搜索试试~ 我知道了~
MATLAB中三维大地电磁有限元模拟_FE simulation of 2D Magnetotellurics in M

共84个文件
m:35个
poly:18个
node:9个

0 下载量 83 浏览量
2025-09-12
09:21:45
上传
评论
收藏 9.24MB ZIP 举报
温馨提示
MATLAB中三维大地电磁有限元模拟_FE simulation of 2D Magnetotellurics in MATLAB.zip
资源推荐
资源详情
资源评论





























收起资源包目录






























































































共 84 条
- 1
资源评论


matlab大师
- 粉丝: 2968
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 采用cifar10数据集进行人脸检测训练
- 包含人脸检测、获取本地与外网 IP 且适配 api26 的功能内容
- 基于Qt的人脸检测系统,调用百度人脸识别API,多线程
- 基于docker部署的 python的人脸检测算法
- 这个项目包含了人脸检测人脸识别表情识别的集成
- 高效精准的论文查重相似度检测检测结果支持导出HTML源码.zip
- Java-Web应用漏洞自动化挖掘研究.caj
- iimeta-iim-client-16804-1756641922451.zip
- FPGA逆向一致性验证技术研究.caj
- 子比免费子主题-NY1.0子比子主题
- 调用百度人脸检测 API 与微信小程序 JS-SDK 接口实现人脸检测认证功能
- 具备人脸识别语音识别与体温检测功能的人工智能机器人
- MeetHere场馆预约电子商务网站项目-基于SpringBoot和MySQL的场馆在线预约系统-提供用户注册登录场馆浏览预约订单管理支付功能及后台管理界面-用于大学校园或社区场馆.zip
- 关于快速建立人脸特征数据库并开展人脸检测与身份识别的方法
- 基于人脸识别的学生归寝检测预警系统-人脸识别部分
- 基于Modbus和212协议的多功能工业数据采集与监控系统-支持Modbus212协议数据采集-实时监控摄像头接入-历史数据存储查询-流程图配置展示-多设备反控-定时任务执行-数.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
