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
7
votes
1answer
73 views

Is this a bug of BoundingRegion?

...
1
vote
0answers
28 views

Discretizing a (kinked) line and showing how the points were determined

Suppose I have a (kinked) line, for example 2-x==y && x< 1 3-2x == y && 1.5>=x>= 1 I want to take this kinked line and represent ...
0
votes
1answer
34 views

Manipulate MeshRegion as normal Mathematica expression

A MeshRegion seems to function quite differently from any other Mathematica expression. One cannot take a Part of it. Nor can I ...
5
votes
1answer
153 views

Where to get the detailed code of MMA for grid mesh

I know DelaunayMesh can triangulate the specified area, but I can't see the code and partition idea of this built-in function. I want to know how to get the source ...
1
vote
2answers
65 views

Blunt edges of an octahedron by Region

Why does the octahedron constructed by the following code have blunt edges ? Region[ImplicitRegion[Abs[x] + Abs[y] + Abs[z] <= 1, {x, y, z}]] How to improve it?...
11
votes
2answers
484 views

A Smooth and Round Voronoi Mesh

I want the edges of a VoronoiMesh to be smooth and round. I have found the following code from this answer ...
4
votes
3answers
122 views

Cell-adjacency Graph of a Square Mesh

Consider the list of points pts = {{1, 1}, {1, 2}, {2, 1}, {2, 2}} I want to use them to define a 2x2 square mesh using ...
15
votes
3answers
586 views

VoronoiMesh as a TogglerBar

Is it possible to use a VoronoiMesh to define a TogglerBar or SetterBar type ...
2
votes
1answer
93 views

Selecting Edges and Corners in a Mesh

Consider the following VoronoiMesh obtained after a few iterations of Lloyd's relaxation algorithm ...
1
vote
0answers
23 views

Holding and dragging mouse to select multiple buttons/cells

Is it possible to create a TogglerBar-type object in which several buttons can be selected/deselected simply by holding the mouse's left-click button and dragging ...
10
votes
3answers
699 views

Creating a Hexagonal Lattice with VoronoiMesh

I want to create a hexagonal lattice using VoronoiMesh. One can achieve that with the following code, where L=5, ...
1
vote
0answers
46 views

Converting .stl files to meshes for FEA

I'm trying to conduct finite element analysis on imported .stl models from SketchUp. I can't seem to generate an ElementMesh. I think it may be something to do with intersecting boundaries, and this ...
0
votes
0answers
39 views

How to perform adaptive mesh refinement on a 3D element consisting of 4 superimposed meshes on AceFem?

I'm trying to perform adaptive mesh refinement on a body that is composed of 4 separate meshes joined together. The body is composed of the following individual meshes: ...
4
votes
1answer
62 views

Keep mesh of triangulation under complex valued transformation

I try to make a quick tool for "plotting" complex valued functions. Therefore I generate a Table of complex valued points lying in the complex plane building a ...
2
votes
1answer
62 views

Colouring cells in a Voronoi mesh [closed]

Consider the following code ...
11
votes
3answers
200 views

Inaccurate result from ImplicitRegion

I'm trying to describe the intersection of two cylinders by an ImplicitRegion (in order to use it in NDSolve later). ...
7
votes
2answers
112 views

Using mesh cell highlighting to override the default rendering of a region

The default rendering of a region can be rather uninformative. Consider this simple example. DiscretizeRegion[Rectangle[{0, 0}, {2, 1}], MaxCellMeasure -> 2] ...
23
votes
2answers
740 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 ...
5
votes
1answer
142 views

Area of an Annulus (MeshTools<>NIntegrate)

In a very simple example I try to describe an annulus using MeshTools package mesh2D = AnnulusMesh[{0, 0}, { 1 , 2 }, {-Pi, Pi}, {36, 10}]; The area given ...
11
votes
6answers
1k views

Change appearance of ConvexHullMesh

I'm struggling to understand the behaviour of ConvexHullMesh (or rather the non-behaviour). I have a polygon p ...
3
votes
1answer
81 views

RegionUnion works but RegionIntersection does not

I am trying to create an Alberti's window figure as described in this question, in which a (three-dimensional) polyhedron (e.g., dodecahedron) is projected onto a (two-dimensional) plane. I realized ...
10
votes
2answers
312 views

Generating Mesh of Rotated Graphics

I have a simple geometry that consists of a few rotated rectangles ...
8
votes
2answers
144 views

How to mesh a region with inclusions touching the boundary

Suppose you have a region composed of two materials. You define the inclusions of material 1 through, e.g., disks, ellipsoids, ...
5
votes
2answers
146 views

Automatic solution to label boundary elements with BoundaryMarkerFunction

Preparations Mathematica 11.3, Windows. Let us say I have a rectangular region with 10 little holes inside. Their coordinates are given by positionList. The ...
10
votes
5answers
520 views

