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.

Save comsol file as M.file, but without any parameter of geometry in script

Please login with a confirmed email address before reporting spam

Hi everyone,

I builded my model based on comsol 3.5a version, and then save it as to M.file. But when I save comsol file as to the .m file, the geometry file was produced as flbinary file .mphm (the example I list below). I do not want to get this script (flbilary), since the geometry parameter can not be changed. is there anybody know how to solve this problem?

Thanks.

% The name of this file is given by the variable 'flbinaryfile'.

flclear fem

% COMSOL version
clear vrsn
vrsn.name = 'COMSOL 3.5';
vrsn.ext = 'a';
vrsn.major = 0;
vrsn.build = 603;
vrsn.rcs = '$Name: $';
vrsn.date = '$Date: 2008/12/03 17:02:19 $';
fem.version = vrsn;

flbinaryfile='1.mphm';

% Geometry
clear draw
g247=flbinary('g247','draw',flbinaryfile);
draw.s.objs = {g247};
draw.s.name = {'CO1'};
draw.s.tags = {'g247'};
fem.draw = draw;
fem.geom = geomcsg(fem);
fem.mesh = flbinary('m1','mesh',flbinaryfile);

% (Default values are not included)



I want the form like this so that I can change the geometry parameter.


g1=ellip2(0.2,0.2,'base','center','pos',[0.4,-0.4]);
g2=ellip2(r,r,'base','center','pos',{'0','0'},'rot','0');
garr=geomarrayr(g2,pitch,pitch/sqrt(3),5,8);
[g40,g41,g42,g43,g44,g45,g46,g47,g48,g49,g50,g51,g52,g53,g54,g55,g56,g57,g58,g59,g60,g61,g62,g63,g64,g65,g66,g67,g68,g69,g70,g71,g72,g73,g74,g75,g76,g77,g78,g79]=deal(garr{:});
g80=ellip2(2.0E-4,2.0E-4,'base','center','pos',[-0.0010,6.0E-4]);
g81=ellip2(r,r,'base','center','pos',{pitch/2,pitch/(2*sqrt(3))},'rot','0');

4 Replies Last Post 09.04.2014, 19:13 GMT-4
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 11.02.2012, 04:16 GMT-5
Hi

from what I remember it was not possible, or you managed to save the history file script part of the geoemtry, before it generated the bin file.

That's one of the geat advantages of the new V4, as for mshing strategxy that is saved.

Managing to keep a maintenance is not trivial, but for software it's rather essential if one does not want to be kept behind, for my company it represents I believe 30-50% of the overhead depending on our activities ! This is indeed an difficult issue for many industrial or less richer companies/universities

--
Good luck
Ivar
Hi from what I remember it was not possible, or you managed to save the history file script part of the geoemtry, before it generated the bin file. That's one of the geat advantages of the new V4, as for mshing strategxy that is saved. Managing to keep a maintenance is not trivial, but for software it's rather essential if one does not want to be kept behind, for my company it represents I believe 30-50% of the overhead depending on our activities ! This is indeed an difficult issue for many industrial or less richer companies/universities -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 13.02.2012, 05:14 GMT-5

Hi

from what I remember it was not possible, or you managed to save the history file script part of the geoemtry, before it generated the bin file.

That's one of the geat advantages of the new V4, as for mshing strategxy that is saved.

Managing to keep a maintenance is not trivial, but for software it's rather essential if one does not want to be kept behind, for my company it represents I believe 30-50% of the overhead depending on our activities ! This is indeed an difficult issue for many industrial or less richer companies/universities

--
Good luck
Ivar


Hi,

Thanks for reply. so that means comsol v4 can solve this problem, comsol3.5a is impossible to solve this problem, is that right?:)





_________________________
I added cool smileys to this message... if you don't see them go to: s.exps.me
[QUOTE] Hi from what I remember it was not possible, or you managed to save the history file script part of the geoemtry, before it generated the bin file. That's one of the geat advantages of the new V4, as for mshing strategxy that is saved. Managing to keep a maintenance is not trivial, but for software it's rather essential if one does not want to be kept behind, for my company it represents I believe 30-50% of the overhead depending on our activities ! This is indeed an difficult issue for many industrial or less richer companies/universities -- Good luck Ivar [/QUOTE] Hi, Thanks for reply. so that means comsol v4 can solve this problem, comsol3.5a is impossible to solve this problem, is that right?:) _________________________ I added cool smileys to this message... if you don't see them go to: http://s.exps.me

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 13.02.2012, 06:14 GMT-5
Hi

i believe if you write all out in matlab (including geometry buildup you should manage) even in 3.5

--
Good luck
Ivar
Hi i believe if you write all out in matlab (including geometry buildup you should manage) even in 3.5 -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 09.04.2014, 19:13 GMT-4
Hi

I am using comsol 3.5 and I would like to use a matlab fuction in the comsol m-file to draw a new geometry.
I would like to use a superformula to draw a complex shape!
how can I set a new 2D geometry object in a m-file by calling a matlab function that plot a geometric shape?

I hope you could help me...
thanks in advance

Angel
Hi I am using comsol 3.5 and I would like to use a matlab fuction in the comsol m-file to draw a new geometry. I would like to use a superformula to draw a complex shape! how can I set a new 2D geometry object in a m-file by calling a matlab function that plot a geometric shape? I hope you could help me... thanks in advance Angel

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.