forked from johannesgerer/jburkardt-m
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meshfaces.html
356 lines (319 loc) · 10.3 KB
/
meshfaces.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
<html>
<head>
<title>
MESHFACES - Automatic 2D Mesh Generation for Several Faces
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
MESHFACES <br> Automatic 2D Mesh Generation for Several Faces
</h1>
<hr>
<p>
<b>MESH2D</b>
is a MATLAB program which generates
unstructured meshes in 2D for a regeion which has been subdivided
into several faces,
by Darren Engwirda.
</p>
<p>
The program is based on MESH2D, and can be regarded as an extension of
the program to handle the additional constraint that the internal
boundaries shared by pairs of faces are required to be covered by
edges of the mesh triangles.
</p>
<h3 align = "center">
Usage:
</h3>
<p>
<blockquote>
[ <i>p, t, fnum, stats</i> ] = <b>meshfaces</b> ( <i>node, edge, hdata, options</i> );
</blockquote>
where:
<ul>
<li>s
<i>node</i>, an N by 2 list of (X,Y) coordinates of
node, used to dilineate the faces.
</li>
<li>
<i>edge</i>, an E by 2 list of pairs of indices that constitute
edges of the faces.
</li>
<li>
<i>faces</i>, a cell array of F entries. F{i} is a vector containing
a list of the edges, in counterclockwise order, that form the boundary
of the i-th face.
</li>
<li>
<i>hdata</i>, optional input, a structure containing element size
information.
</li>
<li>
<i>options</i>, optional input that allows the user to modify the
default behavior of the solver.
</li>
<li>
<i>p</i>, a NP by 2 list of the points used to define the mesh.
</li>
<li>
<i>t</i>, an NT by 3 list of point indices, forming counterclockwise
triangles.
</li>
<li>
<i>fnum</i>, an NT vector which indicates the face to which each
triangle belongs.
</li>
<li>
<i>stats</i>, the computational time, average and minimum triangle
quality, number of points and number of triangles.
</li>
</ul>
</p>
<h3 align = "center">
Licensing:
</h3>
<pre>
Copyright (c) 2009, Darren Engwirda
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
</pre>
<h3 align = "center">
Languages:
</h3>
<p>
<b>MESHFACES</b> is available in
<a href = "../../m_src/meshfaces/meshfaces.html">a MATLAB version</a>.
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../m_src/distmesh/distmesh.html">
DISTMESH</a>,
a MATLAB library which
carries out triangular or tetrahedral mesh generation,
by Per-Olof Persson and Gilbert Strang.
</p>
<p>
<a href = "../../m_src/mesh2d/mesh2d.html">
MESH2D</a>,
a MATLAB library which
can automatically create a triangular mesh for a given polygonal region,
by Darren Engwirda.
</p>
<p>
<a href = "../../m_src/mesh2d_hand/mesh2d_hand.html">
MESH2D_HAND</a>,
a MATLAB program which
reads in a set of 59 points which outline a human hand,
and calls MESH2D, which is able to create a fine triangular
mesh of the region outlined by the points.
</p>
<p>
<a href = "../../m_src/mesh2d_write/mesh2d_write.html">
MESH2D_WRITE</a>,
a MATLAB program which
demonstrates how node and element data from MESH2D can be written to files.
</p>
<p>
<a href = "../../m_src/test_triangulation/test_triangulation.html">
TEST_TRIANGULATION</a>,
a MATLAB library which
defines some test regions for triangulation.
</p>
<p>
<a href = "../../c_src/triangle/triangle.html">
TRIANGLE</a>,
a C program which
computes a triangulation of a geometric region,
by Jonathan Shewchuk.
</p>
<p>
<a href = "../../m_src/triangulation/triangulation.html">
TRIANGULATION</a>,
a MATLAB library which
performs various operations on order 3 ("linear") or order 6 ("quadratic") triangulations.
</p>
<p>
<a href = "../../m_src/tsearch/tsearch.html">
TSEARCH</a>,
a MATLAB library which
compares several replacements for MATLAB's obsolete tsearch() function,
which searched a Delaunay triangulation to find the triangle
that encloses a given point.
</p>
<h3 align = "center">
Author:
</h3>
<p>
Darren Engwirda
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "checkgeometry.m">checkgeometry.m</a>
checks a geometry input for MESH2D.
</li>
<li>
<a href = "circumcircle.m">circumcircle.m</a>
computes the center and radius of the circumcircle of a triangle.
</li>
<li>
<a href = "dist2poly.m">dist2poly.m</a>
finds the distance between a point and a polygon.
</li>
<li>
<a href = "findedge.m">findedge.m</a>
locates the edges that contain a sequence of points.
</li>
<li>
<a href = "fixmesh.m">fixmesh.m</a>
checks a triangular mesh for consistency.
</li>
<li>
<a href = "inpoly.m">inpoly.m</a>
determines whether a point is inside a polygon.
</li>
<li>
<a href = "meshfaces.m">meshfaces.m</a>
generates a triangular mesh for a polygonal region
which has been subdivided.
</li>
<li>
<a href = "meshpoly.m">meshpoly.m</a>
used to mesh a region.
</li>
<li>
<a href = "mydelaunayn.m">mydelaunayn.m</a>
computes the Delaunay triangulation of a set of points.
</li>
<li>
<a href = "quadtree.m">quadtree.m</a>
decomposes a polygonal region using a quadtree.
</li>
<li>
<a href = "quality.m">quality.m</a>
determines the "quality" of a triangle.
</li>
<li>
<a href = "timestamp.m">timestamp.m</a>
prints the YMDHMS date as a timestamp.
</li>
<li>
<a href = "tinterp.m">tinterp.m</a>
carries out linear interpolation at points within a triangle, given
function values at the vertices.
</li>
<li>
<a href = "triarea.m">triarea.m</a>
computes the area of one or more triangles, assuming their
vertices are given in counterclockwise order.
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<ul>
<li>
<a href = "meshfaces_test.m">meshfaces_test.m</a>
calls the tests.
</li>
<li>
<a href = "meshfaces_test_output.txt">meshfaces_test_output.txt</a>
the output file.
</li>
<li>
<a href = "meshfaces_test01.m">meshfaces_test01.m</a>
calls meshfaces() for a square that has been subdivided into
three regions.
</li>
<li>
<a href = "test01.png">test01.png</a>
an image of the mesh.
</li>
<li>
<a href = "meshfaces_test02.m">meshfaces_test02.m</a>
calls meshfaces() for two rectangles separated by a very thin
rectangle.
</li>
<li>
<a href = "test02.png">test02.png</a>
an image of the mesh.
</li>
<li>
<a href = "meshfaces_test03.m">meshfaces_test03.m</a>
calls meshfaces() for a circle inside a square.
</li>
<li>
<a href = "test03.png">test03.png</a>
an image of the mesh.
</li>
<li>
<a href = "meshfaces_test04.m">meshfaces_test04.m</a>
calls meshfaces() for a battery design with 7 regions.
</li>
<li>
<a href = "test04.png">test04.png</a>
an image of the mesh.
</li>
<li>
<a href = "test04_nodes.txt">test04_nodes.txt</a>
the nodes of the mesh.
</li>
<li>
<a href = "test04_elements.txt">test04_elements.txt</a>
the elements of the mesh.
</li>
<li>
<a href = "meshfaces_test05.m">meshfaces_test05.m</a>
calls meshfaces() for a square inside a square.
</li>
<li>
<a href = "test05.png">test05.png</a>
an image of the mesh.
</li>
<li>
<a href = "test05_nodes.txt">test05_nodes.txt</a>
the nodes of the mesh.
</li>
<li>
<a href = "test05_elements.txt">test05_elements.txt</a>
the elements of the mesh.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../m_src.html">
the MATLAB source codes</a>.
</p>
<hr>
<i>
Last revised on 23 August 2014.
</i>
<!-- John Burkardt -->
</body>
<!-- Initial HTML skeleton created by HTMLINDEX. -->
</html>