22 #ifndef _aspect_structured_data_h 23 #define _aspect_structured_data_h 48 using namespace ::Utilities;
128 void reinit(
const std::vector<std::string> &column_names,
130 std::vector<Table<dim,double>> &&data_table,
131 const MPI_Comm mpi_communicator = MPI_COMM_SELF,
132 const unsigned int root_process = numbers::invalid_unsigned_int);
153 const MPI_Comm communicator);
164 load_netcdf(
const std::string &filename,
const std::vector<std::string> &data_column_names = {});
183 const MPI_Comm communicator);
199 get_data(
const Point<dim> &position,
200 const unsigned int component,
201 const bool crash_if_not_in_range =
false)
const;
214 const unsigned int component);
222 std::vector<std::string>
245 const std::vector<double> &
296 std::vector<std::unique_ptr<Function<dim>>>
data;
353 const std::string &default_directory,
354 const std::string &default_filename,
355 const std::string &subsection_name =
"Ascii data model");
361 parse_parameters (ParameterHandler &prm,
362 const std::string &subsection_name =
"Ascii data model");
404 initialize (
const std::set<types::boundary_id> &boundary_ids,
405 const unsigned int components);
420 get_data_component (
const types::boundary_id boundary_indicator,
421 const Point<dim> &position,
422 const unsigned int component)
const;
429 const unsigned int component)
const;
435 vector_gradient(
const types::boundary_id boundary_indicator,
437 const unsigned int component)
const;
458 const std::string &default_directory,
459 const std::string &default_filename,
460 const std::string &subsection_name =
"Ascii data model",
461 const bool declare_time_dependent_parameters =
true);
477 parse_parameters (ParameterHandler &prm,
478 const std::string &subsection_name =
"Ascii data model",
479 const bool parse_time_dependent_parameters =
true);
525 std::map<types::boundary_id,
531 std::map<types::boundary_id,
538 update_data (
const types::boundary_id boundary_id,
539 const bool reload_both_files);
546 end_time_dependence ();
552 create_filename (
const int filenumber,
553 const types::boundary_id boundary_id)
const;
584 get_data_component (
const Point<dim> &position,
585 const unsigned int component)
const;
593 const std::string &default_directory,
594 const std::string &default_filename,
595 const std::string &subsection_name =
"Ascii data model");
601 parse_parameters (ParameterHandler &prm,
602 const std::string &subsection_name =
"Ascii data model");
609 std::unique_ptr<aspect::Utilities::StructuredDataLookup<dim>>
lookup;
616 std::unique_ptr<aspect::Utilities::StructuredDataLookup<3>>
slice_lookup;
659 get_data_component (
const Point<dim> &position,
660 const unsigned int component)
const;
669 const std::string &default_directory,
670 const std::string &default_filename,
671 const std::string &subsection_name =
"Ascii data model");
677 parse_parameters (ParameterHandler &prm,
678 const std::string &subsection_name =
"Ascii data model");
738 get_data_component (
const Point<1> &position,
739 const unsigned int component)
const;
747 std::vector<std::string>
764 const std::vector<double> &
781 maybe_get_column_index_from_name(
const std::string &column_name)
const;
795 std::unique_ptr<aspect::Utilities::StructuredDataLookup<1>>
lookup;
std::string interpolation_scheme
TableIndices< dim > table_points
std::unique_ptr< aspect::Utilities::StructuredDataLookup< 3 > > slice_lookup
Tensor< 1, dim > get_gradients(const Point< dim > &position, const unsigned int component)
double get_data(const Point< dim > &position, const unsigned int component, const bool crash_if_not_in_range=false) const
std::string data_file_name
std::string get_column_name_from_index(const unsigned int column_index) const
std::map< types::boundary_id, std::unique_ptr< aspect::Utilities::StructuredDataLookup< dim-1 > > > lookups
void load_ascii(const std::string &filename, const MPI_Comm communicator)
unsigned int n_components
bool has_equidistant_coordinates() const
std::vector< std::unique_ptr< Function< dim > > > data
double get_maximum_component_value(const unsigned int component) const
const std::vector< double > & get_interpolation_point_coordinates(const unsigned int dimension) const
std::vector< std::string > get_column_names() const
std::vector< std::string > data_component_names
void declare_parameters(ParameterHandler &prm)
void load_netcdf(const std::string &filename, const std::vector< std::string > &data_column_names={})
bool coordinate_values_are_equidistant
std::vector< std::string > data_file_names
bool decreasing_file_order
int first_data_file_number
std::vector< double > maximum_component_value
void load_file(const std::string &filename, const MPI_Comm communicator)
std::vector< std::unique_ptr< aspect::Utilities::StructuredDataLookup< dim-1 > > > lookups
double data_file_time_step
std::unique_ptr< aspect::Utilities::StructuredDataLookup< 1 > > lookup
std::string data_directory
TableIndices< dim > compute_table_indices(const TableIndices< dim > &sizes, const std::size_t idx) const
std::map< types::boundary_id, std::unique_ptr< aspect::Utilities::StructuredDataLookup< dim-1 > > > old_lookups
Tensor< 2, 3 > rotation_matrix
std::array< std::vector< double >, dim > coordinate_values
std::string data_directory
StructuredDataLookup(const unsigned int n_components, const double scale_factor)
void reinit(const std::vector< std::string > &column_names, std::vector< std::vector< double >> &&coordinate_values, std::vector< Table< dim, double >> &&data_table, const MPI_Comm mpi_communicator=MPI_COMM_SELF, const unsigned int root_process=numbers::invalid_unsigned_int)
unsigned int get_column_index_from_name(const std::string &column_name) const
unsigned int get_number_of_coordinates(const unsigned int dimension) const
const double scale_factor
unsigned int number_of_layer_boundaries
std::unique_ptr< aspect::Utilities::StructuredDataLookup< dim > > lookup