All Projects β†’ aschmidtuulm β†’ ameshref

aschmidtuulm / ameshref

Licence: MIT License
Efficient Matlab Implementation of Adaptive Mesh Refinement in 2D

Programming Languages

matlab
3953 projects

Projects that are alternatives of or similar to ameshref

MinimalFem
podgorskiy.com/spblog/304/writing-a-fem-solver-in-less-the-180-lines-of-code
Stars: ✭ 23 (-17.86%)
Mutual labels:  fem, finite-elements, finite-element-methods
Feelpp
πŸ’Ž Feel++: Finite Element Embedded Language and Library in C++
Stars: ✭ 229 (+717.86%)
Mutual labels:  fem, finite-elements
Ngsolve
Netgen/NGSolve is a high performance multiphysics finite element software. It is widely used to analyze models from solid mechanics, fluid dynamics and electromagnetics. Due to its flexible Python interface new physical equations and solution algorithms can be implemented easily.
Stars: ✭ 171 (+510.71%)
Mutual labels:  fem, finite-elements
FinEtools.jl
Finite Element tools in Julia
Stars: ✭ 126 (+350%)
Mutual labels:  finite-elements, finite-element-methods
Mfem
Lightweight, general, scalable C++ library for finite element methods
Stars: ✭ 667 (+2282.14%)
Mutual labels:  fem, finite-elements
Brieffiniteelement.net
BriefFiniteElementDotNET (BFE.NET) is a library for linear-static Finite Element Method (FEM) analysis of solids and structures in .NET
Stars: ✭ 81 (+189.29%)
Mutual labels:  fem, finite-elements
fem mesh matlab
MATLAB Toolbox for Handling 2D and 3D FEM Meshes
Stars: ✭ 23 (-17.86%)
Mutual labels:  fem, finite-element-methods
MeshCore.jl
Curation and manipulation of general unstructured meshes for the Finite Element Methods (FEM).
Stars: ✭ 14 (-50%)
Mutual labels:  fem, meshes
FreeFem-website
FreeFEM website
Stars: ✭ 13 (-53.57%)
Mutual labels:  finite-elements, finite-element-methods
plantFEM
This is a plant/farming simulator based on Finite Element Method, which targets crops in fields. This software provides multi-physical simulations of agriculture for canopies, plants, and organs for farmers, breeders, and agronomists. Please try and give us feedback. This github-page is a mirror of the following gitlab-page.
Stars: ✭ 31 (+10.71%)
Mutual labels:  fem, finite-element-methods
calfem-matlab
CALFEM - a finite element toolbox for MATLAB
Stars: ✭ 53 (+89.29%)
Mutual labels:  finite-elements, finite-element-methods
Moose
Multiphysics Object Oriented Simulation Environment
Stars: ✭ 652 (+2228.57%)
Mutual labels:  fem, finite-elements
Elmerfem
Official git repository of Elmer FEM software
Stars: ✭ 523 (+1767.86%)
Mutual labels:  fem, finite-elements
Solidspy
2D-Finite Element Analysis with Python
Stars: ✭ 142 (+407.14%)
Mutual labels:  fem, finite-elements
Libmesh
libMesh github repository
Stars: ✭ 450 (+1507.14%)
Mutual labels:  fem, finite-elements
Flex Layout
Provides HTML UI layout for Angular applications; using Flexbox and a Responsive API
Stars: ✭ 5,705 (+20275%)
Mutual labels:  grid, adaptive
FEMAddOns
Finite Element Method addons for Wolfram Language
Stars: ✭ 41 (+46.43%)
Mutual labels:  finite-elements, finite-element-methods
PyMFEM
Python wrapper for MFEM
Stars: ✭ 91 (+225%)
Mutual labels:  fem, finite-elements
feappv
FEAPpv -- free personal version of the FEAP
Stars: ✭ 57 (+103.57%)
Mutual labels:  fem, finite-element-methods
FreeFem-modules
A collection of mathematically validated modules (EDP) for FreeFEM
Stars: ✭ 28 (+0%)
Mutual labels:  finite-elements, finite-element-methods

ameshref

Efficient Matlab Implementation of Adaptive Mesh Refinement in 2D

