Scaling arrays

Thread index  |  Previous thread  |  Next thread  |  Start a new discussion

RSS FeedRSS feed   |   Email notificationsTurn on email notifications   |   4 Replies   Last post: January 11, 2017 8:55pm UTC
Yuri Paskover

Yuri Paskover

January 11, 2017 1:08pm UTC

Scaling arrays

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

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Jeff Hiller

Jeff Hiller
COMSOL Employee
USA
Moderator

January 11, 2017 1:38pm UTC in response to Yuri Paskover

Re: Scaling arrays

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

Reply  |  Reply with Quote  |  Report Abuse

Yuri Paskover

Yuri Paskover

January 11, 2017 3:00pm UTC in response to Jeff Hiller

Re: Scaling arrays

Jeff, thanks, Can I, once built it in app builder bring it back to COMSOL

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Jeff Hiller

Jeff Hiller
COMSOL Employee
USA
Moderator

January 11, 2017 3:48pm UTC in response to Yuri Paskover

Re: Scaling arrays

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

Reply  |  Reply with Quote  |  Report Abuse

Jeff Hiller

Jeff Hiller
COMSOL Employee
USA
Moderator

January 11, 2017 8:55pm UTC in response to Jeff Hiller

Re: Scaling arrays

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, save the geometry as a .mphbin file instead of 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.

Reply  |  Reply with Quote  |  Report Abuse


Rules and guidelines