Skip to content

Commit

Permalink
Merge pull request #1397 from moxcodes/cce_equations
Browse files Browse the repository at this point in the history
Add CCE system equations
  • Loading branch information
kidder committed Jul 31, 2019
2 parents 5eed594 + c96946a commit a36f01e
Show file tree
Hide file tree
Showing 13 changed files with 1,999 additions and 1 deletion.
31 changes: 31 additions & 0 deletions docs/References.bib
Expand Up @@ -85,6 +85,21 @@ @article{Beckwith2011iy
volume = "193",
}

@article{Bishop1997ik,
author = "Bishop, Nigel T. and Gomez, Roberto and Lehner, Luis and
Maharaj, Manoj and Winicour, Jeffrey",
title = "{High powered gravitational news}",
journal = "Phys. Rev.",
volume = "D56",
year = "1997",
pages = "6298-6309",
doi = "10.1103/PhysRevD.56.6298",
eprint = "gr-qc/9708065",
archivePrefix = "arXiv",
primaryClass = "gr-qc",
url = "https://doi.org/10.1103/PhysRevD.56.6298",
}

@book{Cockburn1999,
author = "Cockburn, Bernardo",
editor = "Barth, Timothy J. and Deconinck, Herman",
Expand Down Expand Up @@ -298,6 +313,22 @@ @article{Hemberger2012jz
primaryClass = "gr-qc",
}

@article{Handmer2014qha,
author = "Handmer, Casey J. and Szilagyi, B.",
title = "{Spectral Characteristic Evolution: A New Algorithm for
Gravitational Wave Propagation}",
journal = "Class. Quant. Grav.",
volume = "32",
year = "2015",
number = "2",
pages = "025008",
doi = "10.1088/0264-9381/32/2/025008",
eprint = "1406.7029",
archivePrefix = "arXiv",
primaryClass = "gr-qc",
url = "https://doi.org/10.1088/0264-9381/32/2/025008"
}

@book{Hartle2003gravity,
author = "Hartle, J.B.",
title = "Gravity: An Introduction to {Einstein's} General Relativity",
Expand Down
50 changes: 50 additions & 0 deletions src/DataStructures/Tags.hpp
Expand Up @@ -6,7 +6,9 @@
#include <string>

#include "DataStructures/DataBox/DataBoxTag.hpp"
#include "DataStructures/SpinWeighted.hpp"
#include "DataStructures/Tensor/Metafunctions.hpp"
#include "DataStructures/Tensor/TypeAliases.hpp"

/// \cond
class DataVector;
Expand Down Expand Up @@ -40,4 +42,52 @@ struct Modal : db::SimpleTag, db::PrefixTag {
return "Modal(" + NodalTag::name() + ")";
}
};

/// Given a Tag with a `type` of `Tensor<VectorType, ...>`, acts as a new
/// version of the tag with `type` of `Tensor<SpinWeighted<VectorType,
/// SpinConstant::value>, ...>`, which is the preferred tensor type associated
/// with spin-weighted quantities. Here, `SpinConstant` must be a
/// `std::integral_constant` or similar type wrapper for a compile-time
/// constant, in order to work properly with DataBox utilities.
/// \note There are restrictions of which vector types can be wrapped
/// by SpinWeighted in a Tensor, so some `Tag`s that have valid `type`s may
/// give rise to compilation errors when used as `Tags::SpinWeighted<Tag,
/// SpinConstant>`. If you find such trouble, consult the whitelist of possible
/// Tensor storage types in `Tensor.hpp`.
template <typename Tag, typename SpinConstant>
struct SpinWeighted : db::PrefixTag, db::SimpleTag {
static_assert(not is_any_spin_weighted_v<typename Tag::type::type>,
"The SpinWeighted tag should only be used to create a "
"spin-weighted version of a non-spin-weighted tag. The "
"provided tag already has a spin-weighted type");
using type = TensorMetafunctions::swap_type<
::SpinWeighted<typename Tag::type::type, SpinConstant::value>,
typename Tag::type>;
using tag = Tag;
static std::string name() noexcept {
return "SpinWeighted(" + Tag::name() + ", " +
std::to_string(SpinConstant::value) + ")";
}
};

namespace detail {
template <typename LhsType, typename RhsType>
using product_t =
Scalar<::SpinWeighted<ComplexDataVector,
LhsType::type::spin + RhsType::type::spin>>;
} // namespace detail

/// A prefix tag representing the product of two other tags. Note that if
/// non-spin-weighted types are needed in this tag, the type alias
/// `detail::product_t` should be generalized to give a reasonable type for
/// those cases, or template specializations should be constructed for this tag.
template <typename LhsTag, typename RhsTag>
struct Multiplies : db::PrefixTag, db::SimpleTag {
using type = detail::product_t<db::item_type<LhsTag>, db::item_type<RhsTag>>;
using tag = LhsTag;
static std::string name() noexcept {
return "Multiplies(" + LhsTag::name() + ", " + RhsTag::name() + ")";
}
};

} // namespace Tags
2 changes: 1 addition & 1 deletion src/DataStructures/Variables.hpp
Expand Up @@ -909,7 +909,7 @@ struct Subitems<TagList, Tag,

namespace Tags {
template <size_t N, typename T>
struct TempTensor {
struct TempTensor : db::SimpleTag {
using type = T;
static std::string name() noexcept {
return std::string("TempTensor") + std::to_string(N);
Expand Down
1 change: 1 addition & 0 deletions src/Evolution/Systems/CMakeLists.txt
Expand Up @@ -2,6 +2,7 @@
# See LICENSE.txt for details.

add_subdirectory(Burgers)
add_subdirectory(Cce)
add_subdirectory(CurvedScalarWave)
add_subdirectory(GeneralizedHarmonic)
add_subdirectory(GrMhd)
Expand Down
16 changes: 16 additions & 0 deletions src/Evolution/Systems/Cce/CMakeLists.txt
@@ -0,0 +1,16 @@
# Distributed under the MIT License.
# See LICENSE.txt for details.

set(LIBRARY Cce)

set(LIBRARY_SOURCES
Equations.cpp
)

add_spectre_library(${LIBRARY} ${LIBRARY_SOURCES})

target_link_libraries(
${LIBRARY}
INTERFACE DataStructures
INTERFACE ErrorHandling
)

0 comments on commit a36f01e

Please sign in to comment.