Commit 9f3e992f authored by jannick.wolters's avatar jannick.wolters
Browse files

renamed solver to KiT-RT and adjusted all scripts to the new name; reworked...

renamed solver to KiT-RT and adjusted all scripts to the new name; reworked CMakeLists by e.g. adding CTest to allow unit tests by "make test" (unit test binary will be placed in the build dir now); moved all non-category source files to toolboxes; fixed some compiler warnings
parent 0c7ec318
Pipeline #116104 failed with stage
in 22 minutes and 9 seconds
......@@ -3,16 +3,14 @@ image: rtsn/test:latest
stages:
- unit_tests
unit_tests:
stage: unit_tests
script:
- git submodule update --init --recursive
- cd code/build/release
- cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=True ../../
- cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ../../
- ninja
- cd ../../bin
- ./unit_tests
- ninja test
timeout: 2h
only:
refs:
......
# RTSN - an HPC Radio Therapy $`S_n`$ framework
# KiT-RT - an HPC Radio Therapy $`S_n`$ framework
TBD
## What RTSN is capable of
## What KiT-RT is capable of
### Theory
TBD
### Examples
......@@ -56,13 +56,13 @@ Execute the compiled binary and hand over a valid *TOML*-styled config file.
Example from inside the `code` directory:
```bash
./bin/RTSN input/example.cfg
./bin/KiT-RT input/example.cfg
```
In order to run the code in parallel execute:
```bash
OMP_NUM_THREADS=N mpirun -np J ./bin/RTSN input/example.cfg
OMP_NUM_THREADS=N mpirun -np J ./bin/KiT-RT input/example.cfg
```
with `N` equal to the number of shared memory threads and `J` equal to the number of distrubuted memory threads.
......@@ -86,8 +86,8 @@ rm -r VTK-8.2.0 VTK-build
Example for build and run on bwUniCluster:
Get the code
```bash
git clone https://git.scc.kit.edu/rtsn/rtsn.git
cd rtsn/
git clone https://git.scc.kit.edu/rtsn/rtsn.git KiT-RT
cd KiT-RT/
git submodule init
git submodule update
```
......@@ -109,13 +109,13 @@ make -j
---
## Tests
In order to also compile the unit tests, add `-DBUILD_TESTING=True` to the cmake command, e.g.:
After compiling the framework as described above just run:
```bash
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=True ../../
make test
```
The resulting `unit_tests` executable will also be placed in `/bin`.
The `unit_tests` executable will also be placed in in the build folder.
## Continuous Integration (CI)
Every commit on the master branch will trigger a build test and unit tests.
......@@ -145,13 +145,13 @@ This last step requires a preceeding `docker login`. Ask Jannick for login crede
## Code structure
**WARNING: is not created automatically - might be out of date!**
Reverse engineered plantuml diagram of the current code structure:
![Can't load image](doc/rtsn.svg "UML diagram")
![Can't load image](doc/KiT-RT.svg "UML diagram")
<br/><br/>
Was created using [hpp2plantuml](https://github.com/thibaultmarin/hpp2plantuml) and [plantuml](https://plantuml.com/), e.g.:
```bash
cd doc
hpp2plantuml -i "../code/include/*.h" -i "../code/include/*/*.h" -o rtsn.puml
plantuml rtsn.puml -tsvg
hpp2plantuml -i "../code/include/*.h" -i "../code/include/*/*.h" -o KiT-RT.puml
plantuml KiT-RT.puml -tsvg
```
---
......
cmake_minimum_required( VERSION 3.12.4 )
project( RTSN VERSION 0.1.0 LANGUAGES CXX )
set( CMAKE_CXX_STANDARD 17 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
project( KiT-RT VERSION 0.1.0 LANGUAGES CXX )
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=native -Wno-dev" )
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -march=native -pg -no-pie" )
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -Wall" )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin" )
file( GLOB_RECURSE SRCS RELATIVE ${CMAKE_SOURCE_DIR} "src/*.cpp" "include/*.h" )
include_directories( ${CMAKE_SOURCE_DIR}/include )
add_executable( ${CMAKE_PROJECT_NAME} ${SRCS} )
### COMPILER ####################################
set( CMAKE_CXX_STANDARD 17 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( KITRT_RELEASE_OPTIONS -march=native -w )
set( KITRT_RELWITHDEBINFO_OPTIONS -march=native -pg -no-pie )
set( KITRT_DEBUG_OPTIONS -Wall -Wextra -Wpedantic )
#################################################
find_package( Python3 COMPONENTS Interpreter Development NumPy REQUIRED )
include_directories( ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS} )
add_compile_definitions( RTSN_PYTHON_PATH="${CMAKE_SOURCE_DIR}/python" )
### LIBRARIES ###################################
find_package( OpenMP REQUIRED )
if( OPENMP_FOUND )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
endif()
find_package( MPI REQUIRED )
include_directories( ${MPI_INCLUDE_PATH} )
......@@ -30,6 +21,15 @@ find_package( LAPACK REQUIRED )
include_directories( ${LAPACK_INCLUDE_DIR} )
find_package( BLAS )
find_package( VTK REQUIRED COMPONENTS vtkIOGeometry vtkFiltersCore )
find_package( Python3 COMPONENTS Interpreter Development NumPy REQUIRED )
include_directories( ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS} )
add_compile_definitions( KITRT_PYTHON_PATH="${CMAKE_SOURCE_DIR}/python" )
add_compile_definitions( BLAZE_USE_SHARED_MEMORY_PARALLELIZATION=0 )
message( STATUS "Blaze: Shared memory parallelization disabled" )
if( BLAS_FOUND )
message( STATUS "Blaze: BLAS mode enabled" )
add_compile_definitions( BLAZE_BLAS_MODE=1 )
......@@ -38,80 +38,7 @@ else()
message( STATUS "Blaze: BLAS mode disabled" )
add_compile_definitions( BLAZE_BLAS_MODE=0 )
endif()
add_compile_definitions( BLAZE_USE_SHARED_MEMORY_PARALLELIZATION=0 )
set(flag 1)
if (WIN32)
execute_process(COMMAND wmic cpu get L3CacheSize
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
if (flag)
execute_process(COMMAND wmic cpu get L2CacheSize
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
endif (flag)
if (flag)
execute_process(COMMAND wmic cpu get L1CacheSize
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
endif (flag)
endif (WIN32)
if (UNIX)
execute_process(COMMAND cat /sys/devices/system/cpu/cpu0/cache/index3/size
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
if (flag)
execute_process(COMMAND cat /sys/devices/system/cpu/cpu0/cache/index2/size
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
endif (flag)
if (flag)
execute_process(COMMAND cat /sys/devices/system/cpu/cpu0/cache/index1/size
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
endif (flag)
endif (UNIX)
if (APPLE)
execute_process(COMMAND sysctl -n hw.l3cachesize
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
if (flag)
execute_process(COMMAND sysctl -n hw.l2cachesize
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
endif (flag)
if (flag)
execute_process(COMMAND sysctl -n hw.l1icachesize
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
endif (flag)
if (flag EQUAL 0)
math(EXPR tmp ${tmp}/1024) # If successful convert to kibibytes to comply with rest
endif (flag EQUAL 0)
endif (APPLE)
if (flag)
message(WARNING "Cache size not found automatically. Using default value as cache size.")
set(tmp "3072")
endif (flag)
string( REGEX MATCH "([0-9][0-9]+)" tmp ${tmp} )
math( EXPR BLAZE_CACHE_SIZE ${tmp}*1024 )
add_compile_definitions( BLAZE_CACHE_SIZE=${BLAZE_CACHE_SIZE}UL )
message( STATUS "Blaze: Automatic Cache Size Configuration = ${BLAZE_CACHE_SIZE} KiB" )
include( ${CMAKE_SOURCE_DIR}/cmake/blaze-cache-config.cmake )
include_directories( ${CMAKE_SOURCE_DIR}/ext/blaze )
add_compile_definitions( METIS_EXPORT= )
......@@ -121,12 +48,14 @@ include_directories( ${ParMETIS_PATH}/include )
include_directories( ${ParMETIS_PATH}/metis/include )
add_subdirectory( ${ParMETIS_PATH} )
find_package( VTK REQUIRED COMPONENTS vtkIOGeometry vtkFiltersCore HINTS /home/pia/vtk-inst/include/vtk-8.2)
include(${VTK_USE_FILE})
include_directories( ${CMAKE_SOURCE_DIR}/ext/cpptoml/include )
include_directories( ${CMAKE_SOURCE_DIR}/ext/spdlog/include )
set( CORE_LIBRARIES ${Python3_LIBRARIES} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MPI_LIBRARIES} ${VTK_LIBRARIES} OpenMP::OpenMP_CXX parmetis -lstdc++fs )
#################################################
### MISC ########################################
execute_process(
COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
......@@ -134,17 +63,33 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)
add_compile_definitions( GIT_HASH="${GIT_HASH}" )
#################################################
set( CORE_LIBRARIES ${Python3_LIBRARIES} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MPI_LIBRARIES} ${VTK_LIBRARIES} OpenMP::OpenMP_CXX parmetis -lstdc++fs )
### BUILD KIT-RT ################################
file( GLOB_RECURSE SRCS RELATIVE ${CMAKE_SOURCE_DIR} "src/*.cpp" "include/*.h" )
include_directories( ${CMAKE_SOURCE_DIR}/include )
add_executable( ${CMAKE_PROJECT_NAME} ${SRCS} ${EXT_SRCS} )
target_link_libraries( ${CMAKE_PROJECT_NAME} ${CORE_LIBRARIES} )
if( BUILD_TESTING )
add_compile_definitions( BUILD_TESTING=1 )
add_subdirectory( ${CMAKE_SOURCE_DIR}/ext/Catch2 )
include_directories( ${CMAKE_SOURCE_DIR}/ext/Catch2/single_include/catch2 )
file( GLOB_RECURSE TEST_SRCS RELATIVE ${CMAKE_SOURCE_DIR} "tests/*.cpp" )
list( REMOVE_ITEM SRCS "src/main.cpp" )
add_executable( unit_tests ${SRCS} ${TEST_SRCS} )
target_link_libraries( unit_tests ${CORE_LIBRARIES} )
endif()
set_target_properties( ${CMAKE_PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin" )
target_compile_options( ${CMAKE_PROJECT_NAME} PUBLIC "$<$<CONFIG:DEBUG>:${KITRT_DEBUG_OPTIONS}>" )
target_compile_options( ${CMAKE_PROJECT_NAME} PUBLIC "$<$<CONFIG:RELWITHDEBINFO>:${KITRT_RELWITHDEBINFO_OPTIONS}>" )
target_compile_options( ${CMAKE_PROJECT_NAME} PUBLIC "$<$<CONFIG:RELEASE>:${KITRT_RELEASE_OPTIONS}>" )
#################################################
### BUILD UNIT TESTS ############################
include( CTest )
set( CATCH_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/ext/Catch2/single_include/catch2 )
add_library( Catch INTERFACE )
target_include_directories( Catch INTERFACE ${CATCH_INCLUDE_DIR} )
file( GLOB_RECURSE TEST_SRCS RELATIVE ${CMAKE_SOURCE_DIR} "tests/*.cpp" )
list( REMOVE_ITEM SRCS "src/main.cpp" )
add_executable( unit_tests ${TEST_SRCS} ${SRCS} ${EXT_SRCS} )
target_link_libraries( unit_tests Catch ${CORE_LIBRARIES} )
target_compile_options( unit_tests PUBLIC "$<$<CONFIG:DEBUG>:${KITRT_DEBUG_OPTIONS}>" )
target_compile_options( unit_tests PUBLIC "$<$<CONFIG:RELWITHDEBINFO>:${KITRT_RELWITHDEBINFO_OPTIONS}>" )
target_compile_options( unit_tests PUBLIC "$<$<CONFIG:RELEASE>:${KITRT_RELEASE_OPTIONS}>" )
add_test( NAME unit_tests COMMAND unit_tests )
enable_testing()
#################################################
set(flag 1)
if (WIN32)
execute_process(COMMAND wmic cpu get L3CacheSize
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
if (flag)
execute_process(COMMAND wmic cpu get L2CacheSize
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
endif (flag)
if (flag)
execute_process(COMMAND wmic cpu get L1CacheSize
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
endif (flag)
endif (WIN32)
if (UNIX)
execute_process(COMMAND cat /sys/devices/system/cpu/cpu0/cache/index3/size
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
if (flag)
execute_process(COMMAND cat /sys/devices/system/cpu/cpu0/cache/index2/size
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
endif (flag)
if (flag)
execute_process(COMMAND cat /sys/devices/system/cpu/cpu0/cache/index1/size
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
endif (flag)
endif (UNIX)
if (APPLE)
execute_process(COMMAND sysctl -n hw.l3cachesize
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
if (flag)
execute_process(COMMAND sysctl -n hw.l2cachesize
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
endif (flag)
if (flag)
execute_process(COMMAND sysctl -n hw.l1icachesize
OUTPUT_VARIABLE tmp
RESULT_VARIABLE flag
ERROR_QUIET)
endif (flag)
if (flag EQUAL 0)
math(EXPR tmp ${tmp}/1024) # If successful convert to kibibytes to comply with rest
endif (flag EQUAL 0)
endif (APPLE)
if (flag)
message(WARNING "Cache size not found automatically. Using default value as cache size.")
set(tmp "3072")
endif (flag)
string( REGEX MATCH "([0-9][0-9]+)" tmp ${tmp} )
math( EXPR BLAZE_CACHE_SIZE ${tmp}*1024 )
add_compile_definitions( BLAZE_CACHE_SIZE=${BLAZE_CACHE_SIZE}UL )
message( STATUS "Blaze: Automatic Cache Size Configuration = ${BLAZE_CACHE_SIZE} KiB" )
Subproject commit e68c8e3947f9383e28cb8623d116ca996b3651a9
Subproject commit 263c94a262be616484b0bbeb33a6677411f25fbb
......@@ -12,8 +12,8 @@
#include "metis.h"
#include "parmetis.h"
#include "reconstructor.h"
#include "toolboxes/errormessages.h"
#include "toolboxes/reconstructor.h"
class Mesh
{
......@@ -23,11 +23,11 @@ class Mesh
const unsigned _numNodes;
const unsigned _numNodesPerCell;
const unsigned _numBoundaries;
const unsigned _numCellBoundaryNodes;
const unsigned _ghostCellID; // equal to _numCells and therefore has the ID of the last cell + 1
std::vector<std::pair<double, double>> _bounds;
unsigned _numNodesPerBoundary;
std::vector<std::pair<double, double>> _bounds;
std::vector<Vector> _nodes; // dimension: numNodes<dim>
std::vector<std::vector<unsigned>> _cells; // dimension: numCells<numNodesPerCell>
std::vector<std::pair<BOUNDARY_TYPE, std::vector<unsigned>>> _boundaries; // dimension: numBoundaries<(1,numBoundaryNodes)>
......
#ifndef ELECTRONRT_H
#define ELECTRONRT_H
#include "physics.h"
#include "problembase.h"
#include "toolboxes/physics.h"
class ElectronRT : public ProblemBase
{
......
......@@ -19,36 +19,68 @@ class ErrorMessages
inline static void Error( std::string ErrorMsg, std::string FunctionName ) {
auto log = spdlog::get( "event" );
// if (Rank == 0){ //For MPI implementation later
log->error( "\n" );
log->error( "Error in \"{0}\": ", FunctionName );
log->error( "-------------------------------------------------------------------------" );
log->error( ErrorMsg );
log->error( "------------------------------ Error Exit -------------------------------" );
log->error( "\n" );
if( log ) {
log->error( "\n" );
log->error( "Error in \"{0}\": ", FunctionName );
log->error( "-------------------------------------------------------------------------" );
log->error( ErrorMsg );
log->error( "------------------------------ Error Exit -------------------------------" );
log->error( "\n" );
}
else {
spdlog::error( "\n" );
spdlog::error( "Error in \"{0}\": ", FunctionName );
spdlog::error( "-------------------------------------------------------------------------" );
spdlog::error( ErrorMsg );
spdlog::error( "------------------------------ Error Exit -------------------------------" );
spdlog::error( "\n" );
}
//}
exit( EXIT_FAILURE );
}
inline static void OptionNotSetError( std::string OptionName, std::string FunctionName ) {
auto log = spdlog::get( "event" );
// if (Rank == 0){
std::cout << std::endl << std::endl;
std::cout << "Error in \"" << FunctionName << "\": " << std::endl;
std::cout << "-------------------------------------------------------------------------" << std::endl;
std::cout << "Option " << OptionName << " not set. Please check your config file." << std::endl;
std::cout << "------------------------------ Error Exit -------------------------------" << std::endl;
std::cout << std::endl << std::endl;
if( log ) {
log->error( "\n" );
log->error( "Error in \"{0}\": ", FunctionName );
log->error( "-------------------------------------------------------------------------" );
log->error( "Option \"{0}\" not set. Please check your config file.", OptionName );
log->error( "------------------------------ Error Exit -------------------------------" );
log->error( "\n" );
}
else {
spdlog::error( "\n" );
spdlog::error( "Error in \"{0}\": ", FunctionName );
spdlog::error( "-------------------------------------------------------------------------" );
spdlog::error( "Option \"{0}\" not set. Please check your config file.", OptionName );
spdlog::error( "------------------------------ Error Exit -------------------------------" );
spdlog::error( "\n" );
}
//}
exit( EXIT_FAILURE );
}
inline static void ParsingError( std::string ErrorMsg, std::string FunctionName ) {
auto log = spdlog::get( "event" );
// if (Rank == 0){
std::cout << std::endl << std::endl;
std::cout << "Error in \"" << FunctionName << "\": " << std::endl;
std::cout << "-------------------------------------------------------------------------" << std::endl;
std::cout << ErrorMsg;
std::cout << "------------------------------ Error Exit -------------------------------" << std::endl;
std::cout << std::endl << std::endl;
if( log ) {
log->error( "\n" );
log->error( "Error in \"{0}\": ", FunctionName );
log->error( "-------------------------------------------------------------------------" );
log->error( ErrorMsg );
log->error( "------------------------------ Error Exit -------------------------------" );
log->error( "\n" );
}
else {
spdlog::error( "\n" );
spdlog::error( "Error in \"{0}\": ", FunctionName );
spdlog::error( "-------------------------------------------------------------------------" );
spdlog::error( ErrorMsg );
spdlog::error( "------------------------------ Error Exit -------------------------------" );
spdlog::error( "\n" );
}
//}
exit( EXIT_FAILURE );
}
......
......@@ -638,9 +638,12 @@ void Config::InitLogger() {
#ifdef BUILD_TESTING
terminalLogLvl = spdlog::level::err;
fileLogLvl = spdlog::level::off;
#else
#elif NDEBUG
terminalLogLvl = spdlog::level::info;
fileLogLvl = spdlog::level::info;
#else
terminalLogLvl = spdlog::level::debug;
fileLogLvl = spdlog::level::debug;
#endif
// create log dir if not existent
......
......@@ -365,7 +365,7 @@ Matrix createSU2MeshFromImage( std::string imageName, std::string SU2Filename )
ErrorMessages::Error( "Output directory '" + outDir.string() + "' does not exists!", CURRENT_FUNCTION );
}
std::string pyPath = RTSN_PYTHON_PATH;
std::string pyPath = KITRT_PYTHON_PATH;
if( !Py_IsInitialized() ) {
Py_InitializeEx( 0 );
......
......@@ -6,8 +6,14 @@ Mesh::Mesh( std::vector<Vector> nodes,
std::vector<std::vector<unsigned>> cells,
std::vector<std::pair<BOUNDARY_TYPE, std::vector<unsigned>>> boundaries )
: _dim( nodes[0].size() ), _numCells( cells.size() ), _numNodes( nodes.size() ), _numNodesPerCell( cells[0].size() ),
_numBoundaries( boundaries.size() ), _numCellBoundaryNodes( _numNodesPerCell - 1u ), _ghostCellID( _numCells ), _nodes( nodes ),
_cells( cells ), _boundaries( boundaries ) {
_numBoundaries( boundaries.size() ), _ghostCellID( _numCells ), _nodes( nodes ), _cells( cells ), _boundaries( boundaries ) {
if( _dim == 2 ) {
_numNodesPerBoundary = 2u;
}
else {
ErrorMessages::Error( "Unsupported mesh dimension!", CURRENT_FUNCTION );
}
ComputeCellAreas();
ComputeCellMidpoints();
ComputeConnectivity();
......@@ -57,7 +63,7 @@ void Mesh::ComputeConnectivity() {
for( unsigned j = 0; j < _numCells; ++j ) {
if( i == j ) continue;
if( static_cast<unsigned>( blaze::dot( blaze::row( connMat, i ), blaze::row( connMat, j ) ) ) ==
_numCellBoundaryNodes ) { // in 2D cells are neighbors if they share two nodes std::vector<unsigned>* cellsJ = &sortedCells[j];
_numNodesPerBoundary ) { // in 2D cells are neighbors if they share two nodes std::vector<unsigned>* cellsJ = &sortedCells[j];
std::vector<unsigned>* cellsJ = &sortedCells[j];
std::vector<unsigned> commonElements;
std::set_intersection( cellsI->begin(),
......
......@@ -82,7 +82,7 @@ void MLOptimizer::init_numpy() {
void MLOptimizer::initialize_python() {
// Initialize the Python Interpreter
std::string pyPath = RTSN_PYTHON_PATH;
std::string pyPath = KITRT_PYTHON_PATH;
if( !Py_IsInitialized() ) {
......
#include "problems/linesource.h"
#include "common/config.h"
#include "common/mesh.h"
#include "physics.h"
#include "toolboxes/physics.h"
#include <complex>
......
......@@ -267,8 +267,8 @@ double MNSolver::WriteOutputFields( unsigned idx_pseudoTime ) {
}
mass *= firstMomentScaleFactor;
if( _settings->GetOutputFrequency() != 0 && idx_pseudoTime % (unsigned)_settings->GetOutputFrequency() == 0 ||
idx_pseudoTime == _nEnergies - 1 /* need sol at last iteration */ ) {
if( ( _settings->GetOutputFrequency() != 0 && idx_pseudoTime % (unsigned)_settings->GetOutputFrequency() == 0 ) ||
( idx_pseudoTime == _nEnergies - 1 ) /* need sol at last iteration */ ) {
for( unsigned idx_group = 0; idx_group < nGroups; idx_group++ ) {
switch( _settings->GetVolumeOutput()[idx_group] ) {
......
......@@ -238,7 +238,7 @@ void PNSolver::ComputeFluxComponents() {
_AxMinus = _AxMinus * eigenVectors;
_AxAbs = _AxAbs * eigenVectors;
eigenValuesX = eigenValues;
// eigenValuesX = eigenValues;
}
// --- For y Direction -------
{
......@@ -264,7 +264,7 @@ void PNSolver::ComputeFluxComponents() {
_AyMinus = _AyMinus * eigenVectors;
_AyAbs = _AyAbs * eigenVectors;
eigenValuesY = eigenValues;
// eigenValuesY = eigenValues;
}
// --- For z Direction -------
{
......@@ -383,8 +383,8 @@ double PNSolver::WriteOutputFields( unsigned idx_pseudoTime ) {
}
mass *= firstMomentScaleFactor;
if( _settings->GetOutputFrequency() != 0 && idx_pseudoTime % (unsigned)_settings->GetOutputFrequency() == 0 ||
idx_pseudoTime == _nEnergies - 1 /* need sol at last iteration */ ) {
if( ( _settings->GetOutputFrequency() != 0 && idx_pseudoTime % (unsigned)_settings->GetOutputFrequency() == 0 ) ||
( idx_pseudoTime == _nEnergies - 1 ) /* need sol at last iteration */ ) {
for( unsigned idx_group = 0; idx_group < nGroups; idx_group++ ) {
switch( _settings->GetVolumeOutput()[idx_group] ) {
case MINIMAL:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!