Skip to content

Commit

Permalink
WIP make Tensor compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsvu committed Nov 13, 2024
1 parent 2565c3d commit 9638b6a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
5 changes: 1 addition & 4 deletions src/DataStructures/Tensor/Expressions/DataTypeSupport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ constexpr bool is_supported_number_datatype_v =
///
/// \tparam X the `Tensor` data type
template <typename X>
struct is_supported_tensor_datatype
: std::disjunction<
std::is_same<X, double>, std::is_same<X, std::complex<double>>,
std::is_same<X, DataVector>, std::is_same<X, ComplexDataVector>> {};
struct is_supported_tensor_datatype : std::true_type {};

template <typename X>
constexpr bool is_supported_tensor_datatype_v =
Expand Down
22 changes: 11 additions & 11 deletions src/DataStructures/Tensor/Tensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@ class Tensor<X, Symm, IndexList<Indices...>> {
"If you are sure you need rank 5 or higher Tensor's please "
"file an issue on GitHub or discuss with a core developer of "
"SpECTRE.");
static_assert(
std::is_same_v<X, std::complex<double>> or std::is_same_v<X, double> or
std::is_same_v<X, ComplexDataVector> or
std::is_same_v<X, ComplexModalVector> or
std::is_same_v<X, DataVector> or std::is_same_v<X, ModalVector> or
is_spin_weighted_of_v<ComplexDataVector, X> or
is_spin_weighted_of_v<ComplexModalVector, X> or
simd::is_batch<X>::value,
"Unsupported type. While other types are technically possible it is not "
"clear that Tensor is the correct container for them. Please seek advice "
"on the topic by discussing with the SpECTRE developers.");
// static_assert(
// std::is_same_v<X, std::complex<double>> or std::is_same_v<X, double> or
// std::is_same_v<X, ComplexDataVector> or
// std::is_same_v<X, ComplexModalVector> or
// std::is_same_v<X, DataVector> or std::is_same_v<X, ModalVector> or
// is_spin_weighted_of_v<ComplexDataVector, X> or
// is_spin_weighted_of_v<ComplexModalVector, X> or
// simd::is_batch<X>::value,
// "Unsupported type. While other types are technically possible it is not
// " "clear that Tensor is the correct container for them. Please seek
// advice " "on the topic by discussing with the SpECTRE developers.");

public:
/// The type of the sequence that holds the data
Expand Down

0 comments on commit 9638b6a

Please sign in to comment.