This project provides an efficient implementation of various adaptive mesh refinement strategies in two dimensions. The documentation provides a detailed investigation of the implemented mesh refinement methods and also presents how the methods are realized by utilization of reasonable data structure, use of Matlab built-in functions and vectorization. In the documentation, the focus is set on the deployment of ameshref in the context of the adaptive finite element method. To this end, also codes to realize the adaptive finite element method (AFEM) is additionally provided here. However, our code is kept general such that this package is not restricted to the AFEM context as our other test examples show. This package can be used to adaptively generate meshes in two dimensions in different ways. Moreover, it can also serve educational purposes on how to realize mesh refinement methods in an accessible, short but efficient way. The data structure used is very simple because only the coordinates of the vertices and the element-connectivities are needed. Marking of elements are interpreted as edge-based marking, i.e., an element is marked by marking each edge for bisection. In contrast to other mesh refinement packages, we do not make use of a recursive approach but prefer the realization in terms of vectorization.

alt text

Getting Started

For a use of the refinement methods download the complete repository /ameshref with the test examples and run them on your computer with Matlab. To use it within your own examples you only need the repository /refinement. Please see the following instructions for a correct use.

Prerequisites

MATLAB

Running the test examples

/example1: run test_refinement.m (refinement along a circle)

/example2: run mainAdaptiveScript.m (triangulation of a picture)

/example3: run example1.m or example2.m in each of the repositories (mesh refinement in the context of AFEM)

/example4: run example4.m (for a given discrete set of points all elements containing these points are refined)

Deployment for your own examples - Data structure

To be able to deploy this package within your framework you need the following data strucure of the mesh:

For triangles you need to define coordinates, elements3, and optionally boundary data dirichlet or neumann.

alt text

Similarly, for quadrilaterals you need to define coordinates, elements4, and optionally boundary data dirichlet or neumann.

alt text

For meshes with hanging nodes an additional data vector named irregular is needed, where irregular(l,1) and irregular(l,2) are the starting and end point of the lth-irregular edge with hanging node stored in irregular(l,3).

How to call the functions

We abbreviate the data structure as coordinates (C), elements3 (E3), elements4 (E4), irregular (I), dirichlet (D), and neumann (N). Furthermore, marked elements are stored with the corresponding index in the variable marked.

The different mesh refinement methods are then called by (remember that D and N are optional arguments)

TrefineR

[C,E3,I,D,N] = TrefineR(C,E3,I,D,N,marked)

QrefineR

[C,E4,I,D,N] = QrefineR(C,E4,I,D,N,marked)

QrefineR2

[C,E4,I,D,N] = QrefineR2(C,E4,I,D,N,marked)

TrefineNVB

[C,E3,D,N] = TrefineNVB(C,E3,D,N,marked)

TrefineRGB

[C,E3,D,N] = TrefineRGB(C,E3,D,N,marked)

TrefineRG

[C,E3,D,N] = TrefineRG(C,E3,D,N,marked)

QrefineRB

[C,E4,D,N] = QrefineRB(C,E4,D,N,marked)

QrefineRG

3-step call

[C,E4,marked,I] = recoarseedges_tri(C,E3,E4,marked3,marked4)
[C,E4,D,N] = QrefineR(C,E4,D,N,marked)
[C,E4,E3] = regularizeedges_tri(C,E4,I)

QrefineRG2

3-step call

[C,E4,marked,I] = recoarseedges(C,E4,marked4)
[C,E4,I,D,N] = QrefineR2(C,E4,I,D,N,marked)
[C,E4] = regularizeedges_tri(C,E4,I)

Minimal example

The used functions are provided in the repository /example1 and /refinement:

C = [0.8,0.7]; % center of circle
r = 0.5; % radius of circle
min_d = 5e-6; % minimal diameter of an element allowed

%% exemplary use of a quadrilateral mesh refinement strategy
coordinates = [0,0;1,0;1,1;0,1;2,0;2,1];
elements4 = [1,2,3,4;2,5,6,3];
while 1
    mark4 = markCircle(coordinates,[],elements4,C,r,min_d);
    mark4 = find(mark4);  
    [coordinates,elements4] = QrefineRB(coordinates,elements4,mark4);
    if isempty(mark4)
        break
    end
end

Plot your mesh with Matlab

triangular mesh:

patch('Faces',elements3,'Vertices',coordinates,'Facecolor','none')

quadrilateral mesh:

patch('Faces',elements4,'Vertices',coordinates,'Facecolor','none')

Authors

  • Stefan A. Funken - Anja Schmidt Institute for Numerical Mathematics, Ulm University, Germany

If you use ameshref in scientific work, please cite:

  • Stefan A. Funken, and Anja Schmidt. "Adaptive Mesh Refinement in 2D–An Efficient Implementation in Matlab." Computational Methods in Applied Mathematics, 2018. https://doi.org/10.1515/cmam-2018-0220

License

This project is licensed under the MIT License - see the LICENSE file for details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].