Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BNS initial data executable and SpEC initial Data #6422

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

isaaclegred
Copy link
Contributor

Proposed changes

Add an elliptic executable to solve for the velocity potential of a BNS system for use in initial data to evolutions. Additionally add SpEC analytic data for initializing a spacetime/matter distribution for the velocity potential solve.

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

Further comments

@isaaclegred isaaclegred requested a review from nilsvu December 18, 2024 19:09
@isaaclegred isaaclegred added the in progress Don't review, used for sharing code and getting feedback label Dec 18, 2024
Copy link
Member

@nilsvu nilsvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a few potential bugs in the fixed sources that might explain the deviations from SpEC that you see.

Please add a test input file that has the Check: parse line so the executable gets compiled on CI.

Also, it would be nice to add a test for the SpecData that's similar to tests/Unit/PointwiseFunctions/AnalyticData/GrMhd/Test_FukaInitialData.cpp in that you can supply SpEC sample data as an environment variable, and then it checks that the data fulfills the equations (see verify_solution from tests/Unit/Helpers/PointwiseFunctions/AnalyticSolutions/FirstOrderEllipticSolutionsTestHelpers.hpp for an example).

static constexpr Options::String help{
"Find the solution for the velocity potential of"
"an irrotational BNS system using fixed"
"problem on fixed space-time and with a fixed"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space at the beginning or end of each line. Also, this sentence seems a little off, maybe delete "using fixed problem".

@@ -76,6 +77,7 @@ struct FirstOrderSystem
::Tags::Flux<velocity_potential, tmpl::size_t<3>, Frame::Inertial>>;

using background_fields = tmpl::list<
hydro::Tags::RestMassDensity<DataVector>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this used?


#include "PointwiseFunctions/AnalyticData/BnsInitialData/SpecInitialData.hpp"
namespace BnsInitialData::InitialData {
using all_initial_data = tmpl::list<TovStar, SpecInitialData<1>>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do you get the TovStar from? The TOV solution is just the trivial $\Phi=0$, isn't it?

#pragma once

#include "PointwiseFunctions/AnalyticData/BnsInitialData/SpecInitialData.hpp"
namespace BnsInitialData::InitialData {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name this namespace AnalyticData please for consistency with the other systems


#include "PointwiseFunctions/AnalyticData/BnsInitialData/SpecInitialData.hpp"
namespace BnsInitialData::InitialData {
using all_initial_data = tmpl::list<TovStar, SpecInitialData<1>>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and name this all_analytic_data

Comment on lines +60 to +67
data_directory_ = rhs.data_directory_;
equation_of_state_ = rhs.equation_of_state_->get_clone();
density_cutoff_ = rhs.density_cutoff_;
orbital_angular_velocity_ = rhs.orbital_angular_velocity_;
euler_enthalpy_constant_ = rhs.euler_enthalpy_constant_;
spec_exporter_ =
std::make_unique<spec::Exporter>(sys::procs_on_node(sys::my_node()),
data_directory_, vars_to_interpolate_);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with:

*this = rhs;

* constant read from the input file.
*/
template <size_t ThermodynamicDim>
class SpecInitialData : public elliptic::analytic_data::Background,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name this maybe just SpecData

*
* This class loads numerical data written out by the SpEC initial data solver.
* It uses the `spec::Exporter` linked in from SpEC to interpolate to arbitrary
* grid points. The coordinates are assumed to be in SpEC's "grid" frame.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check if SpEC's grid frame is the one that is deformed to the surface of the star

}
// The velocity potential is used in the initial guess
template <typename DataType>
tuples::TaggedTuple<Tags::VelocityPotential<DataType>> variables(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the definition of these variables functions to the cpp file. You can also remove the templating on DataType and just use DataVector (if you want).

@@ -116,10 +116,9 @@ void spatial_rotational_killing_vector(
const Scalar<DataType>& sqrt_det_spatial_metric) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unused argument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress Don't review, used for sharing code and getting feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants