hexed 0.4.0
 
Loading...
Searching...
No Matches
hexed Namespace Reference

Global namespace for all of the C++ API of Hexed. More...

Namespaces

namespace  assert
 utilities for custom assertions
 
namespace  brep
 Implementation of the Boundary Representation (BRep) for solid geometry.
 
namespace  config
 Namespace for options configured at build time.
 
namespace  constants
 Mathematical and physical constants.
 
namespace  criteria
 A namespace for functions to be used as refinement criteria.
 
namespace  hdf5_utils
 Convenience wrappers for some common and verbose HDF5 operations.
 
namespace  iterative
 iterative solvers for linear equations, in particular Krylov subspace methods
 
namespace  math
 Miscellaneous mathematical functions that aren't in std::math
 
namespace  mutual
 a namespace for mutually-connected objects
 
namespace  next
 namespace for refactored functionality that may clash with existing names
 
namespace  printers
 Global Printer objects that any function can use to print messages.
 
namespace  vis_variables
 functions that assign visualization data to HIL variables
 

Classes

class  Accessible_mesh
 A mesh that supports access to the actual elements with the numerical data they contain. More...
 
class  Advection
 
class  Advection_state
 Fetches the advection states used for computing the smoothness-based artfificial viscosity. More...
 
class  Annular_diffusion_test
 Steady-state solution to Laplacian diffusion in an anular domain (for verification testing). More...
 
class  Array
 Represents a dynamic-sized multidimensional array. More...
 
class  Art_visc_coef
 fetches the artificial viscosity coefficient More...
 
class  Art_visc_forcing
 Fetches one of the forcing variables in artificial viscosity computation. More...
 
class  Basis
 Represents a basis of Lagrange polynomials. More...
 
class  Boundary_connection
 
class  Boundary_face
 
class  Case
 
class  Command_input
 Handles command line input with history. More...
 
class  Complete_element_container
 
class  Component
 returns a component of another Qpoint_func More...
 
class  Compound_edge
 
class  Compound_geom
 Combines multiple Surface_geoms into one. More...
 
class  Compound_printer
 Printer which is just a combination of other printers. More...
 
class  Concat_func
 concatenates the output of a vector of function-type objects (derived from Output_data) More...
 
class  Concatenation
 A Sequence formed by concatenating two Sequences. More...
 
class  Connection_direction
 Describes the direction in which to faces are connected. More...
 
class  Constant_func
 Always returns the same constant (vector) value. More...
 
class  Convergence_monitor
 Monitors whether some variable has converged to a definite value. More...
 
class  Copy
 Mostly used for testing, but you can maybe get away with it for supersonic outlets. More...
 
class  Csv
 Writes output in Comma-Separated Value format. More...
 
class  Deformed_element
 Represents an Element which is not a perfect axis-aligned square/cube. More...
 
class  Dense_equation
 equation in \( \mathbb{R}^n \) with a dense matrix More...
 
class  Derivative
 
class  Diff_sq
 computes the elementwise squared difference between the output of 2 Domain_funcs More...
 
class  Domain_func
 
class  Doublet
 
class  Eikonal
 
class  Elem_average
 computes the average of the provided Qpoint_func within the element by Gaussian quadrature More...
 
class  Elem_l2
 computes the \(L_2\) norm of the provided Qpoint_func within the element by Gaussian quadrature More...
 
class  Elem_nonsmooth
 compute the elementwise nonsmoothness indicator of the provided function More...
 
class  Element
 Stores data associated with one mesh element. More...
 
class  Element_container
 
class  Element_func
 a function that has a single value for each element More...
 
class  Element_info
 an Element_func that doesn't depend on a Basis or the time More...
 
class  Empty_func
 Returns an empty vector. You can pass this to Solver::visualize_field_tecplot if you just want to visualize the position. More...
 
class  Equiangle_skewness
 Computes the equiangle skewness mesh quality metric. More...
 
class  Equidistant
 Basis with equidistant quadrature points. More...
 
class  Error_func
 
class  Expression_bc
 Sets the boundary condition explicitly based on a HIL expression. More...
 
class  Face
 
class  Face_permutation_dynamic
 
class  Face_refinement
 
class  Fix_admis_coef
 fetches the Element::fix_admis_coef More...
 
class  Fix_nonphysical
 
class  Flow_bc
 Abstract class representing an arbitrary flow boundary condition. More...
 
class  Freestream
 Sets the ghost state to the provided freestream state. More...
 
class  Gauss_legendre
 Basis based on Gauss-Legendre quadrature. More...
 
class  Gauss_lobatto
 Basis based on Gauss-Lobatto quadrature. More...
 
class  Geom_edge
 
class  Gradient
 
struct  Hard_kernel_connection
 The minimal amount of data that the kernels need about a Neighbor_connection More...
 
class  Has_tree
 Returns 1 if the element has a Tree pointer, else 0. More...
 
class  Hil_exception
 
class  History_stats
 Computes statistics about the convergence history of some variable. More...
 
class  Hypersphere
 Represents hypersphere in any dimensionality. More...
 
class  Iges_parser
 Parses IGES files to obtain parameter values. More...
 
struct  Implicit_options
 
class  Index
 Provides a view of some elements of a Sequence identified by a sequence of indices. More...
 
class  Interpreter
 
class  Is_deformed
 Returns 1 if the element is deformed, otherwise 0. More...
 
class  Is_physical_result
 
class  Iteration_status
 Contains high-level diagnostic information about the status of a time-marching scheme. More...
 
class  Iterator
 A random-access iterator type based on an arbitrary access function. More...
 
class  Jac_inv_det_func
 Determinant of inverse of Jacobian. More...
 
class  Jacobian_det_func
 Returns a vector with one element: the Jacobian determinant at the quadrature point. More...
 
class  Kernel
 Base class for a "kernel". "Kernel" is a word which here means a callable object which accepts dimensionality and row size as template arguments to improve performance. More...
 
class  Kernel_element
 Represents an element as the kernels see it. More...
 
struct  Kernel_face_refinement
 The minimal amount of data that the kernels need about Face_refinement More...
 
struct  Kernel_mesh
 
struct  Kernel_options
 
class  Laplace
 
class  Layer_sequence
 Selects a growth profile for anisotropic wall layers. More...
 
class  Linear
 Computes a single output variable which is a linear combination of components of position. More...
 
class  Linear_equation
 represents a linear equation in an arbitrary vector space with a black-box operator More...
 
class  Lock
 wrapper for OpenMP nested lock routines. More...
 
class  Mach
 Computes Mach number. More...
 
class  Mass
 Aka density. More...
 
class  Mesh
 
struct  Mesh_assessment
 
class  Mesh_by_type
 
class  Mortal
 represents an object that could die at any moment More...
 
class  Mortal_ptr
 a pointer to a Mortal object that will be updated if the object is destroyed or moved. More...
 
class  Namespace
 
class  Navier_stokes
 
class  Nearest_point
 Helper class for finding the nearest point to a given reference point. More...
 
class  Neighbor_connection
 
class  No_slip
 No-slip wall boundary condition. More...
 
class  Nonpenetration
 Copies the inside state and flips the sign of the surface-normal velocity. More...
 
class  Normalized_nonsmooth
 same as Elem_nonsmooth, but normalized by Elem_l2 More...
 
class  Outflow
 for supersonic outlets More...
 
class  Output_data
 Represents some numerical data which is of interest to the end user. More...
 
class  Outward_normal
 Returns the surface normal vector. More...
 
class  Path
 Finds a file in the working directory or system paths. More...
 
class  Physical_residual
 returns the residual of the Navier-Stokes equations, not weighted by local time step More...
 
class  Pointer
 Abstract base class for implementing pointer objects. More...
 
class  Position_func
 Returns the position vector. More...
 
class  Pow
 Raises the output of a Qpoint_func to a user-specified power. More...
 
class  Prescribed_energy
 prescribes the specific energy but doesn't touch the heat flux More...
 
class  Prescribed_heat_flux
 prescribes the heat flux but doesn't touch the energy More...
 
class  Pressure
 Computes (static) pressure. More...
 
class  Pressure_outflow
 sets pressure on outflow boundaries More...
 
class  Pressure_stress
 Computes inviscid surface force per unit area (i.e. pressure times unit normal). More...
 
class  Printer
 abstract base class for handling different variations of printing things for user More...
 
class  Qpoint_func
 Represents a function which can be evaluated at quadrature points. More...
 
class  Random_func
 Returns a random output uniformly distributed in a user-specified range. More...
 
class  Reciprocal_list
 Like Reciprocal_ptr, put it can be connected with multiple partners. More...
 
class  Reciprocal_ptr
 Implements pairs of reciprocally-connected pointers. More...
 
class  Record
 Returns Element::record More...
 
class  Refined_face
 
class  Riemann_invariants
 A freestream boundary condition that sets only the ingoing characteristics. More...
 
class  Ringleb
 Steady-state solution for Ringleb flow. More...
 
class  Ringleb_errsq
 Squared error metric for computing \(L^2\) error of Ringleb flow. More...
 
class  Row_index
 Facilitates the process of iterating through all rows along a particular dimension. More...
 
class  Row_rw
 "row read/write" More...
 
class  Scaled
 Scales a function of a single variable. More...
 
class  Sequence
 An interface for general sequence-type containers. More...
 
class  Simplex_geom
 Represents discrete geometry composed of simplices. More...
 
class  Simplex_geom_nd
 Abstract base class for Simplex_geom exposing the dimensionality-independent functionality. More...
 
class  Slice
 
class  Smooth_art_visc
 
class  Sod
 Initial consition for classic Sod problem. More...
 
class  Solver
 The main class that basically runs everything. More...
 
class  Spacetime_expr
 Evaluates a structured expression. More...
 
class  Spacetime_func
 Represents a function of position and time. More...
 
class  Spatial
 
class  Spatial_gaussian
 multivariate Gaussian distribution in terms of spatial coordinates normalized to evaluate to 1 at the zero vector More...
 
class  Stab_art_visc
 
class  Stab_indicator
 useful for detecting elements that require stabilization More...
 
class  Stag_pres
 Computes stagnation pressure. More...
 
class  State_from_spacetime
 A class of Spacetime_funcs whose output is a state vector. More...
 
class  State_variables
 A function that simply gives you back the state variables. Useful for visualization and conservation checking. More...
 
class  Stopwatch
 A class for conveniently measuring execution time. More...
 
class  Stopwatch_tree
 A tree structure of Stopwatch objects. More...
 
class  Storage_params
 the parameters of the numerical scheme that are necessary to determine storage requirements More...
 
class  Stream_printer
 prints to a std::ostream. More...
 
class  Struct_expr
 evaluates a structured expression in HIL More...
 
class  Surface_func
 A class of functions that can be evaluated at a point on a surface, without reference to a Boundary_connection object. More...
 
class  Surface_geom
 Represents a surface geometry implicitly for meshing. More...
 
class  Task_message
 prints messages like "message... done" More...
 
class  Tecplot_file
 Wrapper for Tecplot API. More...
 
class  Thermal_bc
 specifies the thermal component of a No_slip wall boundary condition More...
 
class  Thermal_equilibrium
 stipulates that the wall is in thermal equilibrium based on a 1D heat equation More...
 
class  Time_step_scale_func
 Fetches the value of the Element::time_step_scale member. More...
 
class  Transport_model
 
class  Tree
 Bin/quad/octree data structure. More...
 
class  Tree_curve
 
class  Tree_curve_edge
 
class  Tree_curve_geom
 
class  Uncertainty
 function to fetch the value of the uncertainty member of the Element. More...
 
class  Vector_view
 Provides a view of an existing container (e.g., std::vector) as a Sequence. More...
 
class  Velocity
 Computes velocity vector. More...
 
class  View_by_type
 
class  Vis_data
 Computes data to be visualized for a single element. More...
 
class  Visualizer
 General interface for writing visualization data in different file formats. More...
 
class  Xdmf_wrapper
 lightweight wrapper for XDMF API for block-structured data More...
 

Typedefs

typedef Concat_func< Element_func, Element &, const Basis &, double > Ef_concat
 Concatenates Element_funcs.
 
typedef Concat_func< Element_func, Element & > Ei_concat
 Concatenates Element_infos.
 
typedef Concat_func< Qpoint_func, Element &, const Basis &, int, double > Qf_concat
 Concatenates Qpoint_funcs.
 
template<typename T >
using reduced_vector = std::vector<T>
 
template<int rows = dyn, int cols = 1>
using Mat = Eigen::Matrix<double, rows, cols>
 convenience alias for Eigen::Matrix<double, rows = dyn, cols = 1>
 
template<int rows = dyn, int cols = dyn>
using Mat_rm = Eigen::Matrix<double, rows, cols, Eigen::RowMajor>
 convenience alias for Eigen::Matrix<double, rows = dyn, cols = dyn, Eigen::RowMajor>
 
typedef intmax_t Int
 basic integer type to use for potentially-large numbers, such as sizes
 
typedef Navier_stokes< false, laminar > euler
 
typedef Navier_stokes< false, k_omega > k_omega_euler
 
typedef Navier_stokes< true, laminar > ns
 
typedef Navier_stokes< true, k_omega > rans
 

Enumerations

enum  Time_scheme {
  explicit_steady , explicit_unsteady , backward_euler , crank_nicolson ,
  dirk2
}
 enumerates the currently-supported time integration schemes
 
enum  Turbulence_model { laminar , k_omega }
 

Functions

std::vector< Inthypercubes (Int n_var, Int n_dim, Int row_size)
 
template<typename T >
Array< T > operator- (const Array< T > &op0, const Array< T > &op1)
 
template<typename T >
Array< T > operator- (const Array< T > &op0, const T &op1)
 
template<typename T >
Array< T > operator- (const T &op0, const Array< T > &op1)
 
template<typename T >
Array< T > operator+ (const Array< T > &op0, const Array< T > &op1)
 
template<typename T >
Array< T > operator+ (const Array< T > &op0, const T &op1)
 
template<typename T >
Array< T > operator+ (const T &op0, const Array< T > &op1)
 
template<typename T >
Array< T > operator/ (const Array< T > &op0, const Array< T > &op1)
 
template<typename T >
Array< T > operator/ (const Array< T > &op0, const T &op1)
 
template<typename T >
Array< T > operator/ (const T &op0, const Array< T > &op1)
 
template<typename T >
Array< T > operator* (const Array< T > &op0, const Array< T > &op1)
 
template<typename T >
Array< T > operator* (const Array< T > &op0, const T &op1)
 
template<typename T >
Array< T > operator* (const T &op0, const Array< T > &op1)
 
template<typename T >
Array< T > operator% (const Array< T > &op0, const Array< T > &op1)
 
template<typename T >
Array< T > operator% (const Array< T > &op0, const T &op1)
 
template<typename T >
Array< T > operator% (const T &op0, const Array< T > &op1)
 
template<typename T >
Array< T > operator&& (const Array< T > &op0, const Array< T > &op1)
 
template<typename T >
Array< T > operator&& (const Array< T > &op0, const T &op1)
 
template<typename T >
Array< T > operator&& (const T &op0, const Array< T > &op1)
 
template<typename T >
Array< T > operator|| (const Array< T > &op0, const Array< T > &op1)
 
template<typename T >
Array< T > operator|| (const Array< T > &op0, const T &op1)
 
template<typename T >
Array< T > operator|| (const T &op0, const Array< T > &op1)
 
template<typename T >
Array< T > operator- (const Array< T > &op0)
 
template<typename T >
Array< T > operator+ (const Array< T > &op0)
 
template<typename T >
std::string to_string (Array< T > arr)
 Overload of hexed::to_string for Arrays.
 
void compute_advection (Kernel_mesh, Kernel_options, double wall_shock_width, double shock_width_growth, int offset)
 
void compute_eikonal (Kernel_mesh, Kernel_options, double convective_safety, double diffusive_safety, std::function< void()> state_bc, std::function< void()> flux_bc, double smoothing, double gradient_smoothing, double base_diffusion)
 
void compute_euler (Kernel_mesh, Kernel_options)
 
std::unique_ptr< Face_permutation_dynamiccompute_face_permutation (int n_dim, int row_size, Connection_direction, double *data, Turbulence_model model)
 
void compute_fix_nonphysical (Kernel_mesh, Kernel_options, std::function< void()> flux_bc)
 
void compute_gradient (Kernel_mesh, Kernel_options, std::function< void()> state_bc, std::function< void()> flux_bc, int read_offset, int write_offset)
 
void compute_navier_stokes (Kernel_mesh, Kernel_options, std::function< void()> flux_bc, Transport_model visc, Transport_model therm_cond, double spec_turb_kin_ener_ambient, double spec_turb_diss_amb)
 
void compute_prolong (Kernel_mesh, bool scale=false, bool offset=false)
 
void compute_prolong_advection (Kernel_mesh)
 
void compute_restrict (Kernel_mesh, bool scale=true, bool offset=false)
 
void compute_smooth_av (Kernel_mesh, Kernel_options, std::function< void()> flux_bc, double diff_time, double chebyshev_step, double wall_shock_width, double shock_width_growth)
 
void compute_write_face (Kernel_mesh)
 
void compute_write_face_advection (Kernel_mesh, int offset)
 
void compute_write_face_smooth_av (Kernel_mesh)
 
template<typename T , typename C >
void erase_if (std::vector< T > &vec, C condition)
 Erase every element x in a vector where condition(x) evaluates to true.
 
void filter_limit (int n_dim, double *data, const Basis &basis, double decay_rate)
 Applies a low-pass filter to polynomial data.
 
template<typename... format_args>
std::string format_str (int max_chars, std::string fstring, format_args... args)
 Standard string formatting.
 
template<typename... format_args>
std::string format_str (std::string fstring, format_args... args)
 sets max_chars to 200.
 
std::string to_string (Is_physical_result)
 
template<template< int, int > typename kernel, typename... constructor_args>
kernel_lookup::ptr_t< kernel > kernel_factory (int n_dim, int row_size, constructor_args &&... args)
 Gets a std::unique_ptr to a base_t of kernel.
 
double max_dt_advection (Kernel_mesh, Kernel_options, double convective_safety, double diffusive_safety, bool local_time)
 
double max_dt_eikonal (Kernel_mesh, Kernel_options, double convective_safety, double diffusive_safety, double smoothing, double gradient_smoothing, double base_diffusion)
 
double max_dt_euler (Kernel_mesh, Kernel_options, double convective_safety, double diffusive_safety, bool local_time)
 
double max_dt_fix_nonphysical (Kernel_mesh, Kernel_options, double convective_safety, double diffusive_safety, bool local_time)
 
double max_dt_navier_stokes (Kernel_mesh, Kernel_options, double convective_safety, double diffusive_safety, bool local_time, Transport_model visc, Transport_model therm_cond, double spec_turb_kin_ener_ambient, double spec_turb_diss_ambient)
 
double max_dt_smooth_av (Kernel_mesh, Kernel_options, double convective_safety, double diffusive_safety, bool local_time)
 
template<>
std::string Namespace::type_name< std::string > ()
 
Eigen::Matrix< double, dyn, dyn, Eigen::RowMajor > read_csv (std::string file_name)
 Reads a CSV file to a matrix.
 
template<typename S , typename T >
trivial_convert (T &t)
 
template<typename ref_t , typename ptr_t >
ref_t ptr_convert (ptr_t &ptr)
 
void stabilizing_art_visc (Kernel_mesh, double char_speed)
 helper function for Solver::set_art_visc_admis
 
std::array< double, 2 > standard_atmosphere (double alt_geom, double temp_offset=0)
 computes the ICAO Standard atmosphere
 
std::array< double, 2 > standard_atmosphere_geopot (double alt_geopot, double temp_offset=0)
 same as standard_atmosphere(), but accepts geopotential altitude instead of geometric
 
constexpr bool is_time_accurate (Time_scheme ts)
 true iff the time scheme can provide accurate transient history
 
constexpr bool is_implicit (Time_scheme ts)
 true iff the scheme uses pseudotime iteration to solve an implicit time marching formula
 
constexpr int n_extra_stage (Time_scheme ts)
 
constexpr int n_total_stage (Time_scheme ts)
 
template<typename T >
Mat to_mat (T begin, T end)
 Constructs an Eigen::VectorXd from iterators begin() and end() to arithmetic types.
 
template<typename T >
Mat to_mat (const T &range)
 Constructs an Eigen::VectorXd from any object supporting begin() and end() members.
 
Mat resize (const Mat<> &vec, Int size)
 Returns a copy of vec resized to size.
 
template<typename T >
gotcha (T)
 don't ask
 
template<typename T >
constexpr bool always_false ()
 
template<typename T >
printed (T t)
 prints its argument and then returns it
 
template<typename T >
T * new_copy (const T &t)
 useful for cppyy which doesn't like to relinquish ownership
 
template<typename T >
T * new_move (T &&t)
 useful for cppyy which doesn't like to relinquish ownership
 
template<typename T >
std::add_pointer< T >::type addr_if_possible (T &arg)
 
template<typename T >
std::add_pointer< T >::type addr_if_possible (T &&arg)
 
std::string file_extension (std::string file_name)
 gets the extension of a file name and converts it to lowercase
 
std::string to_lower (std::string)
 converts a string to lowercase
 
std::string to_string (int)
 Represents its argument as a human-readable string.
 
std::string to_string (Int)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
std::string to_string (double)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
std::string to_string (std::string)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
std::string to_string (const char *)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
std::string to_string (bool)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
std::string to_string (Mat< dyn, dyn > mat)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
std::string to_string (void *)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
std::string to_string (T *p, Int n)
 Represents an array of objects which themselves are representable with to_string()
 
std::string str_cat ()
 Overload of str_cat(T, U...) that returns an empty string.
 
template<typename T , typename... U>
std::string str_cat (T arg, U... args)
 Converts all arguments to strings with to_string() and then concatenates them.
 
std::vector< int > face_vertex_inds (int n_dim, const Connection_direction &)
 The indices required to permute the vertices of face 1 of a connection to match face 0.
 
std::array< std::vector< int >, 2 > vertex_inds (int n_dim, const Connection_direction &)
 The indices of the element vertices which participate in a deformed connection.
 
bool exists (Tree *tree)
 
Storage_params incr_res_cache (Storage_params params)
 
void request_connection (Element &elem, int n_dim, int i_dim, bool i_sign, int j_dim, bool j_sign)
 
Array< int > compute_direction (int n_dim, int i_dim, bool is_positive)
 
Array< int > compute_direction (int n_dim, int i_face)
 
bool has_existent_children (Tree *t)
 
bool is_def (Element &elem)
 
void update_pos (next::Vertex &vert, Mat< 3 > pos)
 
Storage_params read_params (std::string file_name)
 
void write_polymesh_file (std::string dir_name, std::string name, std::string cls, int n_entries, std::function< std::string(int)> entries, std::string note="")
 
void copy_state (Boundary_connection &con)
 
template<int n_dim>
Mat apply_char (Mat<> state, Mat<> normal, int sign, Mat<> inside, Mat<> outside)
 
void reflect_normal (double *gh_f, double *nrml, int nq, int nd)
 
void reflect_momentum (Boundary_connection &con)
 
std::string strip_trailing_digits (std::string s)
 
void force_symlink (const std::filesystem::path &target, const std::filesystem::path &link)
 
void read_char (char *c, int n)
 
Facefind_element_face (Face &face, bool upstream)
 
void find_elements (Face &face, std::vector< Element * > &elems, std::vector< int > bounds, bool upstream)
 
bool is_eol (char c)
 
bool operator== (Connection_direction dir0, Connection_direction dir1)
 
std::string to_string (Connection_direction dir)
 
std::ostream & operator<< (std::ostream &stream, Connection_direction dir)
 
std::vector< Mat< 2, 2 > > segments (const Mat< dyn, dyn > &points)
 
double max_fun (double x, double y)
 
double min_fun (double x, double y)
 
double objective (const std::vector< double > &arg, std::vector< double > &, void *data)
 
bool operator== (Storage_params par0, Storage_params par1)
 
bool operator!= (Storage_params par0, Storage_params par1)
 
std::string to_string (Storage_params par)
 
std::vector< std::string > get_side (std::string code, bool right=false)
 
Array< double > & check (Array< double > &nodes)
 
Array< double > check (Array< double > &&data)
 

Variables

constexpr Int whatever = -1
 used in Array::reshaped()
 
constexpr Int same = -2
 used in Array::reshaped()
 
constexpr Int end = std::numeric_limits<Int>::max()
 can be passed to Array::operator()
 
const auto inviscid = Transport_model::inviscid()
 always returns zero
 
const int dyn = Eigen::Dynamic
 convenience alias for Eigen::dynamic
 
const auto all = Eigen::all
 convenience alias for Eigen::all
 
const auto last = Eigen::last
 convenience alias for Eigen::last
 
constexpr double huge = std::numeric_limits<double>::max()
 convenience alias for largest double value
 
const double heat_rat = 1.4
 
const double dirk2_gamma = 1 - std::sqrt(.5)
 
std::vector< std::array< double, 2 > > alt_temp
 

Detailed Description

Global namespace for all of the C++ API of Hexed.

The purpose of this file is to provide a way to specify the number of dimensions and row size of the kernels at run-time, whereas in the kernel implementations these are compile-time parameters. The idea is that if we require that the parameters be within a finite range, we can simply instantiate the kernel templates for every possible combination of parameters. This is obviously not efficient in terms of compilation work load or executable size, but it provides optimal execution speed and run-time flexibility, which for our purpose is more important.

Function Documentation

◆ erase_if()

template<typename T , typename C >
void hexed::erase_if ( std::vector< T > & vec,
C condition )

Erase every element x in a vector where condition(x) evaluates to true.

Complexity is O(vec.size()) regardless of number of elements to be deleted. Thus this is much more efficient than repeatedly calling vec.erase if multiple elements which are not in a contiguous range are to be erased.

◆ filter_limit()

void hexed::filter_limit ( int n_dim,
double * data,
const Basis & basis,
double decay_rate )

Applies a low-pass filter to polynomial data.

Limits the Legendre modes of multidimensional polynomial such that an \(n\)th degree mode will have norm no more than decay_rate \(^n\). Each mode which violates this condition is scaled to the largest value that satisfies it. Thus, if decay_rate == 1 then the data will never be altered, whereas if decay_rate == 0 then all the modes except the 0th-degree will be annhilated. data is assumed to point to the values of a scalar polynomial at the n_dim-dimensional quadrature points associated with the provided basis and thus must have size math::pow(basis.row_size, n_dim).

◆ format_str()

template<typename... format_args>
std::string hexed::format_str ( int max_chars,
std::string fstring,
format_args... args )

Standard string formatting.

Basically a knockoff of std::format in C++20 (which at the time of writing we can't use on the lab machines). Invokes snprintf, but works in terms of std::strings and handles buffer creation for you. If length of resulting string is greater than max_chars, it will iteratively allocate more characters.

◆ kernel_factory()

template<template< int, int > typename kernel, typename... constructor_args>
kernel_lookup::ptr_t< kernel > hexed::kernel_factory ( int n_dim,
int row_size,
constructor_args &&... args )

Gets a std::unique_ptr to a base_t of kernel.

The underlying kernel will be instantiated with n_dim and row_size provided as template arguments. Arguments must satisfy 3 >= n_dim > 0 and config::max_row_size >= row_size > 1.

◆ printed()

template<typename T >
T hexed::printed ( T t)

prints its argument and then returns it

you can wrap this around an expression to print it without computing it again

◆ read_csv()

Eigen::Matrix< double, dyn, dyn, Eigen::RowMajor > hexed::read_csv ( std::string file_name)

Reads a CSV file to a matrix.

Reads a table of data from an ASCII file in Comma Separated Value format. Every row must have the same number of columns. Each entry must contain exactly one numeric literal, preceded and/or followed by zero or more spaces and/or tabs, and nothing else. Thus trailing commas are not allowed, as this would be construed as an empty column. File extension does not matter. Blank lines are not allowed.

◆ resize()

Mat hexed::resize ( const Mat<> & vec,
Int size )

Returns a copy of vec resized to size.

If size is less than vec.size(), the trailing entries are deleted. If size is greater than vec.size(), trailing zeros are appended. Otherwise, entries are preserved.

◆ stabilizing_art_visc()

void hexed::stabilizing_art_visc ( Kernel_mesh mesh,
double char_speed )

helper function for Solver::set_art_visc_admis

Sets the Element::uncertainty in the elements based on the smoothness of specific volume char_speed determines a final linear scaling parameter (usually based on the characteristic speed of the flow)

◆ standard_atmosphere()

std::array< double, 2 > hexed::standard_atmosphere ( double alt_geom,
double temp_offset = 0 )

computes the ICAO Standard atmosphere

Valid from 0 to 80km.

Parameters
alt_geomGeometric altitude (as opposed to geopotential altitude)
temp_offsetTemperature will be incremented by temp_offset relative to the standard atmosphere without changing the pressure.
Returns
density and pressure (in that order)
See also
Units and physical quantities

◆ to_string() [1/2]

template<typename T >
std::string hexed::to_string ( Array< T > arr)

Overload of hexed::to_string for Arrays.

Works as long as to_string(T) is defined.

◆ to_string() [2/2]

std::string hexed::to_string ( int i)

Represents its argument as a human-readable string.

like std::to_string, but overloaded for some hexed types. There should be overloads for most things you might want to print. If you want an overload that isn't here, let me know.

◆ vertex_inds()

std::array< std::vector< int >, 2 > hexed::vertex_inds ( int n_dim,
const Connection_direction & direction )

The indices of the element vertices which participate in a deformed connection.

Ordering is such that vertices which must be merged correspond in the lists and the vertices of face 0 are ordered in the same way as they would be if the face were considered in isolation.

Variable Documentation

◆ alt_temp

std::vector<std::array<double, 2> > hexed::alt_temp
Initial value:
{
{ 0., 288.15},
{11000., 216.65},
{20000., 216.65},
{32000., 228.65},
{47000., 270.65},
{51000., 270.65},
{71000., 214.65},
{80000., 196.65},
}