How to create a geometry in Matlab livelink Comsol using downloaded code?

Hi everyone,
I am trying to create a 3D voronoi diagram for COMSOL using MATLAB livelink for COMSOL.
I am using this file from this link https://www.mathworks.com/matlabcentral/fileexchange/50772-polytope-bounded-voronoi-diagram-in-2d-and-3d
When I createda geometry in Matlab Livelink Comsol by follow step:
Step 1: On Comsol server I type model=ModelUtil.model('Model');
Step 2: On Matlab command:
model=ModelUtil.model('Model');
geom1=model.geom.create('geom1',3);
Step 3: I copy the code from demo file of the link above and paste on Matlab command.
Step 4: I enter and the software plot an image as I expected.
However, when I save the model as an mph file, and open it in COMSOL, there is nothing. I also type mphgeom(model) to open the model but it's empty.
That means the voronoi diagram is not included in the geometry.
My question is how can I add the voronoi diagram which create by another guy into geom1?
If you have any experience on this problem, please let me know. Thank you very much.

4 件のコメント

xin li
xin li 2020 年 3 月 3 日
Have you solved the problem?I am in the same trouble as you.Can you give me some guidance?
Trung Hoang Dinh
Trung Hoang Dinh 2020 年 3 月 9 日
It is because you didn't link the code to your geometry.
After running the file exchange, you will receive something. In my case I receive the coordinate of points. Then from that coordinate I can use livelink Matlab for COMSOL to generate my geometry.
Aditya Patil
Aditya Patil 2020 年 12 月 23 日
Hi Trung, you can consider posting an answer so that others who face the issue will be able to solve it.
jing xu
jing xu 2022 年 1 月 19 日
Hi Trung,I'm having the same problem, can you give some more specific guidance? Thank you very much!!

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeVoronoi Diagram についてさらに検索

質問済み:

2020 年 1 月 7 日

コメント済み:

2022 年 1 月 19 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by