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.

Creating a Random Distribution of Nanowires (Random Geometry Feature and Java scripting)

Please login with a confirmed email address before reporting spam

Hi all,

I am new user of COMSOL and Programming languages (in general). I want to model a random distribution of nanowires in a rectangular area. I have two questions....

1) Is it possible using COMSOL GUI to generate random distribution of a geomatery feature?

2) I tried saving my with single geometry feature in .java format so that I define a random function and can make a loop in java text editor to have randomly distributed copies of my geometry feature and import back the .class file. However, I am unable to write loop in Java or define random function, since I do not know the syntex and format of the commands. Can anyone tell me where I can find Java routines in such a format that COMSOL .class file can be compiled?

3) Using MATLAB can also be one option but I want to aviod that, unless its very much required.

Any other suggestions how this can be achieved will be really appreciated.


Best Regards,
Rameez Ahmad

1 Reply Last Post 2017/06/05 11:30 GMT-4
COMSOL Moderator

Hello Rameez Ahmad

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.


Walter Frei COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 2017/06/05 11:30 GMT-4
Hello,

You may find this approach (new to version 5.3) helpful:
www.comsol.com/blogs/how-to-create-a-randomized-geometry-using-model-methods/

Best Regards,
Hello, You may find this approach (new to version 5.3) helpful: https://www.comsol.com/blogs/how-to-create-a-randomized-geometry-using-model-methods/ Best Regards,

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.