Particle Class Implementation

31 views
Skip to first unread message

Victoria W.

unread,
Jun 9, 2020, 11:14:45 AM6/9/20
to deal.II User Group
Hello, 

I'm a new deal.ii and C++ user, so this question might be a bit basic, but I was wondering how my implementation of the built-in deal.ii particle class should look.  Ultimately I'm looking to track a particle in laminar flow.  So far I've tried creating a simple particle at the origin after generating my geometry with the GridGenerator class.  Calling the particle class in my code looks like this: 

Particles::Particle<dim, dim>::Particle() 

as per the documentation on dealii.org.  However I get the error message: error: dependent-name ‘dealii::Particles::Particle<dim, dim>::Particle’ is parsed as a non-type, but instantiation yields a type.  How should I be implementing this class to construct a particle, what type declaration should new particles be declared as, and are there other documentation or resources I should be looking at?  

Thanks

Jean-Paul Pelteret

unread,
Jun 9, 2020, 4:06:15 PM6/9/20
to dea...@googlegroups.com
Dear Victoria,

You’re on the right track, but it looks like you got the syntax a bit wrong. To create a particle you need to write something like

Particles::Particle<dim> particle;

You’ll note that the specific constructor that is called is inferred from the arguments given to the instance of the class that’s being created (in this case, no arguments —> default constructor).

There is a new tutorial, namely step-70, that uses particles. I don’t know whether or not it’s pitched at the right level for you to get to grips with some of the fundamentals (at first glance, it seems to involve a number of more advanced techniques). If it’s not quite tractable for you, then you could also take a look at some of the particle tests in the test suite, such as this one, that might provide snippets of information that you need as you build up your understanding of this particular feature of the library.

I hope that helps you a bit.
Best,
Jean-Paul

--
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/43d0b22c-d736-464d-9d83-da4d819eca90o%40googlegroups.com.

Bruno Blais

unread,
Jun 9, 2020, 11:05:50 PM6/9/20
to deal.II User Group
Dear Victoria,

In additional to what Jean-Paul suggested, you can look at the preliminary version of step-68 which does exactly what you would like to achieve with particles.
The code is available on the following pull request. Rene and I have put some work into it and it works quite well in its current state:

Best
Bruno
To unsubscribe from this group and stop receiving emails from it, send an email to dea...@googlegroups.com.

Victoria W.

unread,
Jun 10, 2020, 9:41:00 AM6/10/20
to deal.II User Group
Dear Bruno and Jean-Paul, 

The new syntax worked great, and thank you for the extra resources Bruno.  

Best, Victoria 

Wolfgang Bangerth

unread,
Jun 10, 2020, 6:48:46 PM6/10/20
to dea...@googlegroups.com
On 6/9/20 9:05 PM, Bruno Blais wrote:
>
> In additional to what Jean-Paul suggested, you can look at the preliminary
> version of step-68 which does exactly what you would like to achieve with
> particles.
> The code is available on the following pull request. Rene and I have put some
> work into it and it works quite well in its current state:
> https://github.com/dealii/dealii/pull/10308
> <https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdealii%2Fdealii%2Fpull%2F10308&data=02%7C01%7CWolfgang.Bangerth%40colostate.edu%7Ccdf3c3dffb0c40530d6808d80ceb3094%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C0%7C637273551562853584&sdata=Uyq0AcKtNcjWdg2t7%2FBFz3S%2Fw9fiy%2FrNQc8fIhE8hNo%3D&reserved=0>

And finally, there is a third tutorial program currently in the making:
https://github.com/dealii/dealii/pull/10301
It is the most basic of them and primarily explains how to create particles
and move them along.

Best
W.


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

Reply all
Reply to author
Forward
0 new messages