Skip to main content
Share Your Experience: Take the 2024 Developer Survey
10 votes

Why FVM can handle unstructured meshes while FDM cannot?

The difference between finite volumes and finite differences is really more about the form of the equations solved. In typical FV methods, the conservative form is ...
Darren Engwirda's user avatar
9 votes
Accepted

Library for generating Discontinuous Galerkin FEM mesh

You are confused about different concepts. A mesh is really just a collection of cells defined by the vertices of the mesh and which vertices together form each cell. Consequently, a mesh is an ...
Wolfgang Bangerth's user avatar
9 votes
Accepted

Algorithm to find boundary faces of mesh

First, create a list of faces in the mesh. From there you should be able to create a map from faces to tets, as each face must belong to either one or two tets. The faces that belong to only one tet ...
coolguy1000000's user avatar
8 votes
Accepted

Unstructured mesh vs hybrid structured/unstructured for numerical simulations

In my opinion, it is not a good neither a bad mesh. It clearly depends on the PDE you are considering. The finite space to which the PDE is projected is your mesh, where your operators, e.g. $\vec{\...
HBR's user avatar
  • 1,648
7 votes
Accepted

3D contour mesh computation

I think you could use the "marching cubes" algorithm. If memory serves, it requires a grid of samples as input, so at the very least you should be able to sample your function and run the algorithm as-...
rchilton1980's user avatar
  • 4,906
7 votes
Accepted

Is there any open-source code for a hybrid 2D mesh (triangles and quadrilaterals)?

You can use Gmsh for this purpose. I show an example below. ...
nicoguaro's user avatar
  • 8,525
6 votes
Accepted

Creating a proper quad-mesh in GMSH for an "I"-shaped geometry

So, by default and without recombination to quads (comment out Recombine Surface {1}), GMSH creates a mesh like the one in the left part of the picture. And by ...
Anton Menshov's user avatar
  • 8,672
6 votes
Accepted

Unreasonably large deviation in calculations of mean curvature in different algorithms

First of all remember that curvatures, being 2nd order values, can be really sensitive to even very small variations. Moreover, we are speaking about computing differential values in a discrete ...
ALoopingIcon's user avatar
5 votes
Accepted

Resources on mesh generation for finite element methods

Starting a community answer, in line with your model question Mesh Generation Mesh Generation: Application to Finite Elements (P.-L. George and P. Frey) Hermes, Lyon, 2000. A clear primer on the core ...
5 votes

Commonly-used metrics to quantify the irregularity of a triangular mesh

I do not think that there exists an answer to this question in general, because it all depends on the intended use for the mesh. For instance, if you are doing computational fluid dynamics, you may ...
BrunoLevy's user avatar
  • 2,315
5 votes
Accepted

Commonly-used metrics to quantify the irregularity of a triangular mesh

As @Nicoguaro and @Paul have said in the comments to the question post, there are a great many ways to do this kind of thing, and I'm not sure if there is a single "best" approach. From a review ...
Darren Engwirda's user avatar
5 votes
Accepted

Relationship between number of nodes, elements and sides in a triangular 2D mesh

Yes there is a relationship, the Euler characteristic: For a 2-dimensional orientable manifold with boundaries embedded in $\mathbb{R}^3$, the Euler characteristic is $\chi = V - E + F = 2 - 2g - b$ ...
rviertel's user avatar
  • 166
5 votes

3D contour mesh computation

In addition to the voxel-based approach that rchilton suggests, you could also look at Delaunay-type algorithms. For example, the Computational Geometry Algorithms Library (CGAL) has some built-in ...
Daniel Shapero's user avatar
5 votes

Minimum number of elements (mesh size) for electromagnetic simulation

The Maxwell system is a wave equation at heart, so your ansatz (the space where you seek solutions, the combination of your mesh and basis functions) must be able to faithfully represent waves. The ...
rchilton1980's user avatar
  • 4,906
4 votes
Accepted

Combined translational and rotational meshing in gmsh

I cannot visualize your geometry properly using Gmsh, or export it. I generated something similar using FreeCAD. Maybe you can modify this script for your purposes. ...
nicoguaro's user avatar
  • 8,525
4 votes
Accepted

From edge-vertex connectivty to face-vertex connectivity?

As noted in the comments, your problem doesn't seem quite solvable as stated. However, if you include the assumption that each node has a 2D coordinate associated with it, then it is solvable. With ...
Tyler Olsen's user avatar
  • 1,512
4 votes
Accepted

Determinant of jacobian matrix

The determinant of the Jacobian, as a determinant changes its sign when odd permutations of columns (or rows) are applied. Imagine, for simplicity a two dimensional case in which the reference ...
HBR's user avatar
  • 1,648
4 votes

How can I coarsen a mesh in Gmsh when 'Mesh options' include 'Refine by splitting' but nothing about coarsening?

To create a coarser mesh, you can set the characteristic length globally to a larger value, e.g., ...
H. Rittich's user avatar
4 votes
Accepted

Definition of Lagrange nodes in Gmsh

I think you've got slightly the wrong end of the stick from the documentation. As with a lot of other software in the area, GMSH started out with low order, hard coded numberings. These are the ones ...
origimbo's user avatar
  • 2,249
4 votes

Creating 3D Mesh from stl files with gmsh

I am not entirely sure what is going wrong in your version of the command-line approach. However, I think it works on my test STL file (with gmsh 4.0.7) with the following line: ...
Anton Menshov's user avatar
  • 8,672
4 votes
Accepted

Is there any fundamental difference between meshing for FEM, FVM and FDM?

You are correct that FDM requires structured meshes, so you are restricted to those. On the other hand FEM and FVM can both do structured meshes as well as unstructured meshes depending on the ...
Vikram's user avatar
  • 489
4 votes
Accepted

How to find out the difference between a structured and unstructured mesh using the file containing the mesh information?

There are two different types of meshes that are commonly termed "structured": the points are placed on an equispaced grid; and the elements have the same connectivity. Some people might call any ...
nicoguaro's user avatar
  • 8,525
4 votes
Accepted

Flux sign and face normal confusion in finite volume method

When dealing with conservation laws like your case, you can often make use of the divergence theorem (as you did). You can then express the fact that the total mass within your integration region is ...
MPIchael's user avatar
  • 2,935
4 votes
Accepted

For traditional FEM and FVM, why can't we use mesh to represent geometry and use the mesh which represent the geometry to do the computation directly?

The underlying problem is that the mesh really isn't the geometry. You want to simulate a bridge? It has a certain geometry, which you can approximate using a mesh, but the mesh is not the exact ...
Wolfgang Bangerth's user avatar
4 votes

Convolute a gaussian kernel with a large array of off-grid centroids without looping? (how to make "A Thousand (Gaussian) Points of Light" )

If you simply want to compute the convolution you can construct a Kernel matrix for computation with arbitrary arrangements of Gaussians that do not lie on grid points of the domain where you want to ...
Ron's user avatar
  • 725
4 votes
Accepted

Connectivity of octree as grid

The one paper you need to know is the one by Burstedde and collaborators on the implementation of the p4est library: p4est: SCALABLE ALGORITHMS FOR PARALLEL ADAPTIVE MESH REFINEMENT ON FORESTS OF ...
Wolfgang Bangerth's user avatar
4 votes

Interpolation of 1D solution from an original grid to a new grid

A "better technique" is rather subjective. You mean faster, more accurate, easier to program, something else?? Since it's only 1-D, the numerical cost is small (compared to 2D/3D) and there ...
Javier-Acuna's user avatar
4 votes

Choice of grid generation for FDM discretisation methods

Your question mentions both space and time discretization and the problems that can arise due to different choices of one or the other. I think that you might be conflating problems that come from the ...
Daniel Shapero's user avatar
4 votes

How to generate mesh for space-time FEM method in FEniCS?

First of all, for FEniCS specific questions please refer to the official FEniCS forum. In my opinion, your question can be answered irrespective of your FEM library of choice. There are two ...
Julian Roth's user avatar
3 votes

Numerically solving a PDE on an unit tangent bundle

The equation you are trying to solve in in essence the analogue of the "radiative transfer" equation when posed on a manifold. There is a vast literature in this area -- both in astrophysics and in ...
Wolfgang Bangerth's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible