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.

How are the data points chose in a Line Plot?

Please login with a confirmed email address before reporting spam

Hello!

Checking the reference for the Line Markes in a Line Plot, I found that the setting "In data points" under Coloring and Style -> Line Markers would give me the values at the mesh nodes. However, in the Line Plot I find many more data points than I would anticipate.

How are the data points generated in a Line Plot?

Best regards, Yao



4 Replies Last Post 2020年5月5日 GMT-4 02:16

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2020年4月30日 GMT-4 12:12

Hi Yao,

I believe the reason you are seeing more data points than mesh nodes is because you have set a "Refinement" in the Quality tab; the default is set to normal. I think the refinement evaluates more points between mesh nodes. You can set this to No Refinement and should get the right amount of data points.

Let me know if this works,

Alex

Hi Yao, I believe the reason you are seeing more data points than mesh nodes is because you have set a "Refinement" in the Quality tab; the default is set to normal. I think the refinement evaluates more points between mesh nodes. You can set this to No Refinement and should get the right amount of data points. Let me know if this works, Alex

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2020年5月1日 GMT-4 08:07

Hi Yao,

In principle, Alexandre is right.

There is however one subtle detail that maybe should be mentioned: With No Refinement, only the corner nodes of the elements are used. This matches the mesh nodes only if the discretization is linear.

If you want to use values also at the midside nodes when quadratic shape functions are used, you need to set refinement to Custom, and the corresponding value to 2.

-------------------
Henrik Sönnerlind
COMSOL
Hi Yao, In principle, Alexandre is right. There is however one subtle detail that maybe should be mentioned: With *No Refinement*, only the corner nodes of the elements are used. This matches the mesh nodes only if the discretization is linear. If you want to use values also at the midside nodes when quadratic shape functions are used, you need to set refinement to *Custom*, and the corresponding value to 2.

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2020年5月4日 GMT-4 13:07
Updated: 5 years ago 2020年5月4日 GMT-4 13:25

Hi Yao,

I believe the reason you are seeing more data points than mesh nodes is because you have set a "Refinement" in the Quality tab; the default is set to normal. I think the refinement evaluates more points between mesh nodes. You can set this to No Refinement and should get the right amount of data points.

Let me know if this works,

Alex

Thanks Alex! That was the right setting.

Hi Yao,

In principle, Alexandre is right.

There is however one subtle detail that maybe should be mentioned: With No Refinement, only the corner nodes of the elements are used. This matches the mesh nodes only if the discretization is linear.

If you want to use values also at the midside nodes when quadratic shape functions are used, you need to set refinement to Custom, and the corresponding value to 2.

Thank you for your answer, Henrik!

Are the data points always chosen to be the corner nodes?

For instance if with your example of quadratic elements and Resolution: Custom with Element refinement = 2, would the data point inbetween reflect the middle node of the element? Or would the position be an interpolation based on the chosen refinment, with the value being an evalution of the field at that point?

Edit: I looked into the reference and it says that the predefined values would do a refinement based on 'heuristics' and a custom value makes the refinment by subdividing the edges. So I think that the positions are kind of an interpolation and the data is then evaluated? Is this the right thinking?

Cheers, Yao

>Hi Yao, > >I believe the reason you are seeing more data points than mesh nodes is because you have set a "Refinement" in the Quality tab; the default is set to normal. I think the refinement evaluates more points between mesh nodes. You can set this to No Refinement and should get the right amount of data points. > >Let me know if this works, > >Alex Thanks Alex! That was the right setting. >Hi Yao, > >In principle, Alexandre is right. > >There is however one subtle detail that maybe should be mentioned: With *No Refinement*, only the corner nodes of the elements are used. This matches the mesh nodes only if the discretization is linear. > >If you want to use values also at the midside nodes when quadratic shape functions are used, you need to set refinement to *Custom*, and the corresponding value to 2. Thank you for your answer, Henrik! Are the data points always chosen to be the corner nodes? For instance if with your example of quadratic elements and **Resolution: Custom** with **Element refinement = 2**, would the data point inbetween reflect the middle node of the element? Or would the position be an interpolation based on the chosen refinment, with the value being an evalution of the field at that point? Edit: I looked into the reference and it says that the predefined values would do a refinement based on 'heuristics' and a custom value makes the refinment by subdividing the edges. So I think that the positions are kind of an interpolation and the data is then evaluated? Is this the right thinking? Cheers, Yao

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 2020年5月5日 GMT-4 02:16

Hi Yao,

The value is taken at interpolated points, yes. But in my example, that would coincide with the midside node. As long as Element Refinement matches the shape function order, you will get values at the nodes (except possibly for some round-off errors), since they are placed on the line using the same type of interpolation.

Note also that that 'nodal values' is a meaningful statement only when you evaluate the DOF itself, but not when evaluating other expressions like gradients and fluxes.

-------------------
Henrik Sönnerlind
COMSOL
Hi Yao, The value is taken at interpolated points, yes. But in my example, that would coincide with the midside node. As long as **Element Refinement** matches the shape function order, you will get values at the nodes (except possibly for some round-off errors), since they are placed on the line using the same type of interpolation. Note also that that 'nodal values' is a meaningful statement only when you evaluate the DOF itself, but not when evaluating other expressions like gradients and fluxes.

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.