Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » alternative to array of linked list
Re: alternative to array of linked list [message #46373 is a reply to message #46371] Mon, 02 May 2016 08:30 Go to previous messageGo to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
mr_ped wrote on Mon, 02 May 2016 02:32

There's probably million possible ways, and to get some near-optimal advice you would have to show here the whole process and details.


Thanks both for reply!

Few more details. The particles are all the same and can be a huge number for example 1000 (and more if one has a super computer!). In principle the particle interacts with all others (particle i exerts a force on j and viceversa). As result of this interactions the particle can freely move around the domain.
However the interaction range of such force is just a fraction of the whole dimension of the simulation domain (you may think a square DxD). To save a lot of computation time then come up the concept of cell. Each has dimension d=D/n, where d a bit gretear than the force range.
In this way you can scan the domain by cell, pick a particle inside it and look for other particles that stay in the same cell and in its neighbour cells (https://en.wikipedia.org/wiki/Cell_lists)
Each cell must have a container of the particle they belong to. During the upgrade process I must pick a particle from one cell (find and delete it) and move in another one (append).

I never used std::set. Perhaps it can be a good alternative to linked list.

Thanks,
Luigi
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MT opens up whole new can of worms :)
Next Topic: Outage...
Goto Forum:
  


Current Time: Fri Apr 26 03:26:18 CEST 2024

Total time taken to generate the page: 0.02693 seconds