How to transform points on faces from unit cells to real cells?

31 views
Skip to first unread message

Lex Lee

unread,
Jun 20, 2020, 8:16:22 PM6/20/20
to deal.II User Group
Hello Deal.II Users,


I want to get the physical (geometry) coordinates for support points on cell faces. Also I know that there are such member functions that can me map points between reference and real cells in this link: https://www.dealii.org/current/doxygen/deal.II/classMapping.html . 

However, via the link mentioned above, I only find a member function called project_real_point_to_unit_point_on_face (real to unit) , no functions like project_unit_point_to_real_point_on_face (unit to real).  

Could someone kindly tell me how I can solve this problem?  


Regards,

Lex

Doug Shi-Dong

unread,
Jun 21, 2020, 8:00:35 PM6/21/20
to deal.II User Group
Hello Lex,

You were close.


The project_real_point_to_unit_point_on_face() is useful is you take a "volume" point within the cell. Since you are mapping from unit to real, you would always know whether your point is on the face or not.

Therefore, transform_unit_to_real_cell() should do the trick. Unless you somehow actually need to project a "volume" point, but projecting within unit cell is easy, which you would then follow with transform_unit_to_real_cell().

Best regards,

Doug

Lex Lee

unread,
Jun 21, 2020, 8:10:30 PM6/21/20
to deal.II User Group
Hello Doug,

Thanks for your kind help.

I am trying to understand your suggestion in the original email.

Are you suggesting me using the member function "transform_unit_to_real_cell()" to get all support points in a unit cell? In the step, sort out the face points I need? Am I correct?


Regards,

Lex

Doug Shi-Dong

unread,
Jun 21, 2020, 10:05:00 PM6/21/20
to deal.II User Group
Hello Lex,

transform_unit_to_real_cell() takes a point as unit cell's point an input and returns the physical point location. Therefore, you can give the unit face support points from the FiniteElement::get_unit_face_support_points() (assuming your FiniteElement has support points). And pass it to transform_unit_to_real_cell().

Doug

Lex Lee

unread,
Jun 22, 2020, 4:53:10 PM6/22/20
to dea...@googlegroups.com
Hello Doug,


Thanks for your help.

However, I need to say, I just had done exactly what you described before I posted this question.

"FiniteElement::get_unit_face_support_points()” returns Points<dim-1>;

“transform_unit_to_real_cell()” requires Point<dim> as input.

The dimensions of points in cells is different from that on faces. That’s one of the reasons why I posted this question.


If I misunderstand you, please kindly let me know.



Regards,
Lex 


-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/uglzE4d4Flo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/fd8f078d-f0d4-4319-8977-a9a8e4672fb5o%40googlegroups.com.

Simon Sticko

unread,
Jun 22, 2020, 5:05:57 PM6/22/20
to deal.II User Group
Hi,

Lex, given your previous question:

https://groups.google.com/forum/#!topic/dealii/xghVE7Km78o

If you are already using an FEFaceValues object with a dummy-quadrature
(created from FiniteElement::get_unit_face_support_points())
then you can use one of the following functions on FEFaceValues to get the location of the support points in real space:

quadrature_point()
get_quadrature_points()

Best,
Simon


On Monday, June 22, 2020 at 10:53:10 PM UTC+2, Lex Lee wrote:
Hello Doug,


Thanks for your help.

However, I need to say, I just had done exactly what you described before I posted this question.

"FiniteElement::get_unit_face_support_points()” returns Points<dim-1>;

“transform_unit_to_real_cell()” requires Point<dim> as input.

The dimensions of points in cells is different from that on faces. That’s one of the reasons why I posted this question.


If I misunderstand you, please kindly let me know.



Regards,
Lex 
To unsubscribe from this group and all its topics, send an email to dea...@googlegroups.com.

Doug Shi-Dong

unread,
Jun 22, 2020, 5:13:25 PM6/22/20
to deal.II User Group
Agreed. Sorry for the confusion. Looked back at my code and it's probably the most straightforward way.

For some other unrelated reason I didn't want to use FEValues and directly deal with the Mapping class.

Doug

Lex Lee

unread,
Jun 22, 2020, 5:16:06 PM6/22/20
to deal.II User Group
Thousands of thanks, Simon, again you helped me a lot. -Lex

Lex Lee

unread,
Jun 22, 2020, 5:17:35 PM6/22/20
to deal.II User Group
Doug, thanks for sharing me your ideas and the discussion. -Lex

Simon Sticko

unread,
Jun 22, 2020, 6:17:02 PM6/22/20
to deal.II User Group
I just want to clarify that Dougs suggestion also works,
if we use the QProjector<dim> class to lift the points
on the face from R^(dim-1) to R^dim before we transform them:

// Create a dummy quadrature from support points on face.
const Quadrature<dim - 1> dummy_face_quadrature(
fe.get_unit_face_support_points());

// Lift support points on face from R^(dim-1) to R^dim
const Quadrature<dim> dummy_quadrature =
QProjector<dim>::project_to_face(dummy_face_quadrature, face_no);

// Now we can use transform_unit_to_real_cell
const Point<dim> real_point = mapping.transform_unit_to_real_cell(
cell, dummy_quadrature.point(quadrature_points_no));

Depending on how your code looks, this might be an easier solution.

Best,
Simon

Doug Shi-Dong

unread,
Jun 22, 2020, 6:21:53 PM6/22/20
to deal.II User Group
Yes I can confirm, I am using QProjector with a dummy face Quadrature right now it works as intended.

Doug
Reply all
Reply to author
Forward
0 new messages