faces barycenter

10 views
Skip to first unread message

Alberto Salvadori

unread,
Dec 20, 2020, 4:58:44 AM12/20/20
to deal.II User Group
Dear community

I observed that this instruction:

Point<dim> centroid = cell->face(face_number)->barycenter() ;

provides always centroid = {0,0,0}, whereas the following

Point<dim> centroid = cell->face(face_number)->center() ;

returns the correct amount.

Am I misunderstanding something or may it be a bug?

Thanks,

Alberto

Wolfgang Bangerth

unread,
Dec 20, 2020, 10:11:50 PM12/20/20
to dea...@googlegroups.com
On 12/20/20 2:58 AM, Alberto Salvadori wrote:
>
> Point<dim> centroid = cell->face(face_number)->barycenter() ;
>
> provides always centroid = {0,0,0}, whereas the following
>
> Point<dim> centroid = cell->face(face_number)->center() ;
>
> returns the correct amount.
>
> Am I misunderstanding something or may it be a bug?

I suspect that you forgot to try running your code in debug mode :-) In debug
mode, I'm pretty sure you would run into this assertion:

template <int structdim, int dim, int spacedim>
Point<spacedim>
barycenter(const TriaAccessor<structdim, dim, spacedim> &)
{
// this function catches all the cases not
// explicitly handled above
Assert(false, ExcNotImplemented());
return Point<spacedim>();
}

In other words, the function is simply not implemented -- though I suspect
that it would not be very difficult to do so.

Best
W.


--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Alberto Salvadori

unread,
Dec 21, 2020, 2:50:04 AM12/21/20
to dea...@googlegroups.com
You are right, of course, Wolfgang.
I should offer to contribute in the development of this method. I will.
Thank you
Alberto

Alberto Salvadori
 Dipartimento di Ingegneria Meccanica e Industriale (DIMI)
 Universita` di Brescia, via Branze 43, 25123 Brescia
 Italy
 tel 030 3715426

e-mail:
 alberto....@unibs.it
web-page:
 http://m4lab.unibs.it/faculty.html



--
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 the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/c6c8111e-a53a-da7a-4b5e-40b870546283%40colostate.edu.


Informativa sulla Privacy: http://www.unibs.it/node/8155
Reply all
Reply to author
Forward
0 new messages