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.

Matlab command for magnetic fields api

Please login with a confirmed email address before reporting spam

Hello all

what is the constructor name for the physics modual magnetic fields? Here is my code so far:
%Create Model
model = ModelUtil.create('Model');

model.baseSystem('ips');

%Create Geom
geom1 = model.geom.create('geom1',2);
imp1 = geom1.feature.create('imp1','Import');
imp1.set('filename',filename);
imp1.importData;
geom1.run;

%mphgeom(model,'geom1');

%Create Mesh
model.mesh.create('mesh1','geom1');
model.mesh('mesh1').run;
% Setup physics
model.physics.create('mf', 'Magnetic Fields', 'geom1');


Please help with the last line of code. There is no such physics as Magnetic Fields. What is it then??
Thanks,
Stephen

1 Reply Last Post 14 févr. 2012, 11:41 UTC−5

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 févr. 2012, 11:41 UTC−5
I don't know how to get all available names via the command line. But: Just create a simple model in the COMSOL GUI with the physics interface that you want.

Then: View -> Model Builder Node Label -> Show Name and Tag. The tag should now be displayed right behind the particular physics interface node.
Or: click on File -> Save as model m file. Open the saved file with an editor and have a look at the source code.
I don't know how to get all available names via the command line. But: Just create a simple model in the COMSOL GUI with the physics interface that you want. Then: View -> Model Builder Node Label -> Show Name and Tag. The tag should now be displayed right behind the particular physics interface node. Or: click on File -> Save as model m file. Open the saved file with an editor and have a look at the source code.

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.