How to input geometry?

Mar 21, 2013 at 6:29 PM
I am going to use this program. Although I could understand the main algorithm, I am a little confused about some parts of input geometry. When the generate button in Formgenerator is clicked, an object from inputGeometry is created but how the capacity is calculated?
InputGeometry(int capacity)
Coordinator
Mar 21, 2013 at 6:57 PM
Edited Mar 21, 2013 at 6:59 PM
You shouldn't worry about the capacity parameter too much. The InputGeometry class uses List<Vertex> to store the points, so if you know the number of points your geomerty will contain, you can use the overloaded constructor to allocate memory up-front. I don't think it will make a big difference unless your geometry contains a huge amount of points ...
Mar 22, 2013 at 3:07 PM
I have another question, In document related to the InputGeometry, there is an Example which used boundary marker "5". What does it mean?
Coordinator
Mar 22, 2013 at 3:32 PM
Edited Mar 22, 2013 at 3:33 PM
So, your question is what the boundary markers are good for?

Say you're doing Finite Element (FE) calculations for example. Then you have a domain and boundary conditions which impose constraints on the mesh nodes and segments. Using boundary markers will help you assigning the correct constraints to associated nodes in the FE matrix. You don't have to process the mesh manually, because Triangle.NET will assign the right boundary markers to spilt segments and nodes added to the mesh.

If you're not into numerics and FE, you probably won't need to care about boundary markers.
Mar 22, 2013 at 3:55 PM
Actually I want to implement this program to my program. And I want to know how to create the List<Vertex> and other things to give to the Triangle program and get the mesh. But I am a little confused, as I am a beginner in programming in C#. So, what exactly I need to give the program?
I tried to understand the program algorithm by debugging step by step. But When I click on Generate button on formgenerator, suddenly an object from InputGeometry starts to be build. And I don't have any idea that is in a kind of Loop? If it's possible for you, please explain how it works in getting the points. In this way, I can do exactly the same. Or let me know in where it starts to build the input data.
Coordinator
Mar 23, 2013 at 1:22 PM
Edited Mar 23, 2013 at 1:26 PM
Don't pay too much attention to the build in generators. To use the library you have to understand the InputGeometry class. Please have a look at the documentation and then tell me if there is anything unclear.

Now, regarding the input generators: They all implement the interface IGenerator. So when a generator is selected in the listbox, I know I can call the Generate method on the object. The Generate method is the place where the geometry is built.
Mar 26, 2013 at 9:45 PM
Dear wo80 Thanks a lot. Finally I could find out all the details. Thanks for your help.
Mar 27, 2013 at 3:07 PM
Dear wo80 I have another question, what exactley StopWatch Class do and Is it okay that not using StatisticVeiw?
Coordinator
Mar 27, 2013 at 4:18 PM
The Stopwatch class comes with the System.Diagnostics namespace and lets you measure execution time. You can remove it. And if you don't want the statistics view, you can remove the whole tab.
Mar 28, 2013 at 10:05 PM
Thanks wo80. I have another question, after meshing, is it possible to specify that each triangle belongs to which region (In case that we have more than one region)?
Coordinator
Mar 29, 2013 at 12:15 AM
Edited Mar 29, 2013 at 12:17 AM
That's not possible at the moment. But you can easily fix this: just add a setter to the ITriangle interface property
int Region { get; set; }
and then fix Triangle.cs
public int Region
{
    get { return this.region; }
    set { this.region = value; }
}
Mar 29, 2013 at 2:42 PM
Thanks wo80. I have another question, after meshing, is it possible to specify that each triangle belongs to which region (In case that we have more than one region)?