puncproject / PUNCpp

Particles-in-UNstructured-Cells, C++ version
https://punc.readthedocs.io
GNU General Public License v3.0
12 stars 6 forks source link

Make generic abstraction for objects #33

Closed sigvaldm closed 6 years ago

sigvaldm commented 6 years ago

This should take into account the possibility for several object methods. There should be abstract base classes Object and Circuit in object.h, and some member variables (potential, current, charge) and methods (update, apply) which are always used in main, regardless of the underlying implementation. Different object implementations then get to inherit these, and have their own .h and .cpp files.

sigvaldm commented 6 years ago

In accordance with issue https://github.com/puncproject/PUNCpp/issues/32 boundaries (mesh.bnd) get standardized indexing, but using those indexes in the ObjectBC, etc. are left for this task. It would be a good idea to make something like relabel_mesh_function() and put in mesh.h for creating a mesh function with 9999 on selected boundaries.

sigvaldm commented 6 years ago

Could also fix multiple objects at the same time

sigvaldm commented 6 years ago

It is possible to do some further clean-up here. Most importantly to avoid down-casting of Object to ObjectBC/ObjectCM. This would allow a generic apply_isources...() to be implemented. This would be preferrable, but the interface is up and running and works smoothly, so I consider this task closed.