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.
Evaluating Volume in Livelink
Posted Dec 13, 2023, 9:56 a.m. EST LiveLink for MATLAB, Geometry, Mesh Version 6.0 2 Replies
Please login with a confirmed email address before reporting spam
The below post is related to an archived discussion
I came with the same question about evaluating the volume of my geometry in Livelink,
One can evaluate the volume right after running the model (not before) using
model.result.numerical.create('meas1', 'MeasureVolume'); model.result.numerical('meas1').selection.all; %or other selection depending on your problem model.result.numerical('meas1').setResult; current_volume = model.result.numerical("meas1").getReal
Otherwise, if one wants to evaluate to evaluate the volume before running the model, consider for instance that you want to create a geometry with a desired volume within a loop (see for instance https://www.comsol.com/blogs/how-to-create-a-randomized-geometry-using-model-methods/), the previous method is not practical. I have done this via the mesh node.
current_volume = mphmeshstats(model,'mesh1').volume
If one have several meshes then, one has to sum up them all.
Is there other solution, perhaps at the geometry node?