8

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{\textrm{grad}}$ (gradients), $\textrm{div}$ (divergences), $\triangle$ (Laplacians)... strongly depend on that mesh and become matrices: $$ \vec{\textrm{grad}}\...


8

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 discretised in terms of integrals and fluxes, whereas FD methods generally approximate derivatives in the non-conservative form directly. Maintaining conservation and preserving physical ...


7

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 used banded or variable-band storage schemes for the sparse matrices so reducing the bandwidth was the main criterion. That is the origin of the old Cuthill-...


7

Gmsh (http://geuz.org/gmsh/) will do it for you. Simply create all of the volumes, surfaces, and lines that are required to describe the geometry and interfaces. Then, assign a "physical" id to everything that you want meshed. Once you mesh the geometry, everything to which you have assigned a physical ID will be meshed. The "zero thickness" elements will ...


6

The complexity of simplicial tessellations in $\mathbb{R}^{d}$, for $d>2$ is, unfortunately, not linear. In general, a simplicial tessellation $\mathcal{T}(X)$ for $n$ vertices $X\subset\mathbb{R}^{d}$ can have $\Theta(n^{\lceil d/2\rceil})$ d-simplexes in the worst case. Similar results exist for the lower dimensional faces of $\mathcal{T}$. Based on ...


6

You can use Gmsh for this purpose. I show an example below. // Points Point(1) = {-2, -2, 0, 1.0}; Point(2) = {2, -2, 0, 1.0}; Point(3) = {2, 2, 0, 1.0}; Point(4) = {-2, 2, 0, 1.0}; Point(5) = {-10, -10, 0, 2.0}; Point(6) = {10, -10, 0, 2.0}; Point(7) = {10, 10, 0, 2.0}; Point(8) = {-10, 10, 0, 2.0}; // Lines Line(1) = {1, 2}; Line(2) = {2, 3}; Line(3) = {...


5

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 tag, so I assume that's what you're using and that you have scipy. A quick and dirty solution would be to construct a kd-tree of the fine grid points, then for ...


5

I suggest using PETSc, which has parallel solvers like GMRES, bi Conjugate Gradient, etc. Multiple preconditioners are also available. Furthermore, there might also be the option of the SNES nonlinear solvers. As to which set of solver+preconditioner combination works best, it's likely problem-specific. PETSc will allow you to switch between them easily. ...


4

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 your problems might be my problems in the future, so I've pondered the problem. Here are some comments/suggestions ordered from obvious/easy-to-implement to ...


4

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 unstructured grid. As an addition, GMSH itself (I am using 3.0.5) is also able to export the mesh into VTK without the need to go through IO procedure. That can ...


4

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 combination of these two a "structured mesh". In Abaqus, you can define a set of points on a grid with the keyword *NGEN and a regular connectivity with *...


3

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 want element sizes to be too different to satisfy the sampling criterion. Regarding mesh quality I would suggest that you check this post: Commonly-used metrics ...


3

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 efficiently store and traverse adjacency information, i.e. for each cell the list of adjacent cells. First thing you can do for mapping a cell to its list of ...


3

For quadrilaterals and triangles, one standard thing to do is to use the isoparametric map. That is, you use the finite element basis you are about to use to approximate the solution to map your physical-space element to a "reference element" from the $\xi, \eta$ to $x, y$. You obviously have to add interior and edge nodes to do this for higher-order ...


3

If you have a triangular mesh with data defined at each vertex, you can of course associate a linear function with each element that interpolates the data values at the vertices. This also provides you with an estimate of the gradient on each cell by just computing the gradient of the linear interpolant. Of course, it is only an estimate because you are ...


3

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 going to justify why this is a measure of skewness. Consider following two elements -for sake of simplicity- Blue arrow is the outward surface normal fAreas[...


3

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$ which partition $p$ it belongs to. Also assume that you have a (sparse) array $a_{KL}$ whose entries are true if cells $K$ and $L$ are neighbors ("adjacent&...


2

Yes, I've used tetgen to do precisely this. If you're filling a surface mesh, you'll have to generate facet triangulations first. Then you can decide whether or not you want a constrained or conforming tetrahedral mesh. The result of either choice is described in better detail within the manual.


2

The most conceptually simple approach is to select an interpolation scheme, interpolate through the data points that you have, then compute the derivative of the interpolant. This is a natural generalization of the typical finite-difference differentiation formulas. While you don't mention your exact requirements (in particular: do you need the derivatives ...


2

You can compute differential operators for this meshes using information around the neighborhood of each vertex (discrete in this case). In this reference the authors compute differential-geometry operators in the 1-star neighborhood, i.e., the cells around each vertex. Another option is to fit a paraboloid around each vertex and analytically calculate the ...


2

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 octtree and such that are needed to keep history of AMR. Also, since the internal data structures for the solver are static (vectors/arrays), it is not possible ...


2

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 circle you would also have to refine the definition of the boundary for each mesh. Another option is Persson's distmesh triangle mesher, As shown on this page, ...


2

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 cell, you can easily get the faces for that cell defined, say, as a list of vertices. The first step in creating the CellAdjacentsMap that you need is to ...


2

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. As you said, in some cases you end up with identical discretizations no matter which approach you chose. That being said, there are certain advantages and ...


2

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 these questions: https://www.math.colostate.edu/~bangerth/publications/2010-distributed.pdf In particular, section 3 is relevant to you. The full reference for ...


2

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 have more information. I have the impression you need to find better textbooks.


2

I found a solution by replacing the points with line segments: #poly = geom.add_polygon(pts, mesh_size = mesh_size) #loop = geom.add_curve(poly) #geom.in_surface(loop, ball_srf.surface_loop) ...


2

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.wikipedia.org/wiki/HEALPix https://healpix.sourceforge.io/ Here's the NASA illustration of the hierarchy: The package has been instrumental in producing maps and ...


2

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 function. The centroid of a triangle is the arithmetic average of its three vertices. Note that $$ x_i = \frac{1}{\Delta_i} \int_{\Delta_i} x dx dy = \frac{1}{3}\...


2

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/mesh/geometry.f90 It is so called face based data structure. We use divergence theorem to compute geometrical data like volumes and cell center coordinates. This ...


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