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.

Add spheres based on x, y, and z coordinates and radius from txt file

Please login with a confirmed email address before reporting spam

I have a list of spheres in a text file that has the format of x, y, z, and radius. Is there an easy way have COMSOL add these spheres to the geometry? The only module beyond the base product that I have is the RF Module. An example of my sphere coordinate/radius file would look something like:

10    20    5    4
13.6    18.2    5    6.1
.
.
.
42    23    5    3.1

4 Replies Last Post 01.10.2019, 13:51 GMT-4
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 01.10.2019, 12:19 GMT-4

Hi Paul,

if you are willing to do some Java coding you can automate it in a model method or in an application method. There is no option for that in the GUI.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi Paul, if you are willing to do some Java coding you can automate it in a model method or in an application method. There is no option for that in the GUI. Cheers Edgar

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 01.10.2019, 12:23 GMT-4
Updated: 5 years ago 01.10.2019, 08:23 GMT-4

if you are willing to do some Java coding you can automate it in a model method or in an application method. There is no option for that in the GUI.

I'm happy to do some coding, but haven't really explored the model methods/application methods much. Are there any tricks to importing the text files in these methods?

>if you are willing to do some Java coding you can automate it in a model method or in an application method. There is no option for that in the GUI. I'm happy to do some coding, but haven't really explored the model methods/application methods much. Are there any tricks to importing the text files in these methods?

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 01.10.2019, 12:34 GMT-4

Well, no tricks. The java API has most or even all standard methods, and of course the file methods available. I would recommend to check the documentation and some examples in the application library.

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Well, no tricks. The java API has most or even all standard methods, and of course the file methods available. I would recommend to check the documentation and some examples in the application library.

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 01.10.2019, 13:51 GMT-4
Updated: 5 years ago 01.10.2019, 09:51 GMT-4

OK, that doesn't sound too bad then. I'll have a look. Thanks for the tip!

OK, that doesn't sound too bad then. I'll have a look. Thanks for the tip!

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.