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.

Output of getVertexElements()

Please login with a confirmed email address before reporting spam

Hi Everyone,

I am trying to extract results at the gauss points of tri elements. The problem is: I am having trouble assigning each gauss point to its corresponding element. A snapshot from my code in Matlab is as follows:

%% To extract results at integration gaussian points %%%%%%%%% model.result.numerical.create('sed_gp','Eval'); model.result.numerical('sed_gp').set('pattern','gauss'); model.result.numerical('sed_gp').set('gporder','1'); model.result.numerical('sed_gp').set('expr','solid.Ws'); model.result.numerical('sed_gp').getVertexElements();

I understand that by using getVertexElements(), I should get mesh elements' indices for each point. However, the output of this function has indices far greater than the number of elements, so I am not sure how to interpret them.

The other long solution I am currently using is by extracting the coordinates of each element's nodes, and using inpolygon function in Matlab to try to place each gaussian points inside its corresponding element. I have to use a for loop for this function, so it would be intensive with fine meshes.

Any help is greatly appreciated. Kindly let me know if you need any more information.

Thanks, Mohamed Abdelhamid


0 Replies Last Post 09.10.2018, 12:12 GMT-4
COMSOL Moderator

Hello Mohamed Abdelhamid

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.