Skip to content

C++ Class Diagrams#147

Merged
DiegoDeGusem merged 19 commits into
devfrom
diagram
Jun 5, 2026
Merged

C++ Class Diagrams#147
DiegoDeGusem merged 19 commits into
devfrom
diagram

Conversation

@DiegoDeGusem
Copy link
Copy Markdown
Contributor

@DiegoDeGusem DiegoDeGusem commented Apr 24, 2026

This PR would automatically generate class diagrams each time the website gets build and they will be added to the website. There are a total of 6 diagrams to avoid a cluttered image.

Class Diagrams

Parameters
image
Magnetics
image
Strayfield
image
Time Integration
image
Domain
image
Utilities
image

@DiegoDeGusem DiegoDeGusem self-assigned this Apr 24, 2026
@DiegoDeGusem DiegoDeGusem added the documentation Improvements or additions to documentation label Apr 24, 2026
Comment thread docs/conf.py Outdated
Comment thread docs/conf.py
@DiegoDeGusem DiegoDeGusem marked this pull request as draft April 28, 2026 09:24
@DiegoDeGusem DiegoDeGusem marked this pull request as ready for review April 28, 2026 10:07
Comment thread environment.yml Outdated
Comment thread docs/conf.py Outdated
@DiegoDeGusem DiegoDeGusem requested a review from ilateur April 29, 2026 12:27
@ilateur ilateur added this to the v1.2.1 milestone Apr 29, 2026
Copy link
Copy Markdown
Collaborator

@ilateur ilateur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was unable to generate these images myself (on monster5). I tried installing clang-uml via conda but I got errors with make html (I did not try to solve them). I am not allowed to install clang-uml via the package manager there, but Lars tried and failed that install.

It would be best if everything was included inside the environment.yml as a self-contained package that works for everybody, but somehow that did not work on Windows?

The actual diagrams look nice, although I wasn't able to judge them on the website. Sadly I don't think we should merge this if only 1 person is able to successfully run it.

Comment thread docs/diagrams/plantuml.jar Outdated
Comment thread .gitignore
Comment thread README.md
```

The documentation can then be found at `docs/_build/html/index.html`.
The documentation can then be found at `docs/_build/html/index.html`. However, to generate the class diagrams you should be on a Linux device and first install [clang-uml](https://github.com/bkryza/clang-uml/tree/master) otherwise they will not be generated.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not Windows?

@DiegoDeGusem
Copy link
Copy Markdown
Contributor Author

I will move this back to draft and see if I can fix the issues.

@DiegoDeGusem DiegoDeGusem marked this pull request as draft May 7, 2026 11:34
@ilateur
Copy link
Copy Markdown
Collaborator

ilateur commented May 8, 2026

It was successfully built on monster5!

Though, I must admit it's hard to keep an overview when all boxes are that large. Either you see the connections, but can't read anything, or you zoom in to read, but can only look at a single class.

@DiegoDeGusem
Copy link
Copy Markdown
Contributor Author

Class Diagrams second try

Unfortunately the Conda package clang-uml only works on Linux when you install it via Conda, so I removed it from the environment. You are still able to generate the website without the package, but then you get non-fatal errors, because the diagrams won't be generated. I also added a warning when you generate the documentation that should guide users to the installation of clang-uml if they want to (we need it when we want to regenerate the website when pushing to dev).

I was able to generate the diagrams (and the rest of the documentation) on my Linux device and monster5 using both the Conda method and the Ubuntu method. I don't know if it now works on Windows if you install it via the clang-uml installation guide (I think it should work 🤞) @JonathanMaes could you check this?

I have also changed the layout of the diagrams a little bit to be more like the previous .drawio diagram. I removed the constructor and deconstructor and I also changed the layout from left to right to from top to bottom, which feels cleaner.

Quantities
image
Magnetics
image
Strayfields
image
Time Integration
image
Domain
image
Utilities
image

@DiegoDeGusem DiegoDeGusem marked this pull request as ready for review June 2, 2026 13:54
@JonathanMaes
Copy link
Copy Markdown
Contributor

It still gives the non-fatal error ERROR: Failed to load compilation database from .\build due to: Could not auto-detect compilation database from directory ".\build", which I think means that MSVC does not generate compile_commands.json. But CUDA requires MSVC, so I don't think it is worth the hassle (i.e., installing another compiler) to fix this.

Installing the environment.yml and building mumaxplus don't give any errors, so I think it is fine as it is now. The documentation can be built on Linux anyway. And if nobody in the team would have access to a Linux machine (extraordinarily unlikely) we now know that GitHub actions can successfully build the Python wheels so if needed it should also be able to generate the documentation with the diagrams.

Copy link
Copy Markdown
Collaborator

@ilateur ilateur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The one thing left to do is a bit of manual reordering of the layout, as requested by @lamoreel.

@DiegoDeGusem DiegoDeGusem requested a review from ilateur June 5, 2026 09:27
@DiegoDeGusem DiegoDeGusem merged commit 5d593d6 into dev Jun 5, 2026
@ilateur ilateur deleted the diagram branch June 5, 2026 09:55
@ilateur ilateur mentioned this pull request Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants