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.

Method to export deformed configuration based on parameter value (rather than solution number)

Please login with a confirmed email address before reporting spam

Hi All,

I have a need to automate the generation and export of deformed configurations.

I have created the following method:

model.result().dataset("dset1").createDeformedConfig("deform1", "mesh2");
model.component("comp1").geom("deform1").feature("frommesh1").set("solnum", 26);
model.component("comp1").geom("deform1").feature("frommesh1").importData();
model.component("comp1").geom("deform1").run();
model.component("comp1").geom("deform1").export("C:\\Local Work\\Boot 25.mphbin");

In my solution, the parameter increments between 0 and 1 in increments of 0.01. If all solutions converge without issue, then this corresponds to a "solnum" of between 1 and 101. In the example above, this exports the deformed geometry at solution 26 which, because no convergence issues arose, also corresponds to a parameter value of 0.25.

However, it might be that in the event of a failed convergence, the solver tries an intermediate value for the incrementing parameter, in which case the "solnum" call will not necessarily correspond with the expected parameter value.

I would like to have a line of code similar to that above, which calls a deformed configuration based on parameter value rather than solution number, to make the method more robust.

The "withsol" approach does not seem to work on a geometry object, however.

Any thoughts as to how I could update my method code to achieve my end goal?

Thanks in advance,

Mark


0 Replies Last Post 3 ott 2022, 10:42 GMT-4
COMSOL Moderator

Hello Mark Harradine

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.

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.