SpECTRE  v2024.04.12
gh::NumericInitialData Class Reference

Numeric initial data loaded from volume data files. More...

#include <SetInitialData.hpp>

Classes

struct  AdmVars
 
struct  GhVars
 
struct  Variables
 
struct  VarName
 Name of a variable in the volume data file. More...
 

Public Types

using adm_vars = tmpl::list< gr::Tags::SpatialMetric< DataVector, 3 >, gr::Tags::Lapse< DataVector >, gr::Tags::Shift< DataVector, 3 >, gr::Tags::ExtrinsicCurvature< DataVector, 3 > >
 
using gh_vars = tmpl::list< gr::Tags::SpacetimeMetric< DataVector, 3 >, Tags::Pi< DataVector, 3 > >
 
using all_vars = tmpl::append< adm_vars, gh_vars >
 
using options = tmpl::list< importers::OptionTags::FileGlob, importers::OptionTags::Subgroup, importers::OptionTags::ObservationValue, importers::OptionTags::EnableInterpolation, Variables >
 

Public Member Functions

 NumericInitialData (const NumericInitialData &rhs)=default
 
NumericInitialDataoperator= (const NumericInitialData &rhs)=default
 
 NumericInitialData (NumericInitialData &&)=default
 
NumericInitialDataoperator= (NumericInitialData &&)=default
 
std::unique_ptr< evolution::initial_data::InitialDataget_clone () const override
 
 NumericInitialData (std::string file_glob, std::string subfile_name, std::variant< double, importers::ObservationSelector > observation_value, bool enable_interpolation, std::variant< AdmVars, GhVars > selected_variables)
 
const importers::ImporterOptionsimporter_options () const
 
const std::variant< AdmVars, GhVars > & selected_variables () const
 
size_t volume_data_id () const
 Unique identifier for loading this volume data. More...
 
template<typename... AllTags>
void select_for_import (const gsl::not_null< tuples::TaggedTuple< AllTags... > * > fields) const
 Selects which of the fields to import based on the choices in the input-file options. More...
 
template<typename... AllTags>
void set_initial_data (const gsl::not_null< tnsr::aa< DataVector, 3 > * > spacetime_metric, const gsl::not_null< tnsr::aa< DataVector, 3 > * > pi, const gsl::not_null< tnsr::iaa< DataVector, 3 > * > phi, const gsl::not_null< tuples::TaggedTuple< AllTags... > * > numeric_data, const Mesh< 3 > &mesh, const InverseJacobian< DataVector, 3, Frame::ElementLogical, Frame::Inertial > &inv_jacobian) const
 Set GH initial data given numeric data loaded from files. More...
 
void pup (PUP::er &p) override
 
virtual auto get_clone () const -> std::unique_ptr< InitialData >=0
 

Static Public Attributes

static constexpr Options::String help
 

Friends

bool operator== (const NumericInitialData &lhs, const NumericInitialData &rhs)
 

Detailed Description

Numeric initial data loaded from volume data files.

This class can be factory-created in the input file to start an evolution from numeric initial data. It selects the set of variables to load from the volume data file (ADM or GH variables).

Member Function Documentation

◆ get_clone()

std::unique_ptr< evolution::initial_data::InitialData > gh::NumericInitialData::get_clone ( ) const
inlineoverridevirtual

◆ select_for_import()

template<typename... AllTags>
void gh::NumericInitialData::select_for_import ( const gsl::not_null< tuples::TaggedTuple< AllTags... > * >  fields) const
inline

Selects which of the fields to import based on the choices in the input-file options.

The fields are all datasets that are available to import, represented by importers::Tags::Selected<Tag> tags. We select only those that we need by setting their dataset name.

◆ set_initial_data()

template<typename... AllTags>
void gh::NumericInitialData::set_initial_data ( const gsl::not_null< tnsr::aa< DataVector, 3 > * >  spacetime_metric,
const gsl::not_null< tnsr::aa< DataVector, 3 > * >  pi,
const gsl::not_null< tnsr::iaa< DataVector, 3 > * >  phi,
const gsl::not_null< tuples::TaggedTuple< AllTags... > * >  numeric_data,
const Mesh< 3 > &  mesh,
const InverseJacobian< DataVector, 3, Frame::ElementLogical, Frame::Inertial > &  inv_jacobian 
) const
inline

Set GH initial data given numeric data loaded from files.

The numeric_data contains the datasets selected above (and possibly more). We either set the GH variables directly, or compute them from the ADM variables.

◆ volume_data_id()

size_t gh::NumericInitialData::volume_data_id ( ) const

Unique identifier for loading this volume data.

Involves a hash of the type name and the volume data file names.

Member Data Documentation

◆ help

constexpr Options::String gh::NumericInitialData::help
staticconstexpr
Initial value:
=
"Numeric initial data loaded from volume data files"

The documentation for this class was generated from the following file: