IAP GITLAB

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • AirShowerPhysics/corsika
  • rulrich/corsika
  • AAAlvesJr/corsika
  • Andre/corsika
  • arrabito/corsika
  • Nikos/corsika
  • olheiser73/corsika
  • AirShowerPhysics/papers/corsika
  • pranav/corsika
9 results
Show changes
Showing
with 129 additions and 103 deletions
/* /*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
#include <deque> #include <deque>
#include <corsika/framework/geometry/Point.hpp>
namespace corsika { namespace corsika {
Path::Path(Point const& point) { points_.push_front(point); } inline Path::Path(Point const& point) { points_.push_front(point); }
Path::Path(std::deque<Point> const& points) inline Path::Path(std::deque<Point> const& points)
: points_(points) { : points_(points) {
int dequesize_ = points.size(); int dequesize_ = points.size();
if (dequesize_ == 0 || dequesize_ == 1) { if (dequesize_ == 0 || dequesize_ == 1) {
...@@ -51,15 +49,21 @@ namespace corsika { ...@@ -51,15 +49,21 @@ namespace corsika {
inline LengthType Path::getLength() const { return length_; } inline LengthType Path::getLength() const { return length_; }
inline Point Path::getStart() const { return points_.front(); } inline Point const& Path::getStart() const { return points_.front(); }
inline Point Path::getEnd() const { return points_.back(); } inline Point const& Path::getEnd() const { return points_.back(); }
inline Point Path::getPoint(std::size_t const index) const { return points_.at(index); } inline Point const& Path::getPoint(std::size_t const index) const {
return points_.at(index);
}
inline Path::const_iterator Path::begin() const { return points_.cbegin(); }
inline Path::const_iterator Path::end() const { return points_.cend(); }
inline auto Path::begin() { return points_.begin(); } inline Path::iterator Path::begin() { return points_.begin(); }
inline auto Path::end() { return points_.end(); } inline Path::iterator Path::end() { return points_.end(); }
inline int Path::getNSegments() const { return points_.size() - 1; } inline int Path::getNSegments() const { return points_.size() - 1; }
......
/* /*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
......
/* /*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
...@@ -67,11 +66,15 @@ namespace corsika { ...@@ -67,11 +66,15 @@ namespace corsika {
return Point(cs, getCoordinates() + pVec.getComponents(cs)); return Point(cs, getCoordinates() + pVec.getComponents(cs));
} }
inline Point Point::operator-(Vector<length_d> const& pVec) const {
CoordinateSystemPtr const& cs = BaseVector<length_d>::getCoordinateSystem();
return Point(cs, getCoordinates() - pVec.getComponents(cs));
}
inline Vector<length_d> Point::operator-(Point const& pB) const { inline Vector<length_d> Point::operator-(Point const& pB) const {
CoordinateSystemPtr const& cs = BaseVector<length_d>::getCoordinateSystem(); CoordinateSystemPtr const& cs = BaseVector<length_d>::getCoordinateSystem();
return Vector<length_d>(cs, getCoordinates() - pB.getCoordinates(cs)); return Vector<length_d>(cs, getCoordinates() - pB.getCoordinates(cs));
} }
inline std::ostream& operator<<(std::ostream& os, corsika::Point const& p) { inline std::ostream& operator<<(std::ostream& os, corsika::Point const& p) {
auto const& qv = p.getCoordinates(); auto const& qv = p.getCoordinates();
os << qv << " (ref:" << fmt::ptr(p.getCoordinateSystem()) << ")"; os << qv << " (ref:" << fmt::ptr(p.getCoordinateSystem()) << ")";
......
/* /*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
......
/*
* (c) Copyright 2023 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
namespace corsika {
inline SeparationPlane::SeparationPlane(Plane const& plane)
: plane_(plane) {}
inline bool SeparationPlane::contains(Point const& p) const {
return !plane_.isAbove(p);
}
inline std::string SeparationPlane::asString() const { return plane_.asString(); }
} // namespace corsika
\ No newline at end of file
/* /*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
...@@ -25,4 +24,14 @@ namespace corsika { ...@@ -25,4 +24,14 @@ namespace corsika {
inline void Sphere::setRadius(LengthType const r) { radius_ = r; } inline void Sphere::setRadius(LengthType const r) { radius_ = r; }
inline CoordinateSystemPtr const Sphere::getCoordinateSystem() const {
return center_.getCoordinateSystem();
}
inline std::string Sphere::asString() const {
std::ostringstream txt;
txt << "center=" << center_ << ", radius=" << radius_;
return txt.str();
}
} // namespace corsika } // namespace corsika
/* /*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
......
/* /*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
......
/* /*
* (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
......
/* /*
* (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
......
/* /*
* (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
......
/* /*
* (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
......
/* /*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
......
/* /*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
......
/* /*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
......
/* /*
* (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu * (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu
* *
* This software is distributed under the terms of the GNU General Public * This software is distributed under the terms of the 3-clause BSD license.
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of * See file LICENSE for a full version of the license.
* the license.
*/ */
#pragma once #pragma once
......