Skip to content

Refactor older classes/methods #35

@Waqar-ukaea

Description

@Waqar-ukaea

A lot of AEGIS suffers from being written as I was still learning C++. As such a lot of the older classes/methods aren't written in the best way. It's been on my to-do list for a while but refactoring some of these to make use of more modern C++ techniques and just better general code quality practices would go a long way in making AEGIS more maintainable and easier to implement new features etc. A lot of the classes are more so acting as singletons which isn't ideal.

A roughly ordered list of priorities which I will update when I have more ideas.

  • Refactor the EquilData class to handle equilibrium data and reading in an eqdsk. This class probably could see use in other applications if they ever need to read an eqdsk and define an axisymmetric equilibrium. If I ever want to extend it to be able to handle equilibrium data in formats other than an eqdsk it makes sense to refactor this and move to a more loosely coupled set of classes.
  • Restructure the ParticleSimulation class. This class is a bit of a mess and acting as a glorified global namespace because I didn't want to pass around individual variables. So a big restructure is required. It should be split up into smaller classes to make handling changes more manageable.
    • Add a Geometry class to specifically handle any geometry operations? A separate class to handle setting up the geometry and any other further geometry operations may be helpful.
    • Abstract task farm based parallelism out to a separate class or set of functions - Currently the functions that do this sit within ParticleSimulation when they really don't need to. These functions ultimately just serve as a mechanism to distribute an array of work across MPI ranks. And repopulate an array of values on the root rank. It could be more generalized to support other parallel "reduction-like" operations.
    • Move more of the logic here into main(). This class does a lot of initialising of things and preparation. A clearer code flow would involve more separate classes interacting together in main().
  • Reduce the ParticleBase class to it's necessities. Right now there is a lot of redundancy in this class where I was trying to make it do much. I should have a think about how the data and methods here can be reduced to the minimum required.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions