Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

function geominfo crashes MATLAB

Please login with a confirmed email address before reporting spam

Hi,

I'm trying to write a function that will allow me to determine what faces are in a 3D region. To do this, I am attempting to use geominfo to collect the coordinate information of the faces of a geometry. I am starting by using the example given in the documentation for the geominfo function as given below.

-----------------------

% Create a solid block object with a circular curve object on top
g3 = geomcsg({block3},{},...
{move(embed(circ1(0.5,0.5,0.3)),[0 0 1])})
geomplot(g3,'facelabels','on')

% The generated object g3 is a solid 3D object consisting of 1
% subdomain, 7 faces, 16 edges and 12 vertices.
[gd,no,rng,ud,nbs] = geominfo(g3,...
'out',{'gd' 'no' 'rng' 'ud' 'nbs'},'od',0:3);

% The following commands, set up parameter matrices in two
% different formats, for faces 4, 5, and 7.
[u,v] = meshgrid(0:0.2:1,0:0.2:1);
S1 = reshape([u(:) v(:)],1,36,2);
B1 = 7;
S2(1,:,:) = deal([u(:) v(:)]);
S2(2,:,:) = deal([u(:) v(:)]);
B2 = [4;5];

% Parameter values for the bounding edges of face 7, can be
% obtained by the following commands.
adj = geominfo(g3,'out','adj','odp',[1;2])
S3 = repmat(linspace(rng{2}(1,13),rng{2}(2,13),10),[4 1 1]);
B3 = find(adj{1}(:,7));

% Now, coordinate values of the faces and edges given above,
% together with coordinates for vertex 3, are obtained as follows.
[xx] = geominfo(g3,'out',{'xx'},...
'par',{{B1 S1} {B2 S2} {B3 S3} {3}})

% To see the obtained results, simply give the following commands.
hold on
plot3(xx{1}(:,:,1),xx{1}(:,:,2),xx{1}(:,:,3),'r.')
plot3(xx{3}(:,:,1),xx{3}(:,:,2),xx{3}(:,:,3),'b.')

% Finally, derivatives and curvatures, for both faces and edges are
% with the command below.
[dx,crv] = geominfo(g3,'out',{'dx' 'crv'},...
'par',{{B1 S1} {B3 S3}})

-----------------------

When the code reaches this portion:

[xx] = geominfo(g3,'out',{'xx'},...
'par',{{B1 S1} {B2 S2} {B3 S3} {3}})

MATLAB crashes. Any insight as to how I can fix this issue would be greatly appreciated. I am running COMSOL 3.5a and MATLAB r2009b on mac OS X 10.5.8.

Thanks,

Matt

3 Replies Last Post 21.12.2010, 23:46 GMT-5

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10.12.2009, 12:09 GMT-5
Hey,

this looks similar to a problem I had with matlab-comsol. Check the thread :

www.comsol.com/community/forums/general/thread/1667/#p5045

Hans
Hey, this looks similar to a problem I had with matlab-comsol. Check the thread : http://www.comsol.com/community/forums/general/thread/1667/#p5045 Hans

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 21.12.2010, 22:59 GMT-5
I am having the exact same issue! I am using Matlab 7.9.0.529 (R2009b) and COMSOL 3.5a. Even if I construct my own call to geominfo, it seems any time I try to extract 'xx' as an output argument, matlab crashes immediately. It's unfortunate, because I've figured everything else out and the coordinates are the last step in a painful struggle to get the info I need.
I don't know anymore about it than the OP, but was hoping my post would get it more attention.
I am having the exact same issue! I am using Matlab 7.9.0.529 (R2009b) and COMSOL 3.5a. Even if I construct my own call to geominfo, it seems any time I try to extract 'xx' as an output argument, matlab crashes immediately. It's unfortunate, because I've figured everything else out and the coordinates are the last step in a painful struggle to get the info I need. I don't know anymore about it than the OP, but was hoping my post would get it more attention.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 21.12.2010, 23:46 GMT-5
Hey,

I updated my Matlab from 2009b -> 2010a and also installed all the relevant hotfixes and now it works fine. I hope this is an option for you to be able to do! I'm lucky that I'm at a university where matlab is cheap.

for Science,
-Alex
Hey, I updated my Matlab from 2009b -> 2010a and also installed all the relevant hotfixes and now it works fine. I hope this is an option for you to be able to do! I'm lucky that I'm at a university where matlab is cheap. for Science, -Alex

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.