Grainy 2D RegionIntersection Plot: How can I make it smoother?

I have the following code to display three coloured disks and their coloured intersections. However, the result does not appear to have been anti-aliased enough. How can I make it smoother? ...
2
votes
2answers
59 views

Select Part of a boundary mesh

I would like to pick a part of a boundary mesh, for example bm=BoundaryMesh[Cuboid[]] Is it possible to select the part(side) ...
0
votes
1answer
63 views

How to auto-rotate a MeshRegion?

I have a 3D MeshRegion region1 as below: ...
39
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 ...
7
votes
3answers
370 views

Can one use MeshRefinementFunction to obtain a nonobtuse triangulation?

I have a planar convex polygonal region Rc. I would like to triangulate it such that every triangle is nonobtuse. I was hoping that the ...
3
votes
3answers
324 views

hollow square plate mesh [duplicate]

I have this square region and I want to generate a mesh it using quadrilateral elements for it and get the coordinates and incidents
13
votes
3answers
621 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 ...
4
votes
1answer
108 views

Adaptive Meshrefinement NDSolve&FiniteElements

In a simple example I try to solve the heat equation using NDSolve and Method->"FiniteElement". I know that NDSolve gives ...
2
votes
1answer
30 views

Draw Lines on 3D Plot at certain coordinate

Following this example, I though it would be as easy as this: ...
0
votes
1answer
82 views

Nonatomic expression expected at position 1 in First[None]

This is a follow-up question to an earlier question:Solving a system of PDEs on a piecewise polynomial domain. I tried to solve the system of equations from one of my previous post with the different ...
15
votes
3answers
291 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[], ...
6
votes
3answers
462 views

Compare FEM mesh with the mesh created within Mathematica

This is a follow-up question to an earlier question: Make uniform mesh with quad elements Question: How to solve system of equations with NDsolve on the mesh created in Ansys in order to compare it ...
2
votes
2answers
139 views

How to extrude a planar mesh to a volume slice?

Is there an easy way to extrude a planar 2D-mesh to a volume slice? ring = RegionDifference[Disk[{0, 0}, 1], Disk[{0, 0}, 1/2]]; DiscretizeRegion[ring] The ...
3
votes
1answer
83 views

Unable to use ElementMarker in DirichletCondition with structured quad mesh

I would like to use ElementMarker in a DirichletCondition on a structured quad mesh, but I am receiving the error: ...
0
votes
1answer
64 views
8
votes
2answers
232 views

Make uniform mesh with quad elements

I have the following code that generates a finite element mesh with triangular elements which by using command ToQuadMesh I convert to the quadrilateral elements, but I am not able to make the uniform ...
3
votes
3answers
378 views

Nearly equally spaced 3D-mesh

How to mesh a volume (3D region) with nearly equaly spaced vertices? Example: Disk with radius 50 and height 15 ...
4
votes
1answer
101 views

control FEM grid size for 1D regions

I need to manage the mesh size for finite element method solution to a differential equation, where properties change over two regions. This is for one dimension. I created a boundary mesh of three ...
3
votes
1answer
96 views

Mesh a hollow cylinder

Questions seems to be simple answerde, but in Mathemtica v11.0.1 I didn't find a solution ...
1
vote
1answer
111 views

How to solve wave equation with finite elements when material properties vary continuously over a region

I am solving the one-dimensional wave equation over regions where the bulk modulus (and thus the wave speed) vary continuously over a region. The current version seems to assume that the material ...
2
votes
1answer
65 views

Unwanted mesh line in spherical plot

I am trying to create a spherical colour plot on which the mesh will rotate with manipulating the \phi1 variable. I read this solution and gave it a try with the following code: ...
1
vote
0answers
44 views

Combining MeshRegions of generated 3D shapes and RandomPolygons

I am interested in generating 3D a joint BoundaryMeshRegion or a MeshRegion from different shapes and polygons. This works for <...
1
vote
2answers
97 views

How to sample numerically a function using a mesh-grid function in 3D?

I am working on a problem where I want to sample a scalar function f[x,y,z]. The problem is how to obtain a mesh-grid in 3D (A grid of points in x,y, and z). In order to study this function. Of ...
1
vote
0answers
106 views

Calculate the intersection points of a line and a parametrically defined 3D surface

Thanks to Henrik Schumacher for advice to simplify the sample code: I would be grateful for any pointers on the following issue. A line from an external point intersects the surface at 2 points (...
6
votes
2answers
95 views

How to refine a linear FEM mesh in three regions?

I am trying to solve the one-dimensional wave equation with a frequency dependent source function over three intervals with varying velocity. I need to refine the mesh over the low velocity regions ...
22
votes
1answer
648 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 ($...