Question about space & problem dimensions

28 views
Skip to first unread message

Lukas Korous

unread,
Aug 18, 2015, 5:19:48 AM8/18/15
to deal.II User Group
Hello,

I was trying to solve problems where dim != spacedim with deal.ii and found several places in the library where I would expect spacedim and found dim instead, or found just instantiations where dim == spacedim. I would like to ask for some explanation, because I am apparently missing something.

I created a commit (on a bit old version, but it should illustrate what I mean):

- here are places where I would expect spacedim and found dim:
https://github.com/l-korous/dealii/commit/8c4fe2d47b1531b06aac22302a94551ee25db5fc#diff-1eb8ed17b743fddb50cd968dfa880a08L244

- here is a line where I would not expect that dim == spacedim is expected:
https://github.com/l-korous/dealii/commit/8c4fe2d47b1531b06aac22302a94551ee25db5fc#diff-23d9c525aded83a6d9517219b98cd46cL400

- here are some instantiations where dim == spacedim was 'hard-coded':
https://github.com/l-korous/dealii/commit/8c4fe2d47b1531b06aac22302a94551ee25db5fc#diff-6f0cbef69fc3b25c4a3ddbc3be2508dfR17

I am sure that I am missing something here, so thank you in advance for explanation.

Regards,
Lukas

Wolfgang Bangerth

unread,
Aug 18, 2015, 6:11:25 AM8/18/15
to dea...@googlegroups.com, Guido Kanschat (Google Drive)

Lukas,
All of these are in the MeshWorker part of the library for which I think only
Guido can give definite answers. My suspicion is that these parts were written
before we had the ability to solve problems with dim != spacedim and were
never converted.

The patches that convert things like
Triangulation<dim> -> Triangulation<dim,spacedim>
DoFHandler<dim> -> DoFHandler<dim,spacedim>
are obviously correct and if you'd like to propose an incremental pull request
that already gets this part out of the way, I would be happy to approve this.

I *suspect* that most of the other changes are correct as well, but let Guido
confirm.

Best
Wolfgang


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

Lukas Korous

unread,
Aug 18, 2015, 7:59:37 AM8/18/15
to dea...@googlegroups.com, Guido Kanschat (Google Drive)
OK, thanks for the explanation. There is some more work needed for support of completely general dim, spacedim, e.g. because of what is described in this commit:

https://github.com/l-korous/dealii/commit/f4aaea8f6380d8c1d02838bf3078a53b75e19fb7

Lukáš Korous



--
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/rQaidH4e928/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wolfgang Bangerth

unread,
Aug 18, 2015, 8:04:21 AM8/18/15
to dea...@googlegroups.com, Guido Kanschat (Google Drive)
On 08/18/2015 06:59 AM, Lukas Korous wrote:
> OK, thanks for the explanation. There is some more work needed for support of
> completely general dim, spacedim, e.g. because of what is described in this
> commit:
>
> https://github.com/l-korous/dealii/commit/f4aaea8f6380d8c1d02838bf3078a53b75e19fb7

But this change also makes sense. 'dim' always has to be <= 'spacedim'.

Best
W.

Lukas Korous

unread,
Aug 18, 2015, 11:26:08 AM8/18/15
to deal.II User Group, dr.guido...@gmail.com
Hi Wolfgang, I am missing something then. I thought that 'dim' is (e.g. in the case of DoFHandler) the number of equations. Then

'dim' always has to be <= 'spacedim' would not be true for any larger system (e.g. Euler equations).

Regards,
Lukas

Wolfgang Bangerth

unread,
Aug 18, 2015, 11:32:50 AM8/18/15
to dea...@googlegroups.com, dr.guido...@gmail.com
On 08/18/2015 10:26 AM, Lukas Korous wrote:
> Hi Wolfgang, I am missing something then. I thought that 'dim' is (e.g. in the
> case of DoFHandler) the number of equations. Then

No, dim is the dimensionality of the cells. For quadrilaterals, dim=2. For
hexahedra, dim=3. spacedim is the dimension of the space in which they live.
So, for example, if you have dim=2, spacedim=3, then you have a mesh that
meshes a surface.

Clearly you can't have a mesh of quadrilaterals that live in 1d, though.

(Or are you referring to something specific to MeshWorker that I don't
understand?)

Lukas Korous

unread,
Aug 18, 2015, 5:59:50 PM8/18/15
to dea...@googlegroups.com, Guido Kanschat
Sure - you are right, I was thinking about something else.

OK - I will try to create a pull request from some of the relevant changes.

Lukáš Korous


                                www: http://www.math.tamu.edu/~bangerth/

Reply all
Reply to author
Forward
0 new messages