Tag Info

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 you look at gmsh. It has both text and CAD-like input, capable of 2D and 3D, higher order meshes. It is licensed under the GPL, so there are some restrictions on integrating it into closed source software, but is otherwise completely free/open-source.

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

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

If you are not using AMR and do not want to scale beyond 1K-4K cores then simply do this. Rank 0 reads the entire mesh and partitions it using METIS/Scotch etc. (Note: This is a serial operation). Rank 0 broadcasts the element/node partitioning info to all other ranks and frees the memory (used to store the mesh) All ranks read the nodes/elements they own (...

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

6

If an unrestricted triangulation is OK, you can do it with scipy.spatial.Delaunay which uses Qhull.

6

The answer to your question can depend on quite a few things, such as whether you need a turbulence model, and which one you choose if so, and how you are handling the "top" of your fluid since moving interfaces are nontrivial. You are also imposing discontinuities on the boundary at the edges of your inlet so a nonuniform mesh would be advantageous for you....

6

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

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

gmsh is a viable way to generate quadrilateral meshes in 2d. It's also open source.

5

Permit me to clarify - you ask about "structured mesh" that's "quadrilateral." By definition, a structured mesh (or grid) consists of quads (2D) and hexes (3D). So I want to clarify that you're inquiring about automatic structured quad/hex grid generation. If so, you're seeking the holy grail. While there are many software tools for generating structured ...

5

This feature seems to be available in CGAL

5

I suggest the following simple algorithm: Depending on whether you want symmetry of the mesh, either start at a point $x_0$ at the left end of your interval, or in the center. In the latter case, just mirror the mesh you obtain. Having performed the algorithm to $x_k$, compute $x_{k+1}$ as $x_k+h_k$, where \begin{gather} h_k = \min \left\{ h_{\max}, \frac{\...

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

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

Metis does not guarantee that the partitions are non-empty, so your code must deal with this situation.

4

Concerning the flow simulation, an upper bound is given by the relation $N\geq Re^{9/4}$, where $N$ is the number of mesh nodes and $Re$ is the Reynolds number, derived for direct numerical simulation . In your case with $L=120m$, $u=0.1m/s$ and $\nu = 10^{-6}m^2/s$, you have $Re \approx 1.2 \cdot 10^5$ what - in theory - means that you will need about $2.... 4 In your problem description, note that$80\text{mm} \neq 0.008 \text{m}$. That said, every quantity in a computer program is just a number. It's up to you to interpret it. So of course you can run a simulation where the domain has an edge length of 80 or 0.08 -- they refer to the same domain, after all. But depending on what you use as your base unit, you ... 4 I think you can do this using convex hull software (e.g. QHull) via the lifting algorithm. At least, the documentation of matlab's "delaunayn" command seems to indicate as much. 4 I usually use tetgen for 3D (MIT license for research/non-commercial) and triangle for 2D (Custom license free for non-commercial). To script them, you write a input file and call the command line. 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 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

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

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