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.

Scaling arrays

Please login with a confirmed email address before reporting spam

Hi
For my model I have to produce an array of equidistant features, where each element is scaled (say linearly) with its position. I do not see such an option, except of manually doing it (but I might have hundreds of features).
Any idea on how to manage that?

Thanks

7 Replies Last Post 26.04.2017, 11:53 GMT-4
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 11.01.2017, 08:38 GMT-5
Hello Yuri,
You could achieve such a geometry either with MATLAB (assuming you have LiveLink for MATLAB) or with a method in an application (assuming you use COMSOL on a Windows computer so you have the Application Builder).
Best regards,
Jeff
Hello Yuri, You could achieve such a geometry either with MATLAB (assuming you have LiveLink for MATLAB) or with a method in an application (assuming you use COMSOL on a Windows computer so you have the Application Builder). Best regards, Jeff

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 11.01.2017, 10:00 GMT-5
Jeff, thanks, Can I, once built it in app builder bring it back to COMSOL
Jeff, thanks, Can I, once built it in app builder bring it back to COMSOL

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 11.01.2017, 10:48 GMT-5
Yes, an app can be used to create an "incomplete" mph file, e.g. one that contains just a geometry. You can then open that mph file in the GUI and continue from there.
Jeff
Yes, an app can be used to create an "incomplete" mph file, e.g. one that contains just a geometry. You can then open that mph file in the GUI and continue from there. Jeff

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 11.01.2017, 15:55 GMT-5
The topic of generating a geometry with the Application Builder seems to pop up more and more often in the Discussion Forum, so I am attaching a simple example.
The app consists essentially in just one method. That method is triggered by one button. The method is written to create 7 equally spaced blocks of increasing sizes.
There is a Save menu that lets you save the mph file under a new name.
You can then open that mph file in a fresh GUI and add physics, mesh, etc. Alternatively, you can use "Insert Sequence" in an existing model file to import the 7 blocks. See PS below.

Using this approach, you can quickly generate geometries that would be tedious to put together in the GUI. You can also use this approach to generate randomized geometries - something that cannot be done in the GUI.

I hope this helps.
Best,
Jeff

PS: Yet another alternative is to, in the app, export the geometry as a .mphbin file instead of saving it in a .mph file. You then Import the .mphbin file into a new mph file. This has the benefit of not populating your new mph file's Geometry branch with lots of nodes you don't need.
The topic of generating a geometry with the Application Builder seems to pop up more and more often in the Discussion Forum, so I am attaching a simple example. The app consists essentially in just one method. That method is triggered by one button. The method is written to create 7 equally spaced blocks of increasing sizes. There is a Save menu that lets you save the mph file under a new name. You can then open that mph file in a fresh GUI and add physics, mesh, etc. Alternatively, you can use "Insert Sequence" in an existing model file to import the 7 blocks. See PS below. Using this approach, you can quickly generate geometries that would be tedious to put together in the GUI. You can also use this approach to generate randomized geometries - something that cannot be done in the GUI. I hope this helps. Best, Jeff PS: Yet another alternative is to, in the app, export the geometry as a .mphbin file instead of saving it in a .mph file. You then Import the .mphbin file into a new mph file. This has the benefit of not populating your new mph file's Geometry branch with lots of nodes you don't need.


Please login with a confirmed email address before reporting spam

Posted: 8 years ago 31.03.2017, 10:02 GMT-4
Hi Jeff,
But if we have never used JAVA scripts before? How could we use the application builder as mentioned ?
Thanks
Hi Jeff, But if we have never used JAVA scripts before? How could we use the application builder as mentioned ? Thanks

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 31.03.2017, 11:03 GMT-4
I'll speak from personal experience: I learned a bit of Java way back in grad school and had forgotten most of it by the time COMSOL came up with apps. What I've found is that the Application Builder includes several tools that make it easier to develop methods if you do not have prior experience with Java (or limited experience like myself): "Record code", "Language Elements", "Model Expressions", as well as code completion and a built-in debugger.

There have been a few webinars that discuss some of these capabilities. You can find archived webinars on the App Builder here:
www.comsol.com/events/webinars/archive?eventtype%5B%5D=event_webinar&startTime=8&endTime=20&eventtopic%5B%5D=application-builder&view=cards&events_sort=date

Best,
Jeff
I'll speak from personal experience: I learned a bit of Java way back in grad school and had forgotten most of it by the time COMSOL came up with apps. What I've found is that the Application Builder includes several tools that make it easier to develop methods if you do not have prior experience with Java (or limited experience like myself): "Record code", "Language Elements", "Model Expressions", as well as code completion and a built-in debugger. There have been a few webinars that discuss some of these capabilities. You can find archived webinars on the App Builder here: https://www.comsol.com/events/webinars/archive?eventtype%5B%5D=event_webinar&startTime=8&endTime=20&eventtopic%5B%5D=application-builder&view=cards&events_sort=date Best, Jeff

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 26.04.2017, 11:53 GMT-4
Okay thank you ! I hope that i could understand it because i need it to build my geometry !
Kind regards Jeff
Okay thank you ! I hope that i could understand it because i need it to build my geometry ! Kind regards Jeff

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.