9 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 ...
8 votes

Mesh ordering algorithms used by COMSOL Multiphysics

The idea of "ordering the nodes" in a finite element mesh to improve the computational time of the sparse solver originated in the large structural analysis FE codes of the 70's. Those codes typically ...
  • 5,844
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{\...
  • 1,618
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. ...
  • 8,209
5 votes
Accepted

Common nodes in two FEM grids

Hashing floating-point numbers can indeed lead to weird results, especially if the node positions can be perturbed by some small amount or if there are denormalized values. You included the Python ...
4 votes

Working with large mesh files

My answer is primarily opinion-based, given my experience. In my work, I haven't (yet) dealt with meshes quite as large as what you're describing. However, I've seen large enough meshes to hint that ...
  • 1,173
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 ...
  • 8,209
4 votes
Accepted

C++ library unstructured mesh writer to VTK format (or similar)

I think you are looking for Kitware VTK, basically, the main library for interaction with VTK files. Examples page will contain a lot of samples, including the one you are looking for: output of an ...
  • 8,542
3 votes
Accepted

How to calculate skewness for a mesh?

From the discussions and the paper, OpenFOAM seems to have implemented a measure of skewness. This answer is not an explanation why the different definitions of skewness might be equivalent, I am just ...
3 votes
Accepted

How is central difference scheme second-order accurate?

The expression with $g=1/2$ is second order if and only if f is the midpoint of P and N.The expression with $g\in[0,1]$ is second order if f is on PN and$fN/Pf=g$. If f is anywhere else you need to ...
3 votes

Unstructured mesh vs hybrid structured/unstructured for numerical simulations

I think that both meshes are good. But depending of the problem at hand, one might be better than the other. In the domain that you are mentioning, one thing to consider is that you probably don't ...
  • 8,209
3 votes

Getting adjacent cells map for an unstructured polyhedral mesh

Using a hash map adds a log(n) complexity to all accesses (then traversing the whole mesh will cost n log(n) in general), so clearly it is not the best solution. Now your question is how you can ...
  • 2,285
3 votes
Accepted

Partition mesh into predetermined submeshes

For your first question, constructing the adjacency graph of the "partitions" (what you call "cell groups"): Let's say you have an array $p_K$ in which you store for each cell $K$ ...
3 votes
Accepted

Which algorithms exist to create a tetrahedral volume mesh from an STL file?

I don't agree with Wolfgang that you should never write things yourself, but writing a tetrahedral mesh generator is a big task and his estimate of a year's worth of work sounds about right. My ...
3 votes

Gmsh Python: Specify mesh regularity conditons

If you're prepared to be a little more flexible with your definition of cell "centres", it's possible to achieve the regularity constraints you seek via Delaunay Triangulations and Voronoi ...
2 votes

unstructured grid AMR

I ended up with a simple AMR implementation that does the job for polyhedral cells a) No coarsening. The original coarse grid is always loaded first on which refinement is applied. This gets rid of ...
  • 233
2 votes
Accepted

2D mesh generator with geometric primitives

Shewchuk's triangle mesh generator produces high quality meshes and is quite robust. However, the boundary definition is a series of straight lines. So to produce a sequence of refined meshes over a ...
  • 5,844
2 votes
Accepted

Getting adjacent cells map for an unstructured polyhedral mesh

I'm assuming you are starting with a list of cell definitions, say, as a list of vertices defining the cell and a "type" defining the topology of each cell. As part of the topology definition for each ...
  • 5,844
2 votes

Parallel mesh partitioning

All software I know of first enumerates nodes locally, and then uses this local enumeration to generate a global enumeration. I suggest that you want to read the following manuscript about all of ...
2 votes

Why FVM can handle unstructured meshes while FDM cannot?

I would propose to think of the different schools of coming up with discretizations (FVM/FEM/FD), not as excluding or separate. There is surely overlap, they are -methods- to derive discretizations. ...
  • 2,411
2 votes

Meshing surface of a sphere with a subdomain

I found a solution by replacing the points with line segments: ...
2 votes

Meshing surface of a sphere with a subdomain

Why don't you take a look a HEALpix which provides a nice equal area hierarchical triangulation of the surface of the sphere with no distorted triangles: https://healpix.jpl.nasa.gov/ https://en....
2 votes
Accepted

How to evaluate the average value of a polynomial inside the triangle area in finite volume sense?

If $(x_i,y_i)$ is the centroid of the triangle, then $$ \frac{1}{\Delta_i}\int_{\Delta_i}{p(x,y)}\,dx\,dy = p(x_i,y_i) = \bar{\psi}_i $$ This is mid-point quadrature, which is exact for an affine ...
  • 2,993
2 votes
Accepted

Unstructured mesh preprocessing

I would leave out a few things to make it more simple. This is how we do it for our code which is capable of using polyhedral meshes: https://github.com/nikola-m/freeCappuccino-dev/blob/master/src/...
2 votes

Convert unstructured mesh to structured mesh

in Gmsh only planes that have four corner points could be meshed with structured meshes using Trasnfinite option. In your file, ...
  • 194
2 votes

Which algorithms exist to create a tetrahedral volume mesh from an STL file?

Creating meshes is a non-trivial enterprise and you will probably spend a year or two implementing the relevant algorithms yourself. Instead, just use what others have used -- specifically, use the ...
1 vote

How is central difference scheme second-order accurate?

Assuming $F (not f)$ as the face center, we have the following taylor expansions for $\phi$: $$\phi_p = \phi_F + \nabla\phi_F.(r_P-r_F)+O(2)→×|r_N-r_F|$$ $$\phi_N=\phi_F + \nabla\phi_F.(r_N-r_F)+O(2)→×...
  • 235
1 vote

Libraries to deal with unstructured grids

Most finite element libraries have the ability to read a good number of mesh formats. The library I work on, deal.II (see http://www.dealii.org) happens to have quite a number of mesh readers for VTK, ...
1 vote

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

If it's a structured grid of hexahedra, then each node should have the same valence (number of adjacent hexes), eight. So I would scan through the list of hexes, and make sure that each node index ...
  • 4,604
1 vote
Accepted

How I could calculate L2 norm of an unstructured grid?

How are you on a uniform unstructured grid? Are you in 1-D or 2-D? You're missing a lot of detail. This expression of the norm that you found is area weighted. If you're 1D then multiplying by $\Delta ...
  • 2,059

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