IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 5f3d1e54 authored by ralfulrich's avatar ralfulrich
Browse files

added so far empty dummy class for NoMagneticField

parent ec899bf1
No related branches found
No related tags found
1 merge request!278Magnetic Tracking
...@@ -35,6 +35,7 @@ set ( ...@@ -35,6 +35,7 @@ set (
ShowerAxis.h ShowerAxis.h
IMagneticFieldModel.h IMagneticFieldModel.h
UniformMagneticField.h UniformMagneticField.h
NoMagneticField.h
IRefractiveIndexModel.h IRefractiveIndexModel.h
UniformRefractiveIndex.h UniformRefractiveIndex.h
IMediumPropertyModel.h IMediumPropertyModel.h
......
/*
* (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/environment/IMagneticFieldModel.h>
#include <corsika/geometry/RootCoordinateSystem.h>
namespace corsika::environment {
/**
* A uniform (constant) magnetic field.
*
* This class returns the same magnetic field vector
* for all evaluated locations.
*
*/
template <typename T>
class NoMagneticField : public T {
// a type-alias for a magnetic field vector
using MagneticFieldVector =
corsika::geometry::Vector<corsika::units::si::magnetic_flux_density_d>;
public:
/**
* Construct a NoMagneticField.
*
* This is initialized with a fixed magnetic field
* and returns this magnetic field at all locations.
*
* @param field The fixed magnetic field to return.
*/
template <typename... Args>
NoMagneticField(Args&&... args)
: T(std::forward<Args>(args)...)
{}
/**
* Evaluate the magnetic field at a given location.
*
* @param point The location to evaluate the field at.
* @returns The magnetic field vector.
*/
MagneticFieldVector GetMagneticField(
corsika::geometry::Point const&) const final override {
CoordinateSystem const& gCS =
RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
return MagneticFieldVector(gCS, {0_T, 0_T, 0_T});
}
}; // END: class MagneticField
} // namespace corsika::environment
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