-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
122c739
commit 6a80ba0
Showing
6 changed files
with
367 additions
and
0 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
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,57 @@ | ||
// Distributed under the MIT License. | ||
// See LICENSE.txt for details. | ||
|
||
#include "Evolution/Systems/Cce/KleinGordonSource.hpp" | ||
|
||
namespace Cce { | ||
|
||
void ComputeKleinGordonSource<Tags::BondiBeta>::apply( | ||
gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 0>>*> kg_source_beta, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& dy_kg_psi, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& one_minus_y) { | ||
get(*kg_source_beta) = 2. * M_PI * get(one_minus_y) * square(get(dy_kg_psi)); | ||
} | ||
|
||
void ComputeKleinGordonSource<Tags::BondiQ>::apply( | ||
gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 1>>*> kg_source_q, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& dy_kg_psi, | ||
const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_kg_psi) { | ||
get(*kg_source_q) = 16. * M_PI * get(eth_kg_psi) * get(dy_kg_psi); | ||
} | ||
|
||
void ComputeKleinGordonSource<Tags::BondiU>::apply( | ||
gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 1>>*> kg_source_u, | ||
const size_t l_max, const size_t number_of_radial_points) { | ||
const size_t volume_size = | ||
Spectral::Swsh::number_of_swsh_collocation_points(l_max) * | ||
number_of_radial_points; | ||
get(*kg_source_u) = SpinWeighted<ComplexDataVector, 1>{volume_size, 0.0}; | ||
} | ||
|
||
void ComputeKleinGordonSource<Tags::BondiW>::apply( | ||
gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 0>>*> kg_source_w, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& bondi_r, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& bondi_k, | ||
const Scalar<SpinWeighted<ComplexDataVector, 2>>& bondi_j, | ||
const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_kg_psi) { | ||
SpinWeighted<ComplexDataVector, 0> complex_part; | ||
SpinWeighted<ComplexDataVector, 0> real_part; | ||
|
||
complex_part.data() = | ||
2.0 * real(get(bondi_j).data() * square(conj(get(eth_kg_psi))).data()); | ||
real_part.data() = | ||
-2.0 * get(bondi_k).data() * square(abs(get(eth_kg_psi).data())); | ||
get(*kg_source_w) = | ||
M_PI * get(exp_2_beta) / get(bondi_r) * (complex_part + real_part); | ||
} | ||
|
||
void ComputeKleinGordonSource<Tags::BondiH>::apply( | ||
gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 2>>*> kg_source_h, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& bondi_r, | ||
const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_kg_psi) { | ||
get(*kg_source_h) = | ||
2 * M_PI * get(exp_2_beta) / get(bondi_r) * square(get(eth_kg_psi)); | ||
} | ||
} // namespace Cce |
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,139 @@ | ||
// Distributed under the MIT License. | ||
// See LICENSE.txt for details. | ||
|
||
#pragma once | ||
|
||
#include "Evolution/Systems/Cce/OptionTags.hpp" | ||
#include "Evolution/Systems/Cce/Tags.hpp" | ||
#include "Utilities/Gsl.hpp" | ||
#include "Utilities/TMPL.hpp" | ||
|
||
namespace Cce { | ||
|
||
/*! | ||
* \brief Computes `Tags::KleinGordonSource<Tag>` for the tags evolved by | ||
* Klein-Gordon Cce. | ||
* | ||
* \details In scalar-tensor theory, the Cce hypersurface equations get | ||
* additional source terms contributed by the stress-energy tensor of the scalar | ||
* field. The tag `Tags::KleinGordonSource<Tag>` stores the corresponding volume | ||
* data. | ||
*/ | ||
template <typename Tag> | ||
struct ComputeKleinGordonSource; | ||
|
||
/*! | ||
* \brief Computes the Klein-Gordon source of the Bondi \f$\beta\f$ | ||
* | ||
* \details The source reads: | ||
* | ||
* \f{align*}{ | ||
* 2 \pi (1-y) (\partial_y\psi)^2, | ||
* \f} | ||
* where \f$\psi\f$ is the Klein-Gordon (scalar) field. | ||
*/ | ||
template <> | ||
struct ComputeKleinGordonSource<Tags::BondiBeta> { | ||
using return_tags = tmpl::list<Tags::KleinGordonSource<Tags::BondiBeta>>; | ||
using argument_tags = | ||
tmpl::list<Tags::Dy<Tags::KleinGordonPsi>, Tags::OneMinusY>; | ||
static void apply( | ||
gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 0>>*> kg_source_beta, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& dy_kg_psi, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& one_minus_y); | ||
}; | ||
|
||
/*! | ||
* \brief Computes the Klein-Gordon source of the Bondi \f$Q\f$ | ||
* | ||
* \details Following the nomenclature of \cite Moxon2020gha and their Eq. (49), | ||
* the scalar field contributes only to the regular part of the source term | ||
* \f$S_2^R\f$. The expression reads: | ||
* | ||
* \f{align*}{ | ||
* 16 \pi \eth\psi \partial_y\psi, | ||
* \f} | ||
* where \f$\psi\f$ is the Klein-Gordon (scalar) field. | ||
*/ | ||
template <> | ||
struct ComputeKleinGordonSource<Tags::BondiQ> { | ||
using return_tags = tmpl::list<Tags::KleinGordonSource<Tags::BondiQ>>; | ||
using argument_tags = | ||
tmpl::list<Tags::Dy<Tags::KleinGordonPsi>, | ||
Spectral::Swsh::Tags::Derivative<Tags::KleinGordonPsi, | ||
Spectral::Swsh::Tags::Eth>>; | ||
static void apply( | ||
gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 1>>*> kg_source_q, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& dy_kg_psi, | ||
const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_kg_psi); | ||
}; | ||
|
||
/*! | ||
* \brief Computes the Klein-Gordon source of the Bondi \f$U\f$ | ||
* | ||
* \details The source vanishes. | ||
*/ | ||
template <> | ||
struct ComputeKleinGordonSource<Tags::BondiU> { | ||
using return_tags = tmpl::list<Tags::KleinGordonSource<Tags::BondiU>>; | ||
using argument_tags = tmpl::list<Tags::LMax, Tags::NumberOfRadialPoints>; | ||
static void apply( | ||
gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 1>>*> kg_source_u, | ||
size_t l_max, size_t number_of_radial_points); | ||
}; | ||
|
||
/*! | ||
* \brief Computes the Klein-Gordon source of the Bondi \f$W\f$ | ||
* | ||
* \details Following the nomenclature of \cite Moxon2020gha and their Eq. (49), | ||
* the scalar field contributes only to the regular part of the source term | ||
* \f$S_2^R\f$. The expression reads: | ||
* | ||
* \f{align*}{ | ||
* \frac{\pi e^{2\beta}}{R} \left[J(\bar{\eth}\psi)^2 + \bar{J}(\eth | ||
* \psi)^2-2K \eth\psi\bar{\eth}\psi\right], | ||
* \f} | ||
* where \f$\psi\f$ is the Klein-Gordon (scalar) field. | ||
*/ | ||
template <> | ||
struct ComputeKleinGordonSource<Tags::BondiW> { | ||
using return_tags = tmpl::list<Tags::KleinGordonSource<Tags::BondiW>>; | ||
using argument_tags = | ||
tmpl::list<Tags::Exp2Beta, Tags::BondiR, Tags::BondiK, Tags::BondiJ, | ||
Spectral::Swsh::Tags::Derivative<Tags::KleinGordonPsi, | ||
Spectral::Swsh::Tags::Eth>>; | ||
static void apply( | ||
gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 0>>*> kg_source_w, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& bondi_r, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& bondi_k, | ||
const Scalar<SpinWeighted<ComplexDataVector, 2>>& bondi_j, | ||
const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_kg_psi); | ||
}; | ||
|
||
/*! | ||
* \brief Computes the Klein-Gordon source of the Bondi \f$H\f$ | ||
* | ||
* \details Following the nomenclature of \cite Moxon2020gha and their Eq. (50), | ||
* the scalar field contributes only to the regular part of the source term | ||
* \f$S_3^R\f$. The expression reads: | ||
* | ||
* \f{align*}{ | ||
* 2 \pi \frac{e^{2\beta}}{R}(\eth\psi)^2, | ||
* \f} | ||
* where \f$\psi\f$ is the Klein-Gordon (scalar) field. | ||
*/ | ||
template <> | ||
struct ComputeKleinGordonSource<Tags::BondiH> { | ||
using return_tags = tmpl::list<Tags::KleinGordonSource<Tags::BondiH>>; | ||
using argument_tags = | ||
tmpl::list<Tags::Exp2Beta, Tags::BondiR, | ||
Spectral::Swsh::Tags::Derivative<Tags::KleinGordonPsi, | ||
Spectral::Swsh::Tags::Eth>>; | ||
static void apply( | ||
gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 2>>*> kg_source_h, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& exp_2_beta, | ||
const Scalar<SpinWeighted<ComplexDataVector, 0>>& bondi_r, | ||
const Scalar<SpinWeighted<ComplexDataVector, 1>>& eth_kg_psi); | ||
}; | ||
} // namespace Cce |
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
Oops, something went wrong.