-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Define geometry traits * Explicitly default geoparams class
- Loading branch information
Showing
10 changed files
with
216 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//----------------------------------*-C++-*----------------------------------// | ||
// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers. | ||
// See the top-level COPYRIGHT file for details. | ||
// SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
//---------------------------------------------------------------------------// | ||
//! \file geocel/GeoTraits.hh | ||
//---------------------------------------------------------------------------// | ||
#pragma once | ||
|
||
#include <type_traits> | ||
|
||
#include "corecel/Types.hh" | ||
|
||
namespace celeritas | ||
{ | ||
//---------------------------------------------------------------------------// | ||
class GeoParamsInterface; | ||
|
||
//---------------------------------------------------------------------------// | ||
/*! | ||
* Traits class for defining params and device data. | ||
* \tparam G Geometry params class, e.g. VecgeomParams | ||
* | ||
* This traits class \em must be defined for all geometry types. The generic | ||
* instance here is provided as a synopsis and to improve error checking. | ||
*/ | ||
template<class G> | ||
struct GeoTraits | ||
{ | ||
static_assert(std::is_base_of_v<GeoParamsInterface, G>, | ||
"G must be a geometry params, not params data"); | ||
static_assert(std::is_void_v<G>, "Geo traits must be specialized"); | ||
|
||
//! Params data used during runtime | ||
template<Ownership W, MemSpace M> | ||
using ParamsData = void; | ||
|
||
//! State data used during runtime | ||
template<Ownership W, MemSpace M> | ||
using StateData = void; | ||
|
||
//! Geometry track view | ||
using TrackView = void; | ||
|
||
//! Descriptive name for the geometry | ||
static inline char const* name = nullptr; | ||
|
||
//! TO BE REMOVED: "native" file extension for this geometry | ||
static inline char const* ext = nullptr; | ||
}; | ||
|
||
//---------------------------------------------------------------------------// | ||
} // namespace celeritas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
//----------------------------------*-C++-*----------------------------------// | ||
// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers. | ||
// See the top-level COPYRIGHT file for details. | ||
// SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
//---------------------------------------------------------------------------// | ||
//! \file geocel/g4/GeantGeoTraits.hh | ||
//---------------------------------------------------------------------------// | ||
#pragma once | ||
|
||
#include "geocel/GeoTraits.hh" | ||
|
||
namespace celeritas | ||
{ | ||
//---------------------------------------------------------------------------// | ||
class GeantGeoParams; | ||
class GeantGeoTrackView; | ||
template<Ownership W, MemSpace M> | ||
struct GeantGeoParamsData; | ||
template<Ownership W, MemSpace M> | ||
struct GeantGeoStateData; | ||
|
||
//---------------------------------------------------------------------------// | ||
/*! | ||
* Traits specialization for Geant4 geometry. | ||
*/ | ||
template<> | ||
struct GeoTraits<GeantGeoParams> | ||
{ | ||
//! Params data used during runtime | ||
template<Ownership W, MemSpace M> | ||
using ParamsData = GeantGeoParamsData<W, M>; | ||
|
||
//! State data used during runtime | ||
template<Ownership W, MemSpace M> | ||
using StateData = GeantGeoStateData<W, M>; | ||
|
||
//! Geometry track view | ||
using TrackView = GeantGeoTrackView; | ||
|
||
//! Descriptive name for the geometry | ||
static inline char const* name = "Geant4"; | ||
|
||
//! TO BE REMOVED: "native" file extension for this geometry | ||
static inline char const* ext = ".gdml"; | ||
}; | ||
|
||
//---------------------------------------------------------------------------// | ||
} // namespace celeritas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
//----------------------------------*-C++-*----------------------------------// | ||
// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers. | ||
// See the top-level COPYRIGHT file for details. | ||
// SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
//---------------------------------------------------------------------------// | ||
//! \file geocel/vg/VecgeomGeoTraits.hh | ||
//---------------------------------------------------------------------------// | ||
#pragma once | ||
|
||
#include "geocel/GeoTraits.hh" | ||
|
||
namespace celeritas | ||
{ | ||
//---------------------------------------------------------------------------// | ||
class VecgeomParams; | ||
class VecgeomTrackView; | ||
template<Ownership W, MemSpace M> | ||
struct VecgeomParamsData; | ||
template<Ownership W, MemSpace M> | ||
struct VecgeomStateData; | ||
|
||
//---------------------------------------------------------------------------// | ||
/*! | ||
* Traits specialization for VecGeom geometry. | ||
*/ | ||
template<> | ||
struct GeoTraits<VecgeomParams> | ||
{ | ||
//! Params data used during runtime | ||
template<Ownership W, MemSpace M> | ||
using ParamsData = VecgeomParamsData<W, M>; | ||
|
||
//! State data used during runtime | ||
template<Ownership W, MemSpace M> | ||
using StateData = VecgeomStateData<W, M>; | ||
|
||
//! Geometry track view | ||
using TrackView = VecgeomTrackView; | ||
|
||
//! Descriptive name for the geometry | ||
static inline char const* name = "VecGeom"; | ||
|
||
//! TO BE REMOVED: "native" file extension for this geometry | ||
static inline char const* ext = ".gdml"; | ||
}; | ||
|
||
//---------------------------------------------------------------------------// | ||
} // namespace celeritas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
//----------------------------------*-C++-*----------------------------------// | ||
// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers. | ||
// See the top-level COPYRIGHT file for details. | ||
// SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
//---------------------------------------------------------------------------// | ||
//! \file orange/OrangeGeoTraits.hh | ||
//---------------------------------------------------------------------------// | ||
#pragma once | ||
|
||
#include "geocel/GeoTraits.hh" | ||
|
||
namespace celeritas | ||
{ | ||
//---------------------------------------------------------------------------// | ||
class OrangeParams; | ||
class OrangeTrackView; | ||
template<Ownership W, MemSpace M> | ||
struct OrangeParamsData; | ||
template<Ownership W, MemSpace M> | ||
struct OrangeStateData; | ||
|
||
//---------------------------------------------------------------------------// | ||
/*! | ||
* Traits specialization for ORANGE geometry. | ||
*/ | ||
template<> | ||
struct GeoTraits<OrangeParams> | ||
{ | ||
//! Params data used during runtime | ||
template<Ownership W, MemSpace M> | ||
using ParamsData = OrangeParamsData<W, M>; | ||
|
||
//! State data used during runtime | ||
template<Ownership W, MemSpace M> | ||
using StateData = OrangeStateData<W, M>; | ||
|
||
//! Geometry track view | ||
using TrackView = OrangeTrackView; | ||
|
||
//! Descriptive name for the geometry | ||
static inline char const* name = "ORANGE"; | ||
|
||
//! TO BE REMOVED: "native" file extension for this geometry | ||
static inline char const* ext = ".org.json"; | ||
}; | ||
|
||
//---------------------------------------------------------------------------// | ||
} // namespace celeritas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters