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

Relativity #697

Merged
merged 17 commits into from
Mar 13, 2019
Merged

Relativity #697

merged 17 commits into from
Mar 13, 2019

Conversation

chvogl
Copy link
Contributor

@chvogl chvogl commented Jan 26, 2017

Addresses TEP010: Consistent Treatment of relativistic effects.

This PR implements:

  • transformation of continuum (e.g. electron scattering) opacity
  • consistent treatment of volume based estimators
  • angle aberration
  • common direction frequency surfaces of relativistic Sobolev theory

Still missing relativistic effects:

  • transformation of Sobolev optical depth (only factor 1/gamma)
  • j_blues_estimator (only factor 1/gamma)
  • (transformation of deflection angle for reflecting photosphere)

These missing effects are considered non-critical and insignificant.

@@ -139,12 +139,55 @@ binary_search (const double *x, double x_insert, int64_t imin,
return ret_val;
}

void
do_angle_aberration (rpacket_t *packet, const storage_model_t *storage)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is only active during full_relativity I'd do the relativity check in this function instead of outside.
That way you can't execute the function by accident and the code would be cleaner.

The disadvantage is you'd have to look at the function implementation to know this is full_relativity only. But I think we can live with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is an excellent idea.

* @return CMF direction cosine
*/
double
inverse_angle_aberration (rpacket_t *packet, const storage_model_t *storage, double mu)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.
Maybe explicitly add inline directive?

Copy link
Contributor

@unoebauer unoebauer left a comment

Choose a reason for hiding this comment

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

I am a bit worried about clarity here. It is not always obvious if mu is measured in the LF or in the CMF. I have suggested a number of name changes to improve the readability but we may also think about the possibility of introducing additional packet properties, specifically storing the state in the CMF/LF.

tardis/montecarlo/src/cmontecarlo.c Outdated Show resolved Hide resolved
tardis/montecarlo/src/cmontecarlo.c Outdated Show resolved Hide resolved
return 1.0 -
rpacket_get_mu (packet) * rpacket_get_r (packet) *
storage->inverse_time_explosion * INVERSE_C;
double beta = rpacket_get_r (packet) * storage->inverse_time_explosion * INVERSE_C;
Copy link
Contributor

Choose a reason for hiding this comment

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

One could again think about introducing more clarity here:

doppler_factor_CMF_to_LF
doppler_factor_LF_to_CMF

If this naming scheme is considered too cumbersome, I'd at least advise to add an inline comment about the transformation direction!


if (storage->full_relativity)
{
current_nu = current_nu * (1 + beta * current_mu) / sqrt(1 - beta * beta);
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't you use the doppler_factor routines for this?

@codecov-io
Copy link

codecov-io commented Feb 26, 2019

Codecov Report

Merging #697 into master will increase coverage by 0.31%.
The diff coverage is 97.01%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #697      +/-   ##
==========================================
+ Coverage   66.23%   66.54%   +0.31%     
==========================================
  Files          83       83              
  Lines        5917     5978      +61     
==========================================
+ Hits         3919     3978      +59     
- Misses       1998     2000       +2
Impacted Files Coverage Δ
tardis/montecarlo/struct.py 100% <ø> (ø) ⬆️
tardis/montecarlo/tests/test_cmontecarlo.py 98.19% <100%> (+0.29%) ⬆️
tardis/montecarlo/base.py 86.92% <66.66%> (-0.41%) ⬇️
tardis/io/config_reader.py 81.65% <75%> (-0.26%) ⬇️

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 d209920...34656a8. Read the comment docs.

@wkerzendorf wkerzendorf merged commit 592cc80 into tardis-sn:master Mar 13, 2019
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.

5 participants