Skip to content

Commit

Permalink
Merge branch 'develop' into spherical_harmonics_nn
Browse files Browse the repository at this point in the history
  • Loading branch information
ScSteffen authored Nov 14, 2023
2 parents 17b9d0a + 22a5c21 commit fa9a8d7
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,12 @@ ldconfig /usr/local/lib
```
## Cite
```
@article{kitrt,
author = {Schotthöfer, Steffen and Kusch, Jonas and Stammer, Pia and Wolters, Jannick and Xiao, Tianbai },
title = {KiT-RT: Kinetic Transport for Radio Therapy Solver},
year = {2022},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/CSMMLab/KiT-RT}},
commit = {b9943e1aae6a54c2c3d2033d168de1ab7912ae75}
@misc{kitrt2022,
title={KiT-RT: An extendable framework for radiative transfer and therapy},
author={Jonas Kusch and Steffen Schotthöfer and Pia Stammer and Jannick Wolters and Tianbai Xiao},
year={2022},
eprint={2205.08417},
archivePrefix={arXiv},
primaryClass={physics.med-ph}
}
```
25 changes: 16 additions & 9 deletions examples/configs/DataGeneratorRegression2D.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Data Generator for %
% Neural Entropy Closure %
% Author <Steffen Schotthöfer> %
% Author <Steffen Schotthöfer> %
% Date 17.12.2020 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
Expand All @@ -11,16 +11,22 @@ SAMPLER_NAME = REGRESSION_SAMPLER
TRAINING_SET_SIZE = 10000
SIZE_BY_DIMENSION = NO
MAX_VALUE_FIRST_MOMENT = 1
SPATIAL_DIM = 2
MAX_MOMENT_SOLVER = 1
REALIZABLE_SET_EPSILON_U1 = 0.08
REALIZABLE_SET_EPSILON_U0 = 0.08

NORMALIZED_SAMPLING = YES
ALPHA_SAMPLING = YES
UNIFORM_SAMPLING = NO
ALPHA_SAMPLING_BOUND = 30
MIN_EIGENVALUE_THRESHOLD = 1e-9
REALIZABILITY_RECONSTRUCTION = NO


%Configure the spatial dimension of the closure here
SPATIAL_DIM = 2

%Configure the maximum moment of the closure here
MAX_MOMENT_SOLVER = 1

% Determine, how close to the boundary you want to sample. Higher alpha inplies harder training
ALPHA_SAMPLING_BOUND = 10
% Higher eigenvalue treshold implies larger distance to the boundary
MIN_EIGENVALUE_THRESHOLD = 1e-4

%
% ---- File specifications ----
Expand All @@ -31,7 +37,7 @@ OUTPUT_DIR = ../result
OUTPUT_FILE = DataGenerator2D
% Log directory
LOG_DIR = ../result/logs
LOG_FILE = dataGen2D
LOG_FILE = Monomial_M1_2D_normal_gaussian

%
% --- Spherical Basis ----
Expand All @@ -42,6 +48,7 @@ SPHERICAL_BASIS = SPHERICAL_MONOMIALS
% --- Entropy settings ----
ENTROPY_FUNCTIONAL = MAXWELL_BOLTZMANN
ENTROPY_OPTIMIZER = NEWTON
REALIZABILITY_RECONSTRUCTION = NO
%
% ----- Newton Solver Specifications ----
%
Expand Down
1 change: 0 additions & 1 deletion src/common/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Mesh::Mesh( std::vector<Vector> nodes,
ComputeCellMidpoints();
ComputeConnectivity();
ComputeBounds();
// ComputeCellInterfaceMidpoints();
}

Mesh::~Mesh() {}
Expand Down
2 changes: 1 addition & 1 deletion src/problems/starmapvalidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ StarMapValidation_Moment::StarMapValidation_Moment( Config* settings, Mesh* mesh
StarMapValidation_Moment::~StarMapValidation_Moment() {}

VectorVector StarMapValidation_Moment::SetupIC() {

SphericalBase* tempBase = SphericalBase::Create( _settings );
unsigned ntotalEquations = tempBase->GetBasisSize();
delete tempBase;
Expand All @@ -103,6 +102,7 @@ VectorVector StarMapValidation_Moment::SetupIC() {
x = cellMidpoints[idx_cell][0];
y = cellMidpoints[idx_cell][1];
f = NormPDF( x, pos_beam[0], stddev ) * NormPDF( y, pos_beam[1], stddev );

initialSolution[idx_cell][0] = f * StarMAPmoments[0];
for( unsigned idx_sys = 1; idx_sys < ntotalEquations; idx_sys++ ) {
initialSolution[idx_cell][idx_sys] = f * StarMAPmoments[idx_sys]; // must be VectorVector
Expand Down
2 changes: 1 addition & 1 deletion src/solvers/csdmnsolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void CSDMNSolver::IterPreprocessing( unsigned idx_iter ) {
_optimizer->SolveMultiCell( _alpha, _sol, _momentBasis, alpha_norm_dummy );

// ------- Solution reconstruction step ----
//#pragma omp parallel for
#pragma omp parallel for
for( unsigned idx_cell = 0; idx_cell < _nCells; idx_cell++ ) {
for( unsigned idx_quad = 0; idx_quad < _nq; idx_quad++ ) {
// compute the kinetic density at all grid cells
Expand Down

0 comments on commit fa9a8d7

Please sign in to comment.