IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 7cfacb9c authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan:
Browse files

Merge branch 'master' of gitlab.ikp.kit.edu:AirShowerPhysics/corsika

parents ec12dcaa 103e35ce
No related branches found
No related tags found
No related merge requests found
Showing
with 143 additions and 17 deletions
......@@ -11,7 +11,7 @@ class Process1 : public BaseProcess<Process1> {
public:
Process1() {}
template <typename D, typename T, typename S>
EProcessReturn DoContinuous(D& d, T& t, S& s) const {
EProcessReturn DoContinuous(D& d, T&, S&) const {
for (int i = 0; i < 10; ++i) d.p[i] += 1;
return EProcessReturn::eOk;
}
......@@ -22,7 +22,7 @@ public:
Process2() {}
template <typename D, typename T, typename S>
inline EProcessReturn DoContinuous(D& d, T& t, S& s) const {
inline EProcessReturn DoContinuous(D&, T&, S&) const {
// for (int i=0; i<10; ++i) d.p[i] *= 2;
return EProcessReturn::eOk;
}
......@@ -34,7 +34,7 @@ public:
Process3() {}
template <typename D, typename T, typename S>
inline EProcessReturn DoContinuous(D& d, T& t, S& s) const {
inline EProcessReturn DoContinuous(D& /*d*/, T& /*t*/, S& /*s*/) const {
// for (int i=0; i<10; ++i) d.p[i] += fV;
return EProcessReturn::eOk;
}
......@@ -48,7 +48,7 @@ public:
// Process4(const int v) : fV(v) {}
Process4() {}
template <typename D, typename T, typename S>
inline EProcessReturn DoContinuous(D& d, T& t, S& s) const {
inline EProcessReturn DoContinuous(D& /*d*/, T& /*t*/, S& /*s*/) const {
// for (int i=0; i<10; ++i) d.p[i] /= fV;
return EProcessReturn::eOk;
}
......
#include <corsika/cascade/Cascade.h>
#include <corsika/geometry/LineTrajectory.h>
#include <corsika/process/ProcessSequence.h>
#include <corsika/process/stack_inspector/StackInspector.h>
#include <corsika/stack/super_stupid/SuperStupidStack.h>
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one
......
......@@ -32,7 +32,7 @@ namespace corsika::logging {
inline void Add(const std::string& s) { fBuffer << s; }
private:
int fSize;
unsigned int fSize;
std::ostringstream fBuffer;
};
......
......@@ -10,7 +10,7 @@ namespace corsika::logging {
class MessageOff {
protected:
template <typename First, typename... Strings>
std::string Message(const First& arg, const Strings&... rest) {
std::string Message(const First&, const Strings&...) {
return "";
}
};
......
......@@ -16,7 +16,7 @@ public:
Process1() {}
void Init() {} // cout << "Process1::Init" << endl; }
template <typename D, typename T, typename S>
inline EProcessReturn DoContinuous(D& d, T& t, S& s) const {
inline EProcessReturn DoContinuous(D& d, T&, S&) const {
for (int i = 0; i < 10; ++i) d.p[i] += 1 + i;
return EProcessReturn::eOk;
}
......@@ -27,7 +27,7 @@ public:
Process2() {}
void Init() {} // cout << "Process2::Init" << endl; }
template <typename D, typename T, typename S>
inline EProcessReturn DoContinuous(D& d, T& t, S& s) const {
inline EProcessReturn DoContinuous(D& d, T&, S&) const {
for (int i = 0; i < 10; ++i) d.p[i] *= 0.7;
return EProcessReturn::eOk;
}
......@@ -38,7 +38,7 @@ public:
Process3() {}
void Init() {} // cout << "Process3::Init" << endl; }
template <typename D, typename T, typename S>
inline EProcessReturn DoContinuous(D& d, T& t, S& s) const {
inline EProcessReturn DoContinuous(D& d, T&, S&) const {
for (int i = 0; i < 10; ++i) d.p[i] += 0.933;
return EProcessReturn::eOk;
}
......@@ -49,7 +49,7 @@ public:
Process4() {}
void Init() {} // cout << "Process4::Init" << endl; }
template <typename D, typename T, typename S>
inline EProcessReturn DoContinuous(D& d, T& t, S& s) const {
inline EProcessReturn DoContinuous(D& d, T&, S&) const {
for (int i = 0; i < 10; ++i) d.p[i] /= 1.2;
return EProcessReturn::eOk;
}
......
......@@ -10,7 +10,8 @@ void corsika::random::RNGManager::RegisterRandomStream(std::string const& pStrea
rngs[pStreamName] = std::move(rng);
}
corsika::random::RNG& corsika::random::RNGManager::GetRandomStream(std::string const& pStreamName) {
corsika::random::RNG& corsika::random::RNGManager::GetRandomStream(
std::string const& pStreamName) {
return rngs.at(pStreamName);
}
......@@ -22,3 +23,9 @@ std::stringstream corsika::random::RNGManager::dumpState() const {
return buffer;
}
/*
void corsika::random::RNGManager::SetSeedSeq(std::string const& pStreamName,
std::seed_seq const& pSeedSeq) {
seeds[pStreamName] = pSeedSeq;
}
*/
......@@ -38,7 +38,12 @@ namespace corsika::random {
* into a std::stringstream.
*/
std::stringstream dumpState() const;
/**
* set seed_seq of \a pStreamName to \a pSeedSeq
*/
// void SetSeedSeq(std::string const& pStreamName, std::seed_seq& const pSeedSeq);
};
} // namespace Random
} // namespace corsika::random
#endif
......@@ -21,6 +21,8 @@ SCENARIO("random-number streams can be registered and retrieved") {
THEN("an unknown sequence cannot be retrieved") {
REQUIRE_THROWS(rngManager.GetRandomStream("stream_UNKNOWN"));
}
// seeding not covered yet
}
}
}
......@@ -56,18 +56,18 @@ namespace corsika::stack {
public:
// StackIterator() : fData(0), fIndex(0) { }
StackIteratorInterface(StackType& data, const int index)
: fData(&data)
, fIndex(index) {}
: fIndex(index)
, fData(&data) {}
private:
StackIteratorInterface(const StackIteratorInterface& mit)
: fData(mit.fData)
, fIndex(mit.fIndex) {}
: fIndex(mit.fIndex)
, fData(mit.fData) {}
public:
StackIteratorInterface& operator=(const StackIteratorInterface& mit) {
fData = mit.fData;
fIndex = mit.fIndex;
fData = mit.fData;
return *this;
}
......
......@@ -20,6 +20,7 @@ TEST_CASE("PhysicalUnits", "[Units]") {
REQUIRE(E1 == 10_GeV);
LengthType l1 = 10_nm;
l1 = l1;
LengthType arr0[5];
arr0[0] = 5_m;
......
add_subdirectory (NullModel)
add_subdirectory (Sibyll)
add_subdirectory (StackInspector)
set (
MODEL_SOURCES
StackInspector.cc
)
set (
MODEL_HEADERS
StackInspector.h
)
set (
MODEL_NAMESPACE
corsika/process/stack_inspector
)
add_library (ProcessStackInspector STATIC ${MODEL_SOURCES})
CORSIKA_COPY_HEADERS_TO_NAMESPACE (ProcessStackInspector ${MODEL_NAMESPACE} ${MODEL_HEADERS})
set_target_properties (
ProcessStackInspector
PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 1
# PUBLIC_HEADER "${MODEL_HEADERS}"
)
# target dependencies on other libraries (also the header onlys)
target_link_libraries (
ProcessStackInspector
CORSIKAunits
)
target_include_directories (
ProcessStackInspector
INTERFACE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include/include>
)
install (
TARGETS ProcessStackInspector
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
# PUBLIC_HEADER DESTINATION include/${MODEL_NAMESPACE}
)
# --------------------
# code unit testing
add_executable (testStackInspector testStackInspector.cc)
target_link_libraries (
testStackInspector
CORSIKAgeometry
CORSIKAunits
CORSIKAthirdparty # for catch2
)
add_test (NAME testStackInspector COMMAND testStackInspector)
#include <corsika/process/stack_inspector/StackInspector.h>
using namespace corsika::process::stack_inspector;
StackInspector::StackInspector() {}
StackInspector::~StackInspector() {}
void StackInspector::init() {}
void StackInspector::run() {}
double StackInspector::GetStepLength() { return 0; }
#ifndef _Physics_StackInspector_StackInspector_h_
#define _Physics_StackInspector_StackInspector_h_
namespace corsika::process {
namespace stack_inspector {
class StackInspector {
public:
StackInspector();
~StackInspector();
void init();
void run();
double GetStepLength();
};
} // namespace stack_inspector
} // namespace corsika::process
#endif
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one
// cpp file
#include <catch2/catch.hpp>
#include <corsika/units/PhysicalUnits.h>
TEST_CASE("NullModel", "[processes]") {
SECTION("bla") {}
SECTION("blubb") {}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment