[Trilinos-Users] read Triangle sides labels with Sundance
Andrea Penza
pepe.aero at alice.it
Mon Sep 17 09:55:27 MDT 2012
Hi Kevin,
thanks for you reply.
I've attached a simple example of Triangle mesh I would like to use in
Sundance. It's a square domain.
Labels are: 10 for top; 20 for right; 30 for bottom; 40 for left. Here
you can find the source myMeshFile.poly file, and the three Triangle
output: myMeshFile.1.ele, myMeshFile.1.node, myMeshFile.1.poly .
The part regarding the reading of the mesh of my Sundance script is the
following:
// Geometry and solver:
std::string meshFile="myMeshFile.1";
std::string solverFile = "amesos.xml";
Sundance::setOption("meshFile", meshFile, "mesh file");
Sundance::setOption("solver", solverFile, "name of XML file for solver");
Sundance::init(&argc, &argv);
// Define vector type:
VectorType<double> vecType = new EpetraVectorType();
// Input Triangle mesh:
MeshType meshType = new BasicSimplicialMeshType();
MeshSource meshReader = new TriangleMeshReader( meshFile, meshType );
Mesh mesh = meshReader.getMesh();
// Define mesh domain:
CellFilter interior = new MaximalCellFilter();
CellFilter edges = new DimensionalCellFilter(1);
CellFilter top = edges.labeledSubset(10);
CellFilter right = edges.labeledSubset(20);
CellFilter bottom = edges.labeledSubset(30);
CellFilter left = edges.labeledSubset(40);
CellFilter boundary = left + bottom + right + top;
No errors are reported, but no boundary conditions are enforced by this
way and the computed solution results uniform and zero everywhere,
obviously.
Hope this can help you. Thanks for your support again!
Regards,
Andrea
On 17/09/2012 02:45, Kevin Long wrote:
> Andrea,
>
> Could you send me a simple Triangle mesh that shows this bug? I can look
> into the problem.
>
> I know that in the past Sundance was able to read edge labels in
> Triangle files.
>
> Regards,
>
> Kevin
>
>
>
> On 09/16/2012 04:09 PM, Andrea Penza wrote:
>> Hi all,
>>
>> I'm trying to generate mesh with Triangle in order to use Sundance.
>> Maybe there is a bug in the SundanceTriangleMeshReader (located in
>> packages/Sundance/src-std-mesh/Sources) function because it's unable to
>> read correctly labels of edges of mesh domain as int number. This is
>> very uncomfortable because in my opinion it makes Triangle quite useless.
>>
>> I think that something wrong could be in the part regarding the
>> readSides function starting from line 449 of the file
>> SundanceTriangleMeshReader.cpp.
>> Additional information about the data structure of the mesh can be found
>> in: packages/Sundance/src-std-mesh/Concrete/SundanceBasicSimplicialMesh.cpp.
>>
>> Has anyone already had this problem and maybe fixed it?
>> Thanks all for your support.
>>
>> Regards,
>>
>> Andrea
>>
>>
>> _______________________________________________
>> Trilinos-Users mailing list
>> Trilinos-Users at software.sandia.gov
>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>>
-------------- next part --------------
4 2 0 0
1 0 1 0
2 1 1 0
3 1 0 0
4 0 0 0
4 1
1 4 1 40
2 1 2 10
3 2 3 20
4 3 4 30
0
1
1 0.5 0.5 0.01
-------------- next part --------------
0 2 0 1
24 1
1 4 9 40
2 1 29 10
3 2 78 20
4 3 51 30
5 6 13 40
6 12 45 30
7 13 1 40
8 7 55 10
9 19 7 10
10 29 19 10
11 9 6 40
12 38 43 30
13 43 4 30
14 45 38 30
15 51 50 30
16 50 12 30
17 52 73 20
18 35 2 10
19 55 35 10
20 70 52 20
21 78 70 20
22 58 84 20
23 73 58 20
24 84 3 20
0
1
1 0.5 0.5 0.01 0.01
# Generated by triangle -pqa myMeshFile.poly
-------------- next part --------------
88 2 0 1
1 0 1 40
2 1 1 10
3 1 0 20
4 0 0 40
5 0.5 0.5 0
6 0 0.5 40
7 0.5 1 10
8 0.25 0.5 0
9 0 0.25 40
10 0.125 0.5 0
11 0.0625 0.625 0
12 0.5 0 30
13 0 0.75 40
14 0.43327543443213107 0.81584933289906558 0
15 0.1484375 0.74609375 0
16 0.1956261405109489 0.62156421076642332 0
17 0.52962499586661538 0.68324439460898945 0
18 0.375 0.62885305062135177 0
19 0.25 1 10
20 0.37313550900074843 0.73201270550848663 0
21 0.2867686191417268 0.58938846910458687 0
22 0.375 0.50083945378258887 0
23 0.27481986678646553 0.70071693552096026 0
24 0.3137705318264768 0.3112294681735232 0
25 0.3130659364168793 0.41614819988507334 0
26 0.28918615493304078 0.85572239634428071 0
27 0.077559621710526314 0.875 0
28 0.23294203584700171 0.7827667580159664 0
29 0.125 1 10
30 0.18698134678855172 0.90497429372268701 0
31 0.47257324666060985 0.59845098814981756 0
32 0.92456936064118667 0.625 0
33 0.38897993840448258 0.93606293841858523 0
34 0.53606518995036612 0.78922961567628291 0
35 0.75 1 10
36 0.0625 0.375 0
37 0.19315183542781397 0.36288116936288306 0
38 0.25 0 30
39 0.22101862158026681 0.26129441541322646 0
40 0.11073532013507222 0.25122446672755028 0
41 0.056756629730870346 0.125 0
42 0.34465572804830136 0.1427531442866759 0
43 0.125 0 30
44 0.21189079627194382 0.12802756845454155 0
45 0.375 0 30
46 0.54740172002426912 0.26698978947527341 0
47 0.44487538100418944 0.36457165162288918 0
48 0.41783796065692075 0.24323807149509363 0
49 0.47280982347261902 0.12631114662436704 0
50 0.625 0 30
51 0.75 0 30
52 1 0.5 20
53 0.6875 0.069481284914655148 0
54 0.58500240966811101 0.1162089505780271 0
55 0.625 1 10
56 0.64246704544050559 0.57098437397393664 0
57 0.50807399239447426 0.89291077861759471 0
58 1 0.25 20
59 0.66867863897940805 0.72798307699141429 0
60 0.74938714423766672 0.85201896128103261 0
61 0.62826903884430996 0.86974126560122611 0
62 0.73626150208893737 0.63601241447629642 0
63 0.80237334802561011 0.44049756204937723 0
64 0.82784039034512313 0.58647404143176685 0
65 0.74119148069045315 0.52874441616193868 0
66 0.6328063372494207 0.41191432788451787 0
67 0.61503331702314024 0.65625196965306609 0
68 0.85487216511730246 0.75231755757537988 0
69 0.53406502215390106 0.40720109859041587 0
70 1 0.75 20
71 0.875 0.92549053059766506 0
72 0.89780563983790773 0.48147827828916107 0
73 1 0.375 20
74 0.59179061574323111 0.49423369385854143 0
75 0.72248159295363856 0.26144142408502646 0
76 0.67208963027005952 0.17145705344504411 0
77 0.77427468452951675 0.13474677395192497 0
78 1 0.875 20
79 0.83963117913343555 0.84184522427749719 0
80 0.75955680132190018 0.75712578100555916 0
81 0.92930966639427359 0.8125 0
82 0.875 0.047041134623388256 0
83 0.86075905115610551 0.24403569861997024 0
84 1 0.125 20
85 0.80177526970640955 0.33341318489822758 0
86 0.90448791614187307 0.33704574986761704 0
87 0.8989783321191781 0.1477865827846096 0
88 0.63646021874921554 0.31213416816929301 0
# Generated by triangle -pqa myMeshFile.poly
-------------- next part --------------
150 3 0
1 76 77 75
2 27 13 15
3 8 16 10
4 8 21 16
5 24 47 25
6 10 6 36
7 16 15 11
8 6 11 13
9 25 22 8
10 38 44 43
11 41 9 4
12 17 20 18
13 15 16 23
14 13 11 15
15 25 47 22
16 28 15 23
17 24 37 39
18 14 17 34
19 6 10 11
20 10 16 11
21 34 57 14
22 18 21 22
23 29 30 19
24 1 13 27
25 14 20 17
26 14 26 20
27 23 18 20
28 17 18 31
29 33 57 7
30 59 34 17
31 22 21 8
32 26 14 33
33 10 37 8
34 22 5 31
35 16 21 23
36 18 23 21
37 37 24 25
38 42 39 44
39 10 36 37
40 48 24 42
41 15 28 30
42 20 26 28
43 29 1 27
44 20 28 23
45 28 26 30
46 30 27 15
47 30 29 27
48 19 30 26
49 22 31 18
50 31 5 74
51 88 85 66
52 7 57 55
53 7 19 33
54 19 26 33
55 59 17 67
56 71 35 60
57 55 57 61
58 33 14 57
59 6 9 36
60 8 37 25
61 36 9 40
62 39 42 24
63 44 40 41
64 37 36 40
65 44 38 42
66 9 41 40
67 40 39 37
68 12 49 45
69 24 48 47
70 49 48 42
71 40 44 39
72 41 4 43
73 43 44 41
74 50 51 53
75 42 38 45
76 68 64 32
77 46 88 69
78 22 47 5
79 42 45 49
80 46 47 48
81 46 49 54
82 46 48 49
83 50 53 54
84 31 56 67
85 72 73 52
86 12 50 54
87 57 34 61
88 3 82 51
89 64 65 63
90 54 49 12
91 60 61 59
92 67 62 59
93 59 61 34
94 62 64 68
95 87 58 83
96 74 65 56
97 54 53 76
98 68 80 62
99 61 35 55
100 68 32 70
101 61 60 35
102 65 62 56
103 71 2 35
104 65 66 63
105 66 85 63
106 70 32 52
107 72 32 64
108 31 74 56
109 63 72 64
110 47 69 5
111 69 88 66
112 31 67 17
113 62 67 56
114 70 78 81
115 80 79 60
116 46 69 47
117 74 69 66
118 32 72 52
119 65 64 62
120 78 2 71
121 79 80 68
122 75 77 83
123 79 71 60
124 77 51 82
125 72 63 86
126 69 74 5
127 65 74 66
128 46 54 76
129 86 63 85
130 77 76 53
131 76 75 88
132 51 77 53
133 87 84 58
134 68 70 81
135 71 79 81
136 60 59 80
137 62 80 59
138 71 81 78
139 68 81 79
140 87 77 82
141 58 73 86
142 75 83 85
143 82 3 84
144 86 85 83
145 58 86 83
146 72 86 73
147 77 87 83
148 82 84 87
149 76 88 46
150 85 88 75
# Generated by triangle -pqa myMeshFile.poly
More information about the Trilinos-Users
mailing list