Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge changes made from paper into main. #49

Merged
merged 42 commits into from
Aug 29, 2023
Merged

Merge changes made from paper into main. #49

merged 42 commits into from
Aug 29, 2023

Conversation

sammorrell
Copy link
Member

No description provided.

This is the initial commit that adds the ability to add multiple light sources to the MCRT simulation. This is a little rough, so some refinements needed.
Added support for multiple light sources.
I have rewritten non-isotropic emitters, and changed how they work. They now emit as a single source, with direction information. By default, they are placed at the origin and can be translated and rotated by a 3D transform, as geometry is. This allows us to orient light sources however we wish in the future.
My previous implemetation for multiple light sources was flawed, in that the accumulation of outputs was incorrectly implemented. I have now corrected this.

I have additionally added the option to save the outputs from each individual light source, for either analysis or post-processing. This is off by default.
This includes the photon collector attribute iteself, all of the Save implementation code for the attribute, and all of the linker implementation to make it work in the MCRT binary.

Optimisations required, as saving is slow, and there is also likely a sizable overhead for appending to the photon vector.
This is so that we don’t have to copy any memory and the save is sped up.
As the save is a comparatively long running operation, I have added a progress bar to the output. This can be removed in the future if required.
Added a basic test case for the photon collector. Also corrected a bug where the nphoton property was not implemented (changed to a call).
TravisCI is having issues building with the new branch. As GitHub Actions is now so good, I am removing TravisCI testing from the project for now.
As I mainly using feature branches, and PR-ing on to ‘develop’, it would be advantageous to have the testing workflow run on PR to develop as well as main.
This code includes the modifications to the `Reflectance` model struct. It uses `Spectrum` objects to hold whatever kind of reflectance spectrum we require. This comes with its accompanying builder object. I have also implemented the code to load from parameters and into attributes.
The logic in the spectral interpolation let through photons that were above the maximum wavelength in the loaded spectrum. It should not do this. So, I have fixed this with an extract check before performing interpolation. I have also written a new unit test to check this behaviour in the reflectance class.
Also added documentation to all of the `Spectrum` test cases.
The reflectance spectra should be between 0.0 -> 1.0, so check that they are when we init the reflectance, else we should gracefully exit and warn the user.
This means that we can more efficiently handle special cases and explictly specify behaviour more easily. In particular, it allows us to offer a `Constant` variant, which is not bounded by wavelengths. This includes all the changes required to make it work in the model.
In the the `Reflector` attribute, the ratio between diffuse and specular reflection is not required if only using a single reflectance model. However, it will assert that it is defined if both are used.
This is so that we can create constants in the `Spectrum` object form the parameter file.
The interpolation was not working the way that I’d expected. I should now have written it in the correct way. Tests show that it is working.
After fixing the interpolation problems, I have added some tests that check that things work with more points. This should be a better test as to whether the interpolation is actually working.
Fixed the warnings that were currently in the codebase. Just cleans up compiling a little.
Also fixed a few more compiler warnings.
We can now keep track of the progress through the lights in a given simulation.
Added unit tests to improve test coverage of core library.
Attempted to apply a fix for a crash that happens when the azimuthal component of the spherical CDF would return a value that would not map on to a valid plane, returning a `None`. I have made it iterate this process until a valid plane is found.
The idea of specularity is more elegant, and already well defined in computer graphics. Having it this way around makes more sense.

Tests pass with this change applied.
- Description changed to `specularity`.
This is just to keep the intermediate steps and output in-line with the changes I've made today.
EdHone and others added 12 commits April 11, 2023 15:48
- Added spectral reflectance implementation.
- Added test cases for spectral reflectance. 
- Fixed a number of bugs resulting from this feature.
- Added more unit tests for other functionality.
Integrate latest rust-netcdf bindings
- Added unit tests and supporting derives for `Event` enum.
- Raised pass threshold of Weighted points test to 0.5%.
This includes unit tests for most of the module, and also includes the other support code and derives on other structs to make them all work.
Added unit tests for:
- Average
- PNG
- Table
- Grid
- GridBuilder
- Cube
- Surface

Also includes some supporting derives for comparison.
Current coverage: 66% function, 56% line coverage.
- Light
- Spectrum
- SpectrumBuilder
- Tree
This was due to the file being accessed in parallel by multiple unit tests at once. I have resolved this issue by giving each test its own file to write to / read from.
- Added tests for `tools` module.
- Added more tests for `Triangle`.
- Added env::exec module.
@sammorrell sammorrell merged commit 347af40 into main Aug 29, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants