Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/ControlSystem/Tags/FunctionsOfTimeInitialize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ void check_expiration_time_consistency(
/// \ingroup ControlSystemGroup
/// The FunctionsOfTime initialized from a DomainCreator, initial time, and
/// control system OptionHolders.
struct FunctionsOfTimeInitialize : domain::Tags::FunctionsOfTime,
db::SimpleTag {
using type = std::unordered_map<
std::string, std::unique_ptr<domain::FunctionsOfTime::FunctionOfTime>>;
struct FunctionsOfTimeInitialize : domain::Tags::FunctionsOfTime {
using base = domain::Tags::FunctionsOfTime;

static constexpr bool pass_metavariables = true;

Expand Down
14 changes: 1 addition & 13 deletions src/ControlSystem/Tags/SystemTags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,7 @@ struct WriteDataToDisk : db::SimpleTag {
static type create_from_options(const type& option) { return option; }
};

/// \ingroup DataBoxTagsGroup
/// \ingroup ControlSystemGroup
/// DataBox tag for writing the centers of the horizons to disk.
///
/// This is controlled by the `control_system::OptionTags::WriteDataToDisk`
/// option in the input file.
struct ObserveCenters : ::ah::Tags::ObserveCentersBase, db::SimpleTag {
using type = bool;
using option_tags = tmpl::list<OptionTags::WriteDataToDisk>;

static constexpr bool pass_metavariables = false;
static type create_from_options(const type& option) { return option; }
};
using ObserveCenters = ah::Tags::ObserveCenters;

/// \ingroup DataBoxTagsGroup
/// \ingroup ControlSystemGroup
Expand Down
12 changes: 8 additions & 4 deletions src/DataStructures/DataBox/DataBox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,8 +870,9 @@ auto DataBox<tmpl::list<Tags...>>::compute_tag_graphs() -> TagGraphs {
});

// Set mutation function
tmpl::for_each<mutable_item_tags>([&result](auto tag_v) {
using tag = tmpl::type_from<decltype(tag_v)>;
tmpl::for_each<mutable_item_tags>([&result]<typename Tag>(
tmpl::type_<Tag> /*meta*/) {
using tag = detail::get_base<Tag>;
const std::string tag_name = pretty_type::get_name<tag>();
if (result.tag_mutate_functions.find(tag_name) ==
result.tag_mutate_functions.end()) {
Expand Down Expand Up @@ -988,7 +989,8 @@ void DataBox<tmpl::list<Tags...>>::reset_compute_items(
template <typename... Tags>
template <typename MutatedTag>
void DataBox<tmpl::list<Tags...>>::reset_compute_items_after_mutate() {
static const std::string mutated_tag = pretty_type::get_name<MutatedTag>();
using tag = detail::get_base<MutatedTag>;
static const std::string mutated_tag = pretty_type::get_name<tag>();
if (tag_graphs_.tags_and_dependents.find(mutated_tag) !=
tag_graphs_.tags_and_dependents.end()) {
reset_compute_items(mutated_tag);
Expand Down Expand Up @@ -1069,7 +1071,9 @@ template <typename... Tags>
template <typename Tag>
void* DataBox<tmpl::list<Tags...>>::get_item_as_void_pointer_for_mutate() {
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
return reinterpret_cast<void*>(&this->template get_item<Tag>());
return reinterpret_cast<void*>(
&this->template get_item<
detail::first_matching_tag<tmpl::list<Tags...>, Tag>>());
}

template <typename... Tags>
Expand Down
5 changes: 2 additions & 3 deletions src/Domain/Creators/Tags/FunctionsOfTime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ struct FunctionOfTime;

namespace domain::Tags {
/// \brief The FunctionsOfTime initialized from a DomainCreator
struct FunctionsOfTimeInitialize : FunctionsOfTime, db::SimpleTag {
using type = std::unordered_map<
std::string, std::unique_ptr<domain::FunctionsOfTime::FunctionOfTime>>;
struct FunctionsOfTimeInitialize : FunctionsOfTime {
using base = FunctionsOfTime;

static constexpr bool pass_metavariables = true;

Expand Down
15 changes: 14 additions & 1 deletion src/Domain/FunctionsOfTime/Tags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@

#pragma once

#include <memory>
#include <string>
#include <unordered_map>

#include "DataStructures/DataBox/Tag.hpp"

/// \cond
namespace domain::FunctionsOfTime {
struct FunctionOfTime;
} // namespace domain::FunctionsOfTime
/// \endcond

namespace domain::Tags {
/// Tag to retrieve the FunctionsOfTime from the GlobalCache.
struct FunctionsOfTime : db::BaseTag {};
struct FunctionsOfTime : db::SimpleTag {
using type = std::unordered_map<
std::string, std::unique_ptr<domain::FunctionsOfTime::FunctionOfTime>>;
};
} // namespace domain::Tags
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct InitializeCharacteristicEvolutionScri {
db::get<InitializationTags::ScriInterpolationOrder>(*box);
const size_t vector_size =
Spectral::Swsh::number_of_swsh_collocation_points(
db::get<Spectral::Swsh::Tags::LMaxBase>(*box));
db::get<Spectral::Swsh::Tags::LMax>(*box));
// silence compiler warnings when pack is empty
(void)vector_size;
if constexpr (sizeof...(TagPack) > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ struct InitializeCharacteristicEvolutionVariables {

template <typename TagList>
static void initialize_impl(const gsl::not_null<db::DataBox<TagList>*> box) {
const size_t l_max = db::get<Spectral::Swsh::Tags::LMaxBase>(*box);
const size_t l_max = db::get<Spectral::Swsh::Tags::LMax>(*box);
const size_t number_of_radial_points =
db::get<Spectral::Swsh::Tags::NumberOfRadialPointsBase>(*box);
db::get<Spectral::Swsh::Tags::NumberOfRadialPoints>(*box);
const size_t boundary_size =
Spectral::Swsh::number_of_swsh_collocation_points(l_max);
const size_t volume_size = boundary_size * number_of_radial_points;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ struct InitializeKleinGordonVariables {
const Parallel::GlobalCache<Metavariables>& /*cache*/,
const ArrayIndex& /*array_index*/, const ActionList /*meta*/,
const ParallelComponent* const /*meta*/) {
const size_t l_max = db::get<Spectral::Swsh::Tags::LMaxBase>(box);
const size_t l_max = db::get<Spectral::Swsh::Tags::LMax>(box);
const size_t number_of_radial_points =
db::get<Spectral::Swsh::Tags::NumberOfRadialPointsBase>(box);
db::get<Spectral::Swsh::Tags::NumberOfRadialPoints>(box);
const size_t boundary_size =
Spectral::Swsh::number_of_swsh_collocation_points(l_max);
const size_t volume_size = boundary_size * number_of_radial_points;
Expand Down
7 changes: 0 additions & 7 deletions src/Evolution/Systems/Cce/GaugeTransformBoundaryData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@
#include "Utilities/TMPL.hpp"

namespace Cce {

namespace Tags {
/// \cond
struct LMax;
/// \endcond
} // namespace Tags

/// The set of tags that should be calculated before the initial data is
/// computed on the first hypersurface.
using gauge_adjustments_setup_tags =
Expand Down
7 changes: 0 additions & 7 deletions src/Evolution/Systems/Cce/Initialize/InitializeJ.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ class ComplexDataVector;
/// \endcond

namespace Cce {
namespace Tags {
/// \cond
struct LMax;
struct NumberOfRadialPoints;
/// \endcond
} // namespace Tags

/// Contains utilities and \ref DataBoxGroup mutators for generating data for
/// \f$J\f$ on the initial CCE hypersurface.
namespace InitializeJ {
Expand Down
4 changes: 0 additions & 4 deletions src/Evolution/Systems/Cce/LinearOperators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ void logical_partial_directional_derivative_of_complex(
const Mesh<3>& mesh, size_t dimension_to_differentiate);

namespace Tags {
/// \cond
struct LMax;
/// \endcond

/*!
* \brief Compute tag for a manually-handled partial y derivative in the volume.
*
Expand Down
3 changes: 0 additions & 3 deletions src/Evolution/Systems/Cce/NewmanPenrose.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ class ComplexDataVector;
namespace Cce {

/// \cond
namespace Tags {
struct LMax;
} // namespace Tags
template <typename Tag>
struct VolumeWeyl;
/// \endcond
Expand Down
80 changes: 25 additions & 55 deletions src/Evolution/Systems/Cce/OptionTags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ struct BondiSachsOutputFilePrefix {
using group = Cce;
};

struct LMax {
using type = size_t;
static constexpr Options::String help{
"Maximum l value for spin-weighted spherical harmonics"};
using group = Cce;
};

struct FilterLMax {
using type = size_t;
static constexpr Options::String help{"l mode cutoff for angular filtering"};
Expand All @@ -99,13 +92,6 @@ struct ObservationLMax {
using group = Cce;
};

struct NumberOfRadialPoints {
using type = size_t;
static constexpr Options::String help{
"Number of radial grid points in the spherical domain"};
using group = Cce;
};

struct ExtractionRadius {
using type = double;
static constexpr Options::String help{"Extraction radius of the CCE system."};
Expand Down Expand Up @@ -233,11 +219,12 @@ struct ScriOutputDensity : db::SimpleTag {
} // namespace InitializationTags

namespace Tags {
struct ExtractionRadius : db::BaseTag {};

struct ExtractionRadiusSimple : ExtractionRadius, db::SimpleTag {
static std::string name() { return "ExtractionRadius"; }
struct ExtractionRadius : db::SimpleTag {
using type = double;
};

struct ExtractionRadiusSimple : ExtractionRadius {
using base = ExtractionRadius;
using option_tags = tmpl::list<OptionTags::ExtractionRadius>;

static constexpr bool pass_metavariables = false;
Expand All @@ -246,9 +233,8 @@ struct ExtractionRadiusSimple : ExtractionRadius, db::SimpleTag {
}
};

struct ExtractionRadiusFromH5 : ExtractionRadius, db::SimpleTag {
static std::string name() { return "ExtractionRadius"; }
using type = double;
struct ExtractionRadiusFromH5 : ExtractionRadius {
using base = ExtractionRadius;
using option_tags = tmpl::list<OptionTags::BoundaryDataFilename,
OptionTags::StandaloneExtractionRadius>;

Expand Down Expand Up @@ -296,8 +282,9 @@ struct H5WorldtubeBoundaryDataManager : db::SimpleTag {
using type = std::unique_ptr<WorldtubeDataManager<
Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>>>;
using option_tags =
tmpl::list<OptionTags::LMax, OptionTags::BoundaryDataFilename,
OptionTags::H5LookaheadTimes, OptionTags::H5Interpolator,
tmpl::list<Spectral::Swsh::OptionTags::LMax,
OptionTags::BoundaryDataFilename, OptionTags::H5LookaheadTimes,
OptionTags::H5Interpolator,
OptionTags::StandaloneExtractionRadius>;

static constexpr bool pass_metavariables = false;
Expand Down Expand Up @@ -335,7 +322,8 @@ struct KleinGordonH5WorldtubeBoundaryDataManager : db::SimpleTag {
using type = std::unique_ptr<
WorldtubeDataManager<Tags::klein_gordon_worldtube_boundary_tags>>;
using option_tags =
tmpl::list<OptionTags::LMax, OptionTags::KleinGordonBoundaryDataFilename,
tmpl::list<Spectral::Swsh::OptionTags::LMax,
OptionTags::KleinGordonBoundaryDataFilename,
OptionTags::H5LookaheadTimes, OptionTags::H5Interpolator,
OptionTags::StandaloneExtractionRadius>;

Expand All @@ -352,25 +340,6 @@ struct KleinGordonH5WorldtubeBoundaryDataManager : db::SimpleTag {
}
};

struct LMax : db::SimpleTag, Spectral::Swsh::Tags::LMaxBase {
using type = size_t;
using option_tags = tmpl::list<OptionTags::LMax>;

static constexpr bool pass_metavariables = false;
static size_t create_from_options(const size_t l_max) { return l_max; }
};

struct NumberOfRadialPoints : db::SimpleTag,
Spectral::Swsh::Tags::NumberOfRadialPointsBase {
using type = size_t;
using option_tags = tmpl::list<OptionTags::NumberOfRadialPoints>;

static constexpr bool pass_metavariables = false;
static size_t create_from_options(const size_t number_of_radial_points) {
return number_of_radial_points;
}
};

struct ObservationLMax : db::SimpleTag {
using type = size_t;
using option_tags = tmpl::list<OptionTags::ObservationLMax>;
Expand Down Expand Up @@ -418,8 +387,8 @@ struct RadialFilterHalfPower : db::SimpleTag {
/// `OptionTags::StartTime` is set to "Auto"), this will find the start time
/// from the provided H5 file. If `OptionTags::StartTime` takes any other value,
/// it will be used directly as the start time for the CCE evolution instead.
struct StartTimeFromFile : Tags::StartTime, db::SimpleTag {
using type = double;
struct StartTimeFromFile : Tags::StartTime {
using base = Tags::StartTime;
using option_tags =
tmpl::list<OptionTags::StartTime, OptionTags::BoundaryDataFilename,
OptionTags::StandaloneExtractionRadius>;
Expand All @@ -441,8 +410,8 @@ struct StartTimeFromFile : Tags::StartTime, db::SimpleTag {

/// \brief Represents the start time of a bounded CCE evolution that must be
/// supplied in the input file (for e.g. analytic tests).
struct SpecifiedStartTime : Tags::StartTime, db::SimpleTag {
using type = double;
struct SpecifiedStartTime : Tags::StartTime {
using base = Tags::StartTime;
using option_tags = tmpl::list<OptionTags::StartTime>;

static constexpr bool pass_metavariables = false;
Expand All @@ -463,8 +432,8 @@ struct SpecifiedStartTime : Tags::StartTime, db::SimpleTag {
/// `OptionTags::EndTime` is set to "Auto"), this will find the end time
/// from the provided H5 file. If `OptionTags::EndTime` takes any other value,
/// it will be used directly as the final time for the CCE evolution instead.
struct EndTimeFromFile : Tags::EndTime, db::SimpleTag {
using type = double;
struct EndTimeFromFile : Tags::EndTime {
using base = Tags::EndTime;
using option_tags =
tmpl::list<OptionTags::EndTime, OptionTags::BoundaryDataFilename,
OptionTags::StandaloneExtractionRadius>;
Expand All @@ -485,8 +454,8 @@ struct EndTimeFromFile : Tags::EndTime, db::SimpleTag {

/// \brief Represents the final time of a CCE evolution that should just proceed
/// until it receives no more boundary data and becomes quiescent.
struct NoEndTime : Tags::EndTime, db::SimpleTag {
using type = double;
struct NoEndTime : Tags::EndTime {
using base = Tags::EndTime;
using option_tags = tmpl::list<>;

static constexpr bool pass_metavariables = false;
Expand All @@ -497,8 +466,8 @@ struct NoEndTime : Tags::EndTime, db::SimpleTag {

/// \brief Represents the final time of a bounded CCE evolution that must be
/// supplied in the input file (for e.g. analytic tests).
struct SpecifiedEndTime : Tags::EndTime, db::SimpleTag {
using type = double;
struct SpecifiedEndTime : Tags::EndTime {
using base = Tags::EndTime;
using option_tags = tmpl::list<OptionTags::EndTime>;

static constexpr bool pass_metavariables = false;
Expand Down Expand Up @@ -560,8 +529,9 @@ struct AnalyticInitializeJ : db::SimpleTag, InitializeJBase {
/// A tag that constructs a `AnalyticBoundaryDataManager` from options
struct AnalyticBoundaryDataManager : db::SimpleTag {
using type = ::Cce::AnalyticBoundaryDataManager;
using option_tags = tmpl::list<OptionTags::ExtractionRadius, OptionTags::LMax,
OptionTags::AnalyticSolution>;
using option_tags =
tmpl::list<OptionTags::ExtractionRadius, Spectral::Swsh::OptionTags::LMax,
OptionTags::AnalyticSolution>;

static constexpr bool pass_metavariables = false;
static Cce::AnalyticBoundaryDataManager create_from_options(
Expand Down
11 changes: 9 additions & 2 deletions src/Evolution/Systems/Cce/Tags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,16 @@ struct BondiR : db::SimpleTag {
static std::string name() { return "R"; }
};

struct EndTime : db::BaseTag {};
struct EndTime : db::SimpleTag {
using type = double;
};

struct StartTime : db::SimpleTag {
using type = double;
};

struct StartTime : db::BaseTag {};
using LMax = Spectral::Swsh::Tags::LMax;
using NumberOfRadialPoints = Spectral::Swsh::Tags::NumberOfRadialPoints;

/// The (adapted) Newman-Penrose spin coefficient $\alpha^{SW}$. See
/// documentation of `newman_penrose_alpha()` for definition.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,8 @@ struct AngularDerivativesImpl<tmpl::list<DerivativeTags...>,
using return_tags =
tmpl::list<DerivativeTags..., Tags::SwshTransform<DerivativeTags>...,
Tags::SwshTransform<UniqueDifferentiatedFromTags>...>;
using argument_tags =
tmpl::list<UniqueDifferentiatedFromTags..., Tags::LMaxBase,
Tags::NumberOfRadialPointsBase>;
using argument_tags = tmpl::list<UniqueDifferentiatedFromTags..., Tags::LMax,
Tags::NumberOfRadialPoints>;

static void apply(
const gsl::not_null<typename DerivativeTags::type*>... derivative_scalars,
Expand Down
Loading
Loading