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.

Issues with meshing in Comsol for Matlab

Please login with a confirmed email address before reporting spam

I am using MATLAB to run optimization loops on my COMSOL model. I do change some model input parameters in the optimization, but it doesnt change the number of domains or boundaries, only the size of them, so I dont expect that the explicit selections I use are affected.

I create a distribution of mesh nodes along a boundary (the identity pair in the airgap of an electric machine) and copy them to the destination of the identity pair, as well as a few other boundaries in the design.

The issue I am having is that the Livelink model occasionally fails, giving the error message here:

A problem occurred when building mesh feature [name of mesh feature]. Could not copy to any destination entity

I am especially confused since it seems inconsistent when it fails in MATLAB (sometimes it fails on the first copy operation, sometimes on the third, and it does not always fail). If I use the parameters from the MATLAB optimization in the actual COMSOL model (not Livelink) the model builds and simulates correctly.

I can supply the model files if necessary. I am using COMSOL 5.3.1.229, and MATLAB 9.2.0.538062 (R2017a). These are the default versions that my system administrator provides, but I can use different versions if necessary.

Thanks in advance,

Nathan Wiegman


2 Replies Last Post May 22, 2018, 6:53 a.m. EDT
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago May 18, 2018, 7:26 a.m. EDT
Updated: 6 years ago May 23, 2018, 6:25 a.m. EDT

Hi

The problem is most likely caused by renumbering of the geometric entities when you change the geometry.

In order to investigate please supply us with model files and your script (either here or by sending the files to support).

-------------------
Lars Gregersen
Comsol Denmark
Hi The problem is most likely caused by renumbering of the geometric entities when you change the geometry. In order to investigate please supply us with model files and your script (either here or by sending the files to support).

Please login with a confirmed email address before reporting spam

Posted: 6 years ago May 22, 2018, 6:53 a.m. EDT

Lars is correct. I was able to resolve the issue by using resulting boundary selections of the objects I used to create the airgap.

Lars is correct. I was able to resolve the issue by using resulting boundary selections of the objects I used to create the airgap.

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.