Dear COMSOL experts,
I am wondering how to assign materials to domains from a matlab script. For example, I create a block "my_block" with
>> model.geom('geom1').feature.create('my_block', 'Block');
>> ... % define the properties of block here
Then I create a material called "superconductor" with
>> model.material.create('superconductor');
Now, if I assign the "my_block" to material "superconductor" through COMSOL GUI and save the result as m file, the assignment will look like this:
>> model.material('superconductor').selection.set([1]);
How do I find out programatically the correspondence between "my_block" and the number 1 that I need to specify as the parameter to the last command.
Thanks in advance,
Andrey
I am wondering how to assign materials to domains from a matlab script. For example, I create a block "my_block" with
>> model.geom('geom1').feature.create('my_block', 'Block');
>> ... % define the properties of block here
Then I create a material called "superconductor" with
>> model.material.create('superconductor');
Now, if I assign the "my_block" to material "superconductor" through COMSOL GUI and save the result as m file, the assignment will look like this:
>> model.material('superconductor').selection.set([1]);
How do I find out programatically the correspondence between "my_block" and the number 1 that I need to specify as the parameter to the last command.
Thanks in advance,
Andrey