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

adding 3d mesh tallies #645

Merged
merged 33 commits into from
Jan 6, 2021
Merged

adding 3d mesh tallies #645

merged 33 commits into from
Jan 6, 2021

Conversation

shimwell
Copy link
Collaborator

@shimwell shimwell commented Dec 20, 2020

Proposed changes

This PR will add the ability for users to add 3D mesh tallies to the simulation

This first commit is just a small refactoring of the existing cell and mesh tally logic

Not sure if the code from the workshop for getting mesh data into vtk files should be added or if it should run as an external script
https://github.com/ukaea/openmc_workshop/blob/1a4abd540c0bb18b5ac6115a7a127892fd776d97/tasks/task_08_CSG_mesh_tally/openmc-statepoint-3d.py#L53-L162

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation Update (if none of the other choices apply)
  • New tests

Checklist

  • Pep8 applied
  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@codecov
Copy link

codecov bot commented Dec 20, 2020

Codecov Report

❗ No coverage uploaded for pull request base (develop_combine@e65fa60). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                Coverage Diff                 @@
##             develop_combine     #645   +/-   ##
==================================================
  Coverage                   ?   98.49%           
==================================================
  Files                      ?       68           
  Lines                      ?     4110           
  Branches                   ?        0           
==================================================
  Hits                       ?     4048           
  Misses                     ?       62           
  Partials                   ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e65fa60...b11c6f8. Read the comment docs.

@shimwell shimwell changed the title refactored tallies adding 3d mesh tallies Dec 20, 2020
@shimwell
Copy link
Collaborator Author

The refactoring has reduced the number of lines and therefore the coverage percent has dropped a bit.

def mesh_tally_3D(self, value):
if value is not None:
if not isinstance(value, list):
raise ValueError(

Choose a reason for hiding this comment

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

Shouldn't this be a TypeError ? :-D

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah you caught me copying and pasting from the 2d mesh @Property and forgot to implement the pullrequest review suggestions

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I fixed a few more of these in f9f7667

Comment on lines +418 to +419
score = '(n,Xt)' # where X is a wild card
prefix = 'tritium_production'

Choose a reason for hiding this comment

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

When standard_tally is tritium_production, these lines aren't tested

@shimwell
Copy link
Collaborator Author

This is starting to work and can produce vtk files automatically 🎉

Screenshot from 2020-12-23 20-04-15

@shimwell
Copy link
Collaborator Author

I am updating the dependencies image so that it contains a pip install vtk command

@shimwell
Copy link
Collaborator Author

I am not quite sure why the latest Circle CI tests are failing. It appears to be due to the Sweep tests.

The dependency image was recently updated so perhaps that is the cause

@RemDelaporteMathurin
Copy link

@shimwell are the tests failing locally ?

@shimwell
Copy link
Collaborator Author

shimwell commented Dec 24, 2020

@shimwell are the tests failing locally ?

Just checked this and yes all the tests pass locally

It also looks like it is working on the Github Actions CI which builds a docker image.

You can see why I finally got around to updating the dependency dockerfile in PR #647 ;-)

@shimwell
Copy link
Collaborator Author

Circle CI tests for the sweep are still failing,

This is strange because:

  • This PR has no changes to the Sweep functions
  • The tests pass locally
  • The docker image for circle CI has been updated so that it is now very similar to the docker image built during the Github Actions tests (which pass)

@RemDelaporteMathurin
Copy link

Circle CI tests for the sweep are still failing,

This is strange because:

  • This PR has no changes to the Sweep functions

  • The tests pass locally

  • The docker image for circle CI has been updated so that it is now very similar to the docker image built during the Github Actions tests (which pass)

Are you sure the image you are using for local testing is the same as the one used by the CI ?

@shimwell
Copy link
Collaborator Author

ah sorry when I mentioned the tests pass locally it is not on a docker image but it is on my base system. I can try locally with the docker image. Thanks for the idea

@shimwell
Copy link
Collaborator Author

The plot thickens as I just noticed that PR #648 is failing the same sweep tests. This is again happening with the Circle CI but not with Github Actions CI.

@shimwell shimwell changed the base branch from develop to develop_combine January 6, 2021 11:43
@shimwell shimwell merged commit ffbadc4 into develop_combine Jan 6, 2021
@shimwell shimwell deleted the adding_3d_mesh_tally branch January 6, 2021 11:45
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