Re: suggestions for DSMC particle storage needed
- From: Thomas Koenig <Thomas.Koenig@xxxxxxxxx>
- Date: Mon, 31 Oct 2005 19:41:46 +0100 (CET)
<phaccount@xxxxxxxxxxxx> wrote:
>I think my question translates into: what is a good memory management
>scheme for Monte-Carlo type simulations where I will have a decent
>turn-over of particles? I am very new to this area, and pointers to
>literature will be appreciated.
Do you know beforehand how many particles there can be at any time?
If so, my advice would be to allocate enough space once, at the start
of the program.
For each particle, keep a logical flag determining wether this
particular particle exists or not.
Something like this:
type particle
real :: x, y, z
integer :: charge
logical :: exists
end type particle
type(particle), allocatable :: p(:)
Alternatively, you could use
real, allocatable :: x(:), y(:), z(:)
integer, allocatable :: charge(:)
logical, allocatable :: exists(:)
This should be fairly straightforward to implement.
.
- References:
- suggestions for DSMC particle storage needed
- From: phaccount
- suggestions for DSMC particle storage needed
- Prev by Date: Re: Source Code for IMSL Routine LLBQF (Linear Least Squares - High Accuracy)
- Next by Date: Source Code for IMSL Routine LLBQF (Linear Least Squares - High Accuracy)
- Previous by thread: Re: suggestions for DSMC particle storage needed
- Next by thread: Source Code for IMSL Routine LLBQF (Linear Least Squares - High Accuracy)
- Index(es):
Relevant Pages
|