Why are there entities missing after calling decsg() from pde-toolbox?

Hi!
I found some strange behaviour using descg. I created two almost identical raw geometry matices. The second one has just one more entity.
What I expect is that after calling decsg() and plotting the results should lead to the same image but that the second plot shows one more entity. Actually both images look the same. There's no error message at all.
Minimal code example to reproduce the behaviour:
%%Raw geometry matrices
gd_short = ...
[1 1 1 1 1 1; ...
0.030 -0.030 0 -0.036 -0.022 0; ...
-2.017 -2.017 -2.050 -1.954 -2.054 -1.965; ...
0.015 0.015 0.014 0.006 0.006 0.020];
% Same as gd_short, but with one circle added at the end
gd_long = ...
[1 1 1 1 1 1 1; ...
0.030 -0.030 0 -0.036 -0.022 0 -0.030; ...
-2.017 -2.017 -2.050 -1.954 -2.054 -1.965 -2.017; ...
0.015 0.015 0.014 0.006 0.006 0.020 0.020];
% Randomize entity order. Just uncomment following 2 lines
is = randperm(length(gd_long))
gd_long = gd_long(:,is);
% Decompose geometry matrices
dl_short = decsg(gd_short);
dl_long = decsg(gd_long);
% Show geometries in plot
figure();
subplot(1,2,1);
pdegplot(dl_short);
legend('short')
subplot(1,2,2);
pdegplot(dl_long);
legend('long')
Any help to understand this behaviour is appreciated.
Edit:
I played around with the order of the entities in the array. In some configurations I get the expected results. But I don't understand why. For me it seems to be pretty random. Added code lines to randomize the entity order.

Answers (0)

Asked:

on 31 May 2017

Edited:

on 1 Jun 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!