No added points on the boundary

Jul 2, 2014 at 6:52 PM
wo, thanks so much for your help.

I have another two related questions, so I open another thread.

How can I avoid adding additional vertexes to my boundary. Also, I added a set of vertexes into the polygon, after smoothing, those points are moved. I want those points fixed in the domain to simulate some structures. For example, I added some dense points in the floodplain of rivers to simulate side channel. How do I can better quality of mesh using smoothing or other functions while fixing those vertexes.

Many thanks.

Jul 2, 2014 at 7:14 PM
Edited Jul 2, 2014 at 7:16 PM
To prevent boundary segment splitting, set the ConstraintOptions property SegmentSplitting:
  • SegmentSplitting = 0 is the default splitting behavior
  • SegmentSplitting = 1 means no new vertices on the boundary
  • SegmentSplitting = 2 prevents all segment splitting, including internal boundaries
var options = new ConstraintOptions() { SegmentSplitting = 1 };
var quality = new QualityOptions() { MinimumAngle = 25 };

var mesh = poly.Triangulate(options, quality);
Points that should not be moved during smoothing must have a mark > 0, e.g.
int fixedNodeMark = 1;
poly.Add(new Vertex(x, y, fixedNodeMark));
Jul 2, 2014 at 7:39 PM
Edited Jul 2, 2014 at 8:13 PM
I think that I got it after your suggestion. Can you explain a little bit about vertex and edge marks? Originally I did not have any marker on the edge, and I still have split segment on the boundary. After I added a marker (5) on the edges, no additional vertex was added. Can you give me an explanation of the markers. For vertex, if it is >0 it is fixed and for edge if it is >0 it is a boundary. Am I right?

Many thanks.

// Add the points.
poly.Add(new Vertex(0.0, 0.0)); // Index 0
poly.Add(new Vertex(3.0, 0.0)); // Index 1 etc.
poly.Add(new Vertex(3.0, 3.0));
poly.Add(new Vertex(0.0, 3.0, 1)); // Add a marker, fixed point?  why do I need this marker?
poly.Add(new Vertex(1.0, 1.0));
poly.Add(new Vertex(2.0, 1.0));
poly.Add(new Vertex(2.0, 2.0));
poly.Add(new Vertex(1.0, 2.0));

// Add the segments. Notice the zero based indexing (in
// contrast to Triangle's file format).
poly.Add(new Edge(0, 1));
poly.Add(new Edge(1, 2));
poly.Add(new Edge(2, 3, 5)); // Add a marker. what is 5 meaning?
poly.Add(new Edge(3, 0, 5));
poly.Add(new Edge(4, 5));
poly.Add(new Edge(5, 6));
poly.Add(new Edge(6, 7));
poly.Add(new Edge(7, 4));
Jul 2, 2014 at 8:20 PM
Edited Jul 2, 2014 at 8:27 PM
No. Thanks for reporting. It's a bug in the smoother code. It doesn't copy the mesh settings. Try the latest source code.

EDIT: regarding the markers: generally, it's just a means of identifying items in the mesh. For example, if you're doing FEM and have different boundary conditions, just add a different marker and you can easily identify them when assembling the linear system.
The smoother is just another example of using markers to distinguish fixed from free vertices.
Jul 2, 2014 at 8:34 PM
Thanks a lot. It works perfect right now. Victor