Skip to content

Commit 6faf894

Browse files
committed
updated source directory of polaris
- consistent use of header files (declarations) and source files (implementations) - new files for sub-classes (instead of a single large file)
1 parent a2ac5c5 commit 6faf894

File tree

124 files changed

+39306
-35316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+39306
-35316
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![bibcode](https://img.shields.io/badge/bibcode-2016A%26A...593A..87R-1c459b)](https://ui.adsabs.harvard.edu/abs/2016A&A...593A..87R)
88
[![doi](https://img.shields.io/badge/doi-10.1051%2F0004--6361%2F201424930-fab70c)](https://doi.org/10.1051/0004-6361/201424930)
99
[![License](https://img.shields.io/badge/License-GPLv3-blue)](https://www.gnu.org/licenses/gpl-3.0)
10-
[![Version](https://img.shields.io/badge/Version-4.12.08-bf0040)](https://img.shields.io/badge/Version-4.12.08-bf0040)
10+
[![Version](https://img.shields.io/badge/Version-4.13.00-bf0040)](https://img.shields.io/badge/Version-4.13.00-bf0040)
1111

1212
is a 3D Monte Carlo radiative transfer code that
1313

manual.pdf

61 Bytes
Binary file not shown.

projects/test/raytracing_scattering/POLARIS.cmd

+18
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,21 @@
5656
<enfsca> 1
5757

5858
</task>
59+
60+
# this simulation should not be used for gitlab CI/CD as it takes some time
61+
<task> 0
62+
63+
<cmd> CMD_DUST_SCATTERING
64+
65+
<detector_dust_mc nr_pixel = "255*255"> 1e-5 1e-3 5 0.00 0.00 4.32e+18
66+
67+
<source_star nr_photons = "1e10"> 0 0 0 2 4500
68+
<source_dust nr_photons = "2.1e10">
69+
70+
<path_grid> "projects/test/raytracing_scattering/grid_3D_sphere_const_T_m1e-5.dat"
71+
<path_out> "projects/test/raytracing_scattering/dust_mc_nopeel/"
72+
73+
<peel_off> 0
74+
<enfsca> 1
75+
76+
</task>

projects/test/raytracing_scattering/compare.py

+5
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,16 @@ def compare():
4141
dust_sed_data = read_data('projects/test/raytracing_scattering/dust/data/polaris_detector_nr0001_sed.fits.gz')
4242
dust_rt_sed_data = read_data('projects/test/raytracing_scattering/dust_rt/data/polaris_detector_nr0001_sed.fits.gz')
4343
dust_mc_sed_data = read_data('projects/test/raytracing_scattering/dust_mc/data/polaris_detector_nr0001_sed.fits.gz')
44+
# dust_mc_nopeel_sed_data = read_data('projects/test/raytracing_scattering/dust_mc_nopeel/data/polaris_detector_nr0001_sed.fits.gz')
4445

4546
max_rel_diff = np.max(np.abs( (dust_sed_data['I'] + dust_mc_sed_data['I']) / dust_rt_sed_data['I'] - 1.0 ))
4647
if max_rel_diff > 1e-3:
4748
raise Exception(f'Test failed: Stokes I does not match (max. relative difference = {max_rel_diff})')
4849

50+
# max_rel_diff = np.max(np.abs( (dust_sed_data['I'] + dust_mc_sed_data['I']) / dust_mc_nopeel_sed_data['I'] - 1.0 ))
51+
# if max_rel_diff > 1e-2:
52+
# raise Exception(f'Test failed: Stokes I does not match (max. relative difference = {max_rel_diff})')
53+
4954
mc_polarization = np.sqrt(dust_mc_sed_data['Q']**2 + dust_mc_sed_data['U']**2 + dust_mc_sed_data['V']**2) / (dust_mc_sed_data['I'] + dust_sed_data['I'])
5055
rt_polarization = np.sqrt(dust_rt_sed_data['Q']**2 + dust_rt_sed_data['U']**2 + dust_rt_sed_data['V']**2) / dust_rt_sed_data['I']
5156
max_abs_diff = np.max(np.abs( mc_polarization - rt_polarization ))

src/CMakeLists.txt

+24-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required (VERSION 3.13.4)
22
PROJECT (POLARIS
3-
VERSION 4.12.08
3+
VERSION 4.13.00
44
DESCRIPTION "POLARIS: POLArized RadIation Simulator, Copyright (C) 2018 Stefan Reissl"
55
HOMEPAGE_URL "https://portia.astrophysik.uni-kiel.de/polaris/"
66
LANGUAGES CXX
@@ -25,10 +25,28 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
2525
FIND_PACKAGE (CCFITS REQUIRED)
2626
FIND_PACKAGE (OpenMP REQUIRED)
2727

28-
SET (SRC_FILES CommandParser.cpp Cylindrical.cpp Dust.cpp
29-
Faddeeva.cc Grid.cpp GasSpecies.cpp OcTree.cpp OPIATE.cpp
30-
Pipeline.cpp RadiativeTransfer.cpp Source.cpp Spherical.cpp
31-
Voronoi.cpp Synchrotron.cpp
28+
SET (SRC_FILES
29+
CellBasic.cpp CellCylindrical.cpp CellOcTree.cpp CellSpherical.cpp CellVoronoi.cpp
30+
CommandParser.cpp
31+
CrossSections.cpp
32+
Detector.cpp
33+
DustComponent.cpp DustMixture.cpp
34+
Faddeeva.cc
35+
GasMixture.cpp GasSpecies.cpp
36+
GridBasic.cpp GridCylindrical.cpp GridOcTree.cpp GridSpherical.cpp GridVoronoi.cpp
37+
MathFunctions.cpp MathInterp.cpp MathProbList.cpp MathSpline.cpp
38+
Matrix2D.cpp
39+
OPIATE.cpp
40+
Parameters.cpp
41+
Photon.cpp
42+
Pipeline.cpp
43+
RadiativeTransfer.cpp
44+
RandomGenerator.cpp
45+
RaytracingBasic.cpp RaytracingCartesian.cpp RaytracingHealPix.cpp RaytracingPolar.cpp RaytracingSlice.cpp
46+
SourceAGN.cpp SourceBackground.cpp SourceBasic.cpp SourceDust.cpp SourceGas.cpp SourceISRF.cpp SourceLaser.cpp SourceStar.cpp SourceStarField.cpp
47+
Stokes.cpp
48+
Synchrotron.cpp SyncParameters.cpp
49+
Vector3D.cpp
3250
)
3351

3452
ADD_EXECUTABLE (polaris main.cpp ${SRC_FILES})
@@ -38,7 +56,7 @@ INSTALL (TARGETS polaris)
3856

3957
INCLUDE (CTest)
4058
if(BUILD_TESTING)
41-
ADD_EXECUTABLE (tests tests.cpp MathFunctions_t.cpp Dust_t.cpp ${SRC_FILES})
59+
ADD_EXECUTABLE (tests tests.cpp DustComponent_t.cpp MathFunctions_t.cpp RandomGenerator_t.cpp ${SRC_FILES})
4260
TARGET_LINK_LIBRARIES (tests PRIVATE OpenMP::OpenMP_CXX ${CCFITS_LIBRARY} ${CFITSIO_LIBRARY})
4361
TARGET_INCLUDE_DIRECTORIES (tests PRIVATE ../ext ${CMAKE_CURRENT_LIST_DIR} ${CFITSIO_INCLUDE_DIR})
4462
# allow user to run tests with `make test` or `ctest`

0 commit comments

Comments
 (0)