IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 0283fb7b authored by Nikos Karastathis's avatar Nikos Karastathis :ocean: Committed by Ralf Ulrich
Browse files

add test stack files used only in unit tests

parent f008e62e
No related branches found
No related tags found
1 merge request!418No set up files new
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
#include <tests/common/TestStack.hpp>
#include <array>
#include <memory>
namespace corsika::test {
// ---------------------------------------
// this is the stack we use in C8 executables:
#ifdef WITH_HISTORY
#include <corsika/stack/history/HistoryStackExtension.hpp>
#include <corsika/stack/history/HistorySecondaryProducer.hpp>
/*
* the version with history
*/
using Stack = detaill::StackWithHistory;
#else // WITH_HISTORY
/*
* the version without history
*/
using Stack = detail::StackWithGeometry;
#endif
// the correct secondary stack view
using StackView = typename Stack::stack_view_type;
} // namespace corsika::test
\ No newline at end of file
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
#pragma once
#include <corsika/framework/stack/CombinedStack.hpp>
#include <corsika/stack/GeometryNodeStackExtension.hpp>
#include <corsika/stack/VectorStack.hpp>
#include <corsika/stack/WeightStackExtension.hpp>
#include <corsika/stack/history/HistorySecondaryProducer.hpp>
#include <corsika/stack/history/HistoryStackExtension.hpp>
#include <corsika/setup/SetupEnvironment.hpp>
namespace corsika {
// maybe use a similar copy of this file with defined templates for tests?
using DummyEnvironmentInterface = IMediumPropertyModel<IMagneticFieldModel<IMediumModel>>;
using DummyEnvironment = Environment<DummyEnvironmentInterface>;
namespace test::detail {
// ------------------------------------------
// add geometry node tracking data to stack:
// the GeometryNode stack needs to know the type of geometry-nodes from the
// environment:
template <typename TStackIter>
using SetupGeometryDataInterface =
typename node::MakeGeometryDataInterface<TStackIter, DummyEnvironment>::type;
// combine particle data stack with geometry information for tracking
template <typename TStackIter>
using StackWithGeometryInterface =
CombinedParticleInterface<VectorStack::pi_type, SetupGeometryDataInterface,
TStackIter>;
using StackWithGeometry =
CombinedStack<typename VectorStack::stack_data_type,
node::GeometryData<DummyEnvironment>, StackWithGeometryInterface,
DefaultSecondaryProducer>;
// ------------------------------------------
// Add [optional] history data to stack, too:
// combine dummy stack with geometry information for tracking
template <typename TStackIter>
using StackWithHistoryInterface =
CombinedParticleInterface<StackWithGeometry::pi_type,
history::HistoryEventDataInterface, TStackIter>;
using StackWithHistory =
CombinedStack<typename StackWithGeometry::stack_data_type,
history::HistoryEventData, StackWithHistoryInterface,
history::HistorySecondaryProducer>;
} // namespace test::detail
} // namespace corsika
\ No newline at end of file
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