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.

confuse in functions 'mphmeshstats' and 'mpheval'

Please login with a confirmed email address before reporting spam

Dear all,

I was thinking about using COMSOL for mesh generation and results validation for which I used functions in 'COMSOL with MATLAB'. They are 'mphmeshstats' and 'mpheval', to be more specific. I have ran into some difficulties and here are my questions.

Qestion 1:
in my first model, I simulated a piezoelectric bimorph which is fixed on one end and subjected to a harmonic force on the other. The working variables are mechanical displacements and electric potentials. I used:
' [mshInfo,mshData] = mphmeshstats(model, 'mesh1'); '
to extract mesh infomations, and
' data = mpheval(model, {'u', 'v', 'w', 'V'}); '
to extract simulating results.
As a results, 'mshData.vertex' and 'data.p' both give the coordinates of all nodes in the mesh. However, they are not identical: cordinates of the same point may be placed in different columns in these two matrices. So my first question is:
is there any indices that indicates what the positions of the columnes of 'data.p' are in 'mshData.vertex' or the other way round? This is important to me because I want to perform a comparaison of my results and those of Comsol at each point.

Question 2:
It is the same device, but this time an air box is added surrounding the bimorph. The working variables are still mechanical displacements and electric potentials except that the mechanical displacements are calculated only on the bimorphe but not in the air box. Say we have Nt nodes in the whole mesh among which Na nodes are in the air box (not including the surface of the bimorph) and Nb nodes in the bimorph. Then we should have:
Nt = Na + Nb, and
the number of electric potential dofs are Nt; that of the mechanical displacements are 3*Nb (in a 3D model, we have u, v, w for mechanical displacements).
However, when I run:
data = mpheval(model, {'u', 'v', 'w', 'V'});
The number of results for both u, v, w and V are greater than Nt while it is not equal to the number of elements (namely, results are not evaluated on Gauss points). How is that possible? My second question is:
If I want to get the Na values of the electric potential dofs and Nb values of the mechanical displacements dofs (u, or v, or w), how should I do?

I would be very grateful if anyone could provide answers to these.

Best regards,

Amine


1 Reply Last Post 29.09.2015, 07:18 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 29.09.2015, 07:18 GMT-4
I tried to change the 'Pattern' option in the mpheval function to both 'lagrange' and 'gauss', but do not solve my problem. Anyone could help, please?
I tried to change the 'Pattern' option in the mpheval function to both 'lagrange' and 'gauss', but do not solve my problem. Anyone could help, please?

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.