17

The following picture illustrates a mesh with a hanging node and a mesh containing no hanging node: Usually with a finite element mesh the vertices are shared with their other neighbouring elements, but the circled node does not belong to the bottom triangle. We call this node a hanging node. This commonly occurs during the process of adaptive mesh ...


10

I would recommend gmsh. I have just started working with this program actually only a few days ago. But it is straight-forward to use. You can create various 2D and even 3D-geometries and it offers a ton of information, boundary nodes, etc.. Here is a link to the website: http://geuz.org/gmsh/ They have many useful references, there is a manual of course ...


9

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 entirely geometric object. It knows nothing about finite element spaces one may define on it -- that's for a later step in your workflow. It's also important that ...


9

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 are your boundary faces.


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

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 ...


7

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-is. You also might be able to modify the algorithm to callback to f directly. There's a popular implementation at http://paulbourke.net/geometry/polygonise/ ...


7

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

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$ where $V$ is the number of vertices, $E$ is the number of edges, $F$ is the number of faces, $g$ is the genus of the manifold, and $b$ is the number of ...


5

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 study of Jonathan Richard Shewchuck at Berkley, an answer is: Please refer to the original document (version 31/12/2002) for symbology, terminology, special ...


5

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 technology and terminology of mesh generation. Written in a fairly mathematical style, which might not appeal to those of a more practical outlook. Will fit ...


5

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 functionality for surface mesh generation with examples here. You could also try distmesh, the essential idea of which has been ported to a number of other ...


5

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 Nyquist criterion sets an absolute lower limit to the "sample rate" of your mesh: two points per wavelength. In practice, you must upsample by a considerable ...


4

If you have an array that stores the indices of the 3 neighbors of each cell, then you would only compute the midpoint of an edge of the neighbor cell has a higher index than the current cell, or if there is no neighbor at all. This way you have an easy tie breaker to decide which of the two cells is responsible for computing the edge midpoint.


4

I'll expand my comment to an answer. Since your surface is fairly smooth, rather than generating a surface mesh, you can generate a 2D mesh of just the $(x, y)$-points that have been sampled, and then create a surface mesh by adding in the $z$-values later. This might suffice or it might not. Triangulation algorithms, like the one Tyler Olsen linked, are ...


4

If you have access to MATLAB, you might consider using PDE Toolbox to generate your geometry and mesh: http://www.mathworks.com/help/pde/index.html It is very easy to generate simple geometries like the ones you describe by doing boolean operations on primitive shapes. The output mesh is described by three MATLAB arrays: node locations, element ...


4

If I understand what you're saying, you have something like a sandwich of epoxy layers that have appreciable thickness (modeled in 3D) and a thin copper layer between them that has negligible thickness (modeled in 2D). In that case, you probably want to use some sort of 2D cohesive element for the negligibly thick copper layer. If you opt for that approach, ...


4

You can use a 2D anisotropic mesh generator (see e.g. H. Borouchaki, George, P. L. , F. Hecht , P. Laug and E. Saltel, Delaunay mesh generation governed by metric specifications. Part 1: Algorithms, Finite Elements in Analysis and Design, Vol. 25, pp. 61-83, 1997). Such a 2D anisotropic mesh generator takes as input: a 2D domain to be meshed a metric $G(x,...


4

As for any other domain, your mesh needs to be fine enough to resolve the features you have. This means that the mesh has to be finer than the geometric details of your unit cell, and it needs to be finer than the wavelengths of the waves you consider. Beyond this, the question of tets vs hexes is a minor issue. Hexes are generally more accurate, but if the ...


4

I have 1D finite-volume code written in python for a cell-centred mesh, First generate a sequence which is the location of the faces, $ \{ x_{j-1/2} \}$. For example, for uniform spacing over the domain [0,1] this is a simple as, a = 0 b = 1 J = 50 faces = numpy.linspace(a, b, J} After you have the faces the rest is easy because the faces uniquely ...


4

One way to do it might be to create an internal Line Loop in the input file where the crack originates. To do this, you would create 2 points at each end of the crack in your .geo file (say, points 1,2,3,4), and connect them up with lines. Then, create a Plane Surface from the border of that zero-thickness line loop. When you mesh the geometry, elements will ...


4

I have implemented a method that works pretty well for reconstructing edge information in surfacic meshes (or facet information in volumetric meshes), but I am working in C++. I'll try to explain that in an "abstract algorithmic language" that could (hopefully) be translated into Fortran: Suppose that I have a triangle mesh of nt triangles. Step 1: I ...


4

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. from __future__ import division, print_function import FreeCAD as FC import Draft from numpy import sin, cos, pi nturns = 1 nslices = 20 length = 10 width = 20 height = 60 dz = height/nslices ...


4

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 the coordinates, the embedding has been chosen for you, so you don't have to worry about uniqueness. The first thing to do is to name each edge and build the ...


4

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 want to have a mesh that is extremely anisotropic near the boundary layer. Now if you are doing computational electromagnetics, the best mesh will be probably ...


4

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 element is a triangle with vertices $V_1$, $V_2$ and $V_3$ (chosen counter-clockwise), and basis functions $1-\lambda-\mu$, $\lambda$ and $\mu$ respectively. The pair ...


4

To create a coarser mesh, you can set the characteristic length globally to a larger value, e.g., SetFactory("OpenCASCADE"); Mesh.CharacteristicLengthFactor = 2; Circle(1) = {0, 0, 0, 1, 0, 2*Pi}; Line Loop(1) = {1}; Surface(1) = {1}; Increasing the value of Mesh.CharacteristicLengthFactor results in a coarser mesh; decreasing the value results in a finer ...


4

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 with the ASCII art representations, which only give first and second order numberings for tetrahedra (hence there aren't any face nodes in the 4 node or 10 node "...


4

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 method chosen. And no, in general there is no difference in the meshing required for the two unless you start approaching edge cases such as meshes with polygons in ...


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