Questions tagged [mesh]

Questions on the use and creation of meshes including the use of MeshRegion, ElementMesh, and TetGenLink.

Filter by
Sorted by
Tagged with
50
votes
2answers
1k views

A geometric multigrid solver for Mathematica?

Cross posted to community.wolfram.com Mathematica ships a variety of linear solvers through the interface LinearSolve[A, b, Method -> method] the most ...
37
votes
4answers
6k views

Creating a 2D meshing algorithm in Mathematica

As what is proving to be a difficult, but entertaining task, I am attempting to adapt a 2D meshing algorithm created for MATLAB and port it to Mathematica. I understand meshing functions already exist ...
34
votes
1answer
843 views

How to perform Loop subdivision on a triangle mesh with Mathematica?

(Cross posted on Wolfram Community) Every now and then, the question pops up how a given geometric mesh (e.g. a MeshRegion) can be refined to produce a (i) finer ...
29
votes
7answers
3k views

How to generate a mesh with quadrilateral elements?

I have the following code that generates a finite element mesh: ...
25
votes
3answers
2k views

Convert binary voxel image to geometric region

I have a binary voxel image which described a contiguous region in space. Example: ...
23
votes
2answers
1k views

How can the {x,y,z} points that fall on the outer boundary of a set of values be selected and smoothly surfaced?

For a given set of x,y,z values, that may, or may not form a uniform shape, how can the center of the data cloud be found, and the surface points be located and a solid smooth surface created from ...
22
votes
3answers
3k views

Finding a Concave Hull

I have 3D clustered data: Is there any other way to get the concave hull of 3D data points?
21
votes
3answers
3k views

Removing unwanted appearance of underlying mesh

Let us first define two positive definite matrices: M1 = {{2, -6}, {4, 8}}; M2 = {{2, 3}, {4, 8}}; then set two points ...
21
votes
3answers
1k views

Build a refined grid based on intersecting line

I honestly have no idea where to begin with this problem. In summary, I have a 2D coarse grid with an intersecting line. For an easy example, let's assume it's a 4x4 grid. I wish to pass through each ...
21
votes
1answer
613 views

Mismatch between Mathematica and COMSOL in 3D FEM problem

I would like to solve an advection-diffusion problem on a torus domain. There are three Dirichlet conditions: One at the inlet (concentration $c=0$), one at the outlet ($c=0.5$) and one at the wall ($...
20
votes
3answers
587 views

How to get a specified number of points that are nearly equally spaced in a closed rectangle

TriangulateMesh is almost the right tool for this problem. For example, ...
20
votes
1answer
807 views

Eigenfunctions of the Laplacian on an arbitrary mesh

So, I've constructed a mesh over which I'd like to find eigenfunctions of Laplace's equation with a free boundary (a zero Neumann boundary condition along the edge). Mostly because I figured an ...
19
votes
3answers
433 views
19
votes
2answers
611 views

Smoothing 3D contours as post processing

Context Following this question (and great answer!), It would be nice to have a function which also smooths 3D contours plots once they have been done. There are various solutions which involve ...
18
votes
5answers
1k views

How to obtain the cell-adjacency graph of a mesh?

In addition to the accepted answer, see also the answer by Chip Hurst. This functionality is built in, but not documented. Given an arbitrary mesh region, how can I efficiently obtain the graph ...
17
votes
4answers
3k views

How to get actual triangles from DelaunayTriangulation[]?

The ComputationalGeometry package has a DelaunayTriangulation[] function. It returns a list of points connected to each point, ...
17
votes
2answers
2k views

Estimating Principal Curvature Directions on Discrete Surfaces

I am continuing with working on implementing curvature estimations on triangulated surfaces (See: here), using the algorithm of : Meyer, M., Desbrun, M., Schröder, P., & Barr, A. H. (2003). ...
16
votes
3answers
6k views

Create triangular mesh from random list of points

I have a list of points. I would like to take these points and create a mesh of triangles from them, making sure triangles don't overlap. So here's a list of points: ...
16
votes
2answers
1k views

DelaunayMesh in a specified closed region - creating a concave hull from a set of points

I have a list of discrete points wich I want to use as nodes for creating a 2D mesh. I used DelaunayMesh and it works fine. The problem that I have is that some elements/polygons are outside of the ...
16
votes
3answers
1k views

How to convert a surface into a solid

Context I am interested in converting surfaces into solids (so I can make a 3D mesh out of them using ToElementMesh) Say I have the following cool surface ...
16
votes
1answer
305 views

Possible Bug in ArrayMesh

Bug introduced in V10.4 and fixed in 10.4.1 Suppose we have the following array from which we intend to create an ArrayMesh: ...
16
votes
1answer
338 views

Possible bug in RegionUnion or related functions?

Bug introduced in 11.2.0 Functions for derived geometric regions (RegionUnion and related) have been significantly updated in MMA 11.2 and now this simple example ...
16
votes
0answers
1k views

Using TetGen in Mathematica to get 3D Voronoi diagram

In this post, the use of TetGen for 3D Voronoi tesselation has been briefly discussed. However there is still no info about the use of TetGen to generate a 3D Voronoi diagram. The TetGen documentation ...
15
votes
3answers
633 views

Crop a Voronoi diagram and get a proper MeshRegion

How can I crop a VoronoiMesh (or any similar MeshRegion) to a non-rectangular region and receive the output as a ...
15
votes
1answer
803 views

How to access FEM shape functions

A couple of days ago I asked here about surface meshes and plotting on surfaces. Now I have another question: How can I access the surface or boundary element shape functions? I would like to ...
15
votes
1answer
451 views

How to specify PDE Boundary condition on a B-spline?

Context I would like to solve a PDE on a boundary which is parametrized as a BSpline. I am trying to solve the force-free Grad-Shafranov equation on a ...
14
votes
5answers
2k views

Triangular mesh of random points on a sphere

My employer has a new logo (shown below). I do not have information on how this was created (as it was done by an outside company), though I'm fairly sure it was not done in any formal mathematical ...
14
votes
2answers
511 views

Voronoi tessellations on meshed surfaces

Given a meshed surface, on which we can calculate geodesic distances between vertices, how can one calculate the Voronoi tessellation of a set of points located on this surface? This is somewhat ...
14
votes
2answers
870 views

create an (almost) hexagonal mesh on an ellipsoid

EDIT I edited the question in order to take into @Kuba's comment. I want to create this figure with Mathematica (in particular an almost hexagonal mesh on an ellipsoid; thanks to @Kuba I know this ...
14
votes
2answers
2k views

How to create subregions for the NDSolve FEM Solver

I am trying to create a 2d region consisting of two subregions. The inner region has several holes, where boundary conditions are applied. The figure shows the idea. I have tried to create this ...
14
votes
1answer
528 views

Is it possible to re-mesh, downsample & upsample a DiscretizeRegion object?

In my project, I am importing a complex geometry from an STL file into Mathematica as a MeshRegion. I would like to edit this mesh significantly: For instance, drastically reduce or increase the ...
13
votes
3answers
570 views

Improve the mesh smoothing procedure

My question is inspired by this answer about meshing with quadrilateral elements. The following functions are my (naive) try of implementing the Laplacian smoothing. I find interior nodes in the mesh ...
13
votes
2answers
667 views

How to mesh a region using adaptive cubic elements

Assume a list of {x,y,z} coordinates. The coordinates are arranged in a regular fashion through a fixed raster size (called ...
13
votes
2answers
590 views

Meshing the cow

As a simple example for applying stl-files I took "cow" out of MMA example data. I'm able to discretize the Graphic without problems ...
13
votes
1answer
1k views

Hexagonal Mesh on a 3D surface

I am new to Mathematica, and I am trying to create a 3D hexagonal mesh on a 3D surface. It is very similar to what was done in this post Create a torus with a hexagonal mesh for 3D-printing, but now ...
13
votes
1answer
943 views

FEM: how to choose FEM element type

I am asking myself if there is any simple option for choosing the element type for the mesh generation WITHOUT explicitly creating coordinates and then the mesh. Minimal example: here I would like ...
13
votes
1answer
382 views

How to enforce a symmetric solution with FEM?

I'm solving the laplace equation in a domain with holes, and I need to compute the integral of the gradient on the boundary of these holes. For that I define a mesh and solve the laplace equation ...
13
votes
1answer
1k views

How to create an ElementMesh of a Sphere

I want to create an ElementMesh of a "sphere". To reduce the computational effort I want to use HexahedronElement; the ...
13
votes
2answers
1k views

How do I place a texture on an irregular 3D model imported from an OBJ file?

I'm trying to reproduce a textured head in Mathematica, and I'm using a kind of 'net' of a head which contains all the features on the face. The texture looks like this: which is supposed to look ...
12
votes
2answers
414 views

VoronoiMesh without edges

How can I remove the edges of a VoronoiMesh? I would like to display only the closed cells not touching the border of the image. This is my binarized source image (imgbw): I am doing this: ...
12
votes
3answers
222 views

Trouble meshing a Corbino disc

I am trying to simulate current flow using FEM through this particular device (a Corbino disk) and I have difficulties generating the mesh for it. Here is the region: ...
12
votes
2answers
606 views

Finite element mesh not resolving features

I am trying to make a finite element mesh in 2D. The features are not found by ToElementMesh. This is a shelf bracket with nails. I build the region using ...
12
votes
3answers
2k views

Dashed mesh behind 3D object

I am trying to create a simple, almost transparent 3D sphere with a mesh that is made of solid lines if they are on the front surface (i.e. if they are directly visible) and of dashed lines if those ...
12
votes
2answers
160 views

Computing the surface area and volume of molecules

Here is a somewhat difficult problem I've had for a long while. Space-filling models of molecules can be easily generated by ChemicalData[], ...
12
votes
2answers
735 views

What are some useful (or hidden) properties of MeshRegion?

There is quite a bit of powerful functionality built in to MeshRegion, but it seems to be lacking in some areas. For example: extracting a list of edges that live ...
12
votes
2answers
183 views

How to Interpolate a 3D MeshRegion?

If you were given some discrete MeshRegion called r (you don't know R): ...
12
votes
1answer
246 views

RegionNearest and neighborhoods

In this previous question we see that RegionNearest isn't quite as 'capable' as Nearest for some things. Similarly, I need to ...
12
votes
1answer
556 views

Custom interpolation on unstructured grid (2D, 3D)

as I'm not satisfied with the way Mathematica interpolates data on unstructured grids, I would like to implement my own interpolation. I will aim for Crouzeix - Raviart type of (quadratic) triangular ...
12
votes
2answers
415 views

Integration of a PDE solution over a custom-defined subdomain

Preamble: In my previous question I raised a problem of a custom-chosen integration of the solution of a PDE. In that case it was an integration along a line lying within the PDE domain. The solution ...
12
votes
1answer
426 views

Why isn't ToElementMesh figuring out what my boundary is in 3D?

Bug introduced in 10.2 or earlier, and fixed in 11.0.0 I am trying to change the element mesh for a FEA application I'm doing. I thought I understood it, when I did it in 2D. Here's my shape: ...