09.09.15 Parameters and particles - daplff/hiWi_cont GitHub Wiki

TODO-list

  • finish parametering (kinda done already)...
  • and lead it into I/O of data. General. Kinda like starting with a clean slate and then putting stuff in the simulation and then running it without their bloody files.
  • ..by implementing addParticle and possibly addBottomParticle and addOpenBoundaryParticle or addVirtualParticle (closed boundary)

useful info

  • there are few places in the code where it would be natural to change the number of particles. For example:
  1. where the code does this originally, i.e., at recount [in step_leap_frog], which compacts the particle arrays by overwriting the "unflagged" particles, reducing the total number of particles to the number of flagged particles
  2. another place where the code does this originally, i.e. at refine, which splits particles, adding the extra parts at the end of the arrays

Since the code does its splitting of the domain into cells etc. after recount, and thereafter updates some values that weren't copied, conclusion is that that's the most independent point in the loop to do this.

:arrow_right_hook: Have split step_leap_frog.f file (step function) into two in the helper module, called directly from C.

Adding a particle

  • first tried adding particle into the arrays and set the arrays back
  • didn't work, might be because the set of variables extracted/reinserted wasn't complete enough
  • could try increasing the set to see this
  • second try: fortran function
  • straight off copy from recount, basically, with some flavours from function for adding open boundary condition particles into the domain when they're too far in
  • [found a big in recount, it didn't copy the value for the particle areas [ar(:)], even though that is used in following steps. Now it does, at least in my code]
  • takes a limited set of parameters from C code and computes the rest from this (i.e. particle mass from area and density, wave speed from depth and gravity etc.). Some information lost: acceleration [now assumes particle was nonaccelerating last 0.5 timesteps] and maybe some fine information hidden in labyrinths of badly documented fortran code.

So...

  • all parts are there, except for addBottomParticle(...) and addOpenBCParticle(...)
  • some parts need to be included smoothly in the class interface:
  • addParticle(...)
  • some parameter specifying [getters/setters for Parameter class?]
  • ...
  • Then a user guide needs be done.

other nice things that could be added...

  • multiple ways of specifying things
  • utility functions, i.e. add particles that fill an area, remove particles in an area... massive amounts of stuff
  • optimizing the solver code [for example, checking redundant calls, calculations... specify bottom as [piece-wise] analytical expression [=>splines] ]
  • actual documentation and cleanup of code