Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KiT-RT
KiT-RT
Commits
db7fac49
Commit
db7fac49
authored
Nov 30, 2020
by
jannick.wolters
Browse files
removed some cout's; added better CTest integration
Former-commit-id:
f6af86e2
parent
515eec7a
Changes
6
Hide whitespace changes
Inline
Side-by-side
code/CMakeLists.txt
View file @
db7fac49
...
...
@@ -12,7 +12,7 @@ set( KITRT_DEBUG_OPTIONS -Wall -Wextra -Wpedantic )
### LIBRARIES ###################################
set
(
CMAKE_MODULE_PATH
${
PROJECT_SOURCE_DIR
}
/cmake
)
set
(
CMAKE_MODULE_PATH
${
PROJECT_SOURCE_DIR
}
/cmake
${
CMAKE_MODULE_PATH
}
)
find_package
(
OpenMP REQUIRED
)
...
...
@@ -82,6 +82,8 @@ target_compile_options( ${CMAKE_PROJECT_NAME} PUBLIC "$<$<CONFIG:RELEASE>:${KITR
### BUILD UNIT TESTS ############################
include
(
CTest
)
set
(
CMAKE_MODULE_PATH
${
PROJECT_SOURCE_DIR
}
/ext/Catch2/contrib
${
CMAKE_MODULE_PATH
}
)
include
(
Catch
)
set
(
CATCH_INCLUDE_DIR
${
CMAKE_SOURCE_DIR
}
/ext/Catch2/single_include/catch2
)
add_compile_definitions
(
BUILD_TESTING
)
add_compile_definitions
(
TESTS_PATH=
"
${
CMAKE_SOURCE_DIR
}
/tests/"
)
...
...
@@ -99,6 +101,6 @@ if( CMAKE_COMPILER_IS_GNUCXX )
endif
()
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
)
catch_discover_tests
(
unit_tests
)
enable_testing
()
#################################################
code/src/icru.cpp
View file @
db7fac49
...
...
@@ -257,7 +257,6 @@ void ICRU::ELINIT( std::vector<double> IZ, std::vector<double> STF ) {
void
ICRU
::
DCSEL0
(
double
E
)
{
if
(
E
<
49.9999e0
||
E
>
1.0001e8
)
{
std
::
cout
<<
"Energy "
<<
E
<<
std
::
endl
;
ErrorMessages
::
Error
(
"Outside of supported energy range"
,
CURRENT_FUNCTION
);
}
double
EL
=
std
::
log
(
E
);
...
...
code/src/optimizers/mloptimizer.cpp
View file @
db7fac49
...
...
@@ -97,7 +97,7 @@ void MLOptimizer::initialize_python() {
PyRun_SimpleString
(
(
"import sys
\n
sys.path.append('"
+
pyPath
+
"')"
).
c_str
()
);
}
std
::
cout
<<
"Python working directory is: "
<<
pyPath
<<
"
\n
"
;
//
std::cout << "Python working directory is: " << pyPath << " \n";
init_numpy
();
}
...
...
code/src/problems/musclebonelung.cpp
View file @
db7fac49
...
...
@@ -21,12 +21,11 @@ VectorVector MuscleBoneLung::SetupIC() {
return
psi
;
}
std
::
vector
<
double
>
MuscleBoneLung
::
GetDensity
(
const
VectorVector
&
cellMidPoints
)
{
std
::
cout
<<
"Length of mesh "
<<
cellMidPoints
.
size
()
<<
std
::
endl
;
std
::
vector
<
double
>
densities
(
167
,
1.04
);
//muscle layer
std
::
vector
<
double
>
bone
(
167
,
1.85
);
std
::
vector
<
double
>
lung
(
665
,
0.3
);
//maybe this is just the lung tissue and after that there should be air?
densities
.
insert
(
densities
.
end
(),
bone
.
begin
(),
bone
.
end
());
densities
.
insert
(
densities
.
end
(),
lung
.
begin
(),
lung
.
end
());
std
::
cout
<<
"Length of densities "
<<
densities
.
size
()
<<
std
::
endl
;
return
densities
;
}
std
::
vector
<
double
>
MuscleBoneLung
::
GetDensity
(
const
VectorVector
&
cellMidPoints
)
{
std
::
vector
<
double
>
densities
(
167
,
1.04
);
// muscle layer
std
::
vector
<
double
>
bone
(
167
,
1.85
);
std
::
vector
<
double
>
lung
(
665
,
0.3
);
// maybe this is just the lung tissue and after that there should be air?
densities
.
insert
(
densities
.
end
(),
bone
.
begin
(),
bone
.
end
()
);
densities
.
insert
(
densities
.
end
(),
lung
.
begin
(),
lung
.
end
()
);
return
densities
;
}
code/tests/catch2_main.cpp
View file @
db7fac49
...
...
@@ -13,7 +13,6 @@ int main( int argc, char** argv ) {
const
int
result
=
Catch
::
Session
().
run
(
argc
,
argv
);
if
(
Py_IsInitialized
()
)
Py_Finalize
();
std
::
cout
<<
std
::
string
(
TESTS_PATH
)
+
"result"
<<
std
::
endl
;
std
::
filesystem
::
remove_all
(
std
::
string
(
TESTS_PATH
)
+
"result"
);
MPI_Finalize
();
...
...
code/tests/test_physics.cpp
View file @
db7fac49
...
...
@@ -50,7 +50,6 @@ TEST_CASE( "checking angular integral of scattering cross sections to be unity",
for( unsigned a = 1; a < angles.size(); ++a ) {
integral_sXS[e] += 0.5 * ( angles[a] - angles[a - 1] ) * ( sXS[e][a] + sXS[e][a - 1] );
}
std::cout << integral_sXS[e] << " " << tXS[e] << std::endl;
REQUIRE( std::fabs( integral_sXS[e] - tXS[e] ) / std::fabs( tXS[e] ) < 0.05 );
}
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment