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.

geomcomp and geomdel function in comsol 3.5a for matlab live link

Please login with a confirmed email address before reporting spam

Is there any equivalent function in comsol 5.1 as “geomcomp” and “geomdel” which is used to use in comsol 3.5a for matlab live link ? Or what is the meaning of the functions? I give an example code below :

g1=rect2(1.4E-8,0.2E-8,'base','corner','pos',[-0.2E-8,1.0E-8]);
g2=rect2(1.4E-8,0.2E-8,'base','corner','pos',[-0.2E-8,-0.2E-8]);
g3=rect2(0.2E-8,1.0E-8,'base','corner','pos',[-0.2E-8,0]);
g4=rect2(0.2E-8,1.0E-8,'base','corner','pos',[1.0E-8,0]);

g5=geomcomp({g1,g2,g3,g4},'ns',{'g1','g2','g3','g4'},'sf','g1+g2+g3+g4','edge','none');

g6=geomdel(g5);

2 Replies Last Post Apr 12, 2018, 6:24 a.m. EDT
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Apr 12, 2018, 6:18 a.m. EDT
Updated: 7 years ago Apr 12, 2018, 10:39 a.m. EDT

Hi

geomcomp makes a composition of geometric objects. In this case it makes a union of the objects. geomdel removes interior boundaries.

In modern versions of Comsol your example looks like this (I have also attached the code as a file to make the code more readable).

import com.comsol.model.util.*
model = ModelUtil.create('Model');
model.modelNode.create('comp1', true);
model.geom.create('geom1', 2);
model.geom('geom1').model('comp1');
model.mesh.create('mesh1', 'geom1');
model.geom('geom1').create('r1', 'Rectangle');
model.geom('geom1').feature('r1').set('pos', {'-0.2e-8' '1e-8'});
model.geom('geom1').feature('r1').set('size', {'1.4e-8' '0.2e-8'});
model.geom('geom1').feature.duplicate('r2', 'r1');
model.geom('geom1').feature('r2').set('pos', {'-0.2e-8' '-0.2e-8'});
model.geom('geom1').feature.duplicate('r3', 'r2');
model.geom('geom1').feature('r3').set('size', {'0.2e-8' '1e-8'});
model.geom('geom1').feature('r3').set('pos', {'-0.2e-8' '0'});
model.geom('geom1').feature.duplicate('r4', 'r3');
model.geom('geom1').feature('r4').set('pos', {'1e-8' '0'});
model.geom('geom1').create('uni1', 'Union');
model.geom('geom1').feature('uni1').selection('input').set({'r1' 'r2' 'r3' 'r4'});
model.geom('geom1').feature('uni1').set('intbnd', false);
mphgeom(model)
-------------------
Lars Gregersen
Comsol Denmark
Hi geomcomp makes a composition of geometric objects. In this case it makes a union of the objects. geomdel removes interior boundaries. In modern versions of Comsol your example looks like this (I have also attached the code as a file to make the code more readable). import com.comsol.model.util.* model = ModelUtil.create('Model'); model.modelNode.create('comp1', true); model.geom.create('geom1', 2); model.geom('geom1').model('comp1'); model.mesh.create('mesh1', 'geom1'); model.geom('geom1').create('r1', 'Rectangle'); model.geom('geom1').feature('r1').set('pos', {'-0.2e-8' '1e-8'}); model.geom('geom1').feature('r1').set('size', {'1.4e-8' '0.2e-8'}); model.geom('geom1').feature.duplicate('r2', 'r1'); model.geom('geom1').feature('r2').set('pos', {'-0.2e-8' '-0.2e-8'}); model.geom('geom1').feature.duplicate('r3', 'r2'); model.geom('geom1').feature('r3').set('size', {'0.2e-8' '1e-8'}); model.geom('geom1').feature('r3').set('pos', {'-0.2e-8' '0'}); model.geom('geom1').feature.duplicate('r4', 'r3'); model.geom('geom1').feature('r4').set('pos', {'1e-8' '0'}); model.geom('geom1').create('uni1', 'Union'); model.geom('geom1').feature('uni1').selection('input').set({'r1' 'r2' 'r3' 'r4'}); model.geom('geom1').feature('uni1').set('intbnd', false); mphgeom(model)


Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Apr 12, 2018, 6:24 a.m. EDT
Updated: 7 years ago Apr 12, 2018, 6:26 a.m. EDT

Hi

-------------------
Lars Gregersen
Comsol Denmark
Hi

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.