hexed 0.4.0
 
Loading...
Searching...
No Matches
Command Variables

These are heisenberg variables that cause the solver to perform actions when you evaluate them. Unlike Solver Macros, you do not need to use the $ operator to invoke them; simply place the name of the variable in its own statement (which will cause the interpreter to evaluate it but not assign it to anything). Most of them evaluate to the empty string {} so that you can use them like a shell command in an interactive session. They are typically used internally by the builtin Solver Macros, but you can also use them directly.


compute_residuals
Evaluates the residuals and assigns them to float variables residual_momentum, residual_density, residual_energy. Also updates the spectral uncertainty in each element.

create_solver
Creates a hexed::Solver object. Mesh contains a single element and the flow is uninitialized.

init_state
Initializes the state to init_cond

integrate_field
Computes integrals of the variables in integrand_field over the domain by the native quadrature rule of the numerical scheme. The integrals of the variables are assigned to float variables named integral_field_VAR where VAR is the name of the variable.

integrate_surface
Computes integrals of the variables in integrand_surface over the geometry surface by the native quadrature rule of the numerical scheme. The integrals of the variables are assigned to float variables named integral_surface_var where var is the name of the variable.

mesh
Creates the mesh, performs initial refinement, and incorporates the surface geometry. You can define 0 or more string variables named geom0, geom1, geom2, ... containing paths to geometry definition files. Paths can be absolute or relative to execution directory (not working_dir). Geometry variable numbers must start at 0 and be consecutive. E.g., if you define geom0 = leading.txt, geom1 = main.txt, geom3 = trailing.txt, then geom3 will be ignored. If these geometries split the domain into disjoint regions, then the region containing the flood fill start shall be meshed. Geometry file format is inferred from the file extension, which is case-insensitive. The following extension/format combinations are supported:
  • .csv: Comma Separated Value format (2D only). A comma-delimited table with at least 2 columns, which are interpreted as \( x_0 \) and \( x_1 \) coordinates of the nodes of a polygonal curve, in standard units. Curve is treated as open—if you are trying to model a closed shape, simply make the first point (approximately) equal to the last.
  • .igs, .iges: IGES CAD format (2D or 3D). For 2D simulations, the model curves/edges will be extracted. All curves must (approximately) lie in the \( (x_0, x_1) \) plane, and any deviation from said plane will be a source of numerical error. For 3D simulations, the model surfaces will be used. Units are read from the file and converted. Files must be in ASCII format (there is also a binary format, although this is less common). Both GNU/Linux and Windows line endings are accepted.

read_mesh
Reads the mesh from a Hexed mesh file (which you can create using write_mesh). This can be used in place of mesh, but you will still have to call init_state or read_state to initialize the flow state. The file name of the mesh file given by input_data with .mesh.h5 appended.

read_state
Reads the flow state from a file created with the write_state command. The file name is given by input_data with .state.h5 appended. The state file must have been created for the exact same mesh, meaning that if the state file was not created during the same simulation you're currently running, you need to first use read_mesh to get the mesh. Two meshes that look the same might not actually be the same for a variety of reasons. For example, if elements were refined in a different order, then you cannot use the same state files, even if the mesh is geometrically identical. So, just play it safe and read the mesh first. This command can be used instead of init_state. read_mesh and read_state together can be used to restart a previous simulation from where it left off.

read_status
Reads HIL variables from a file created with the write_status command.

update
Executes print_freq solver iterations and returns an empty string. Each "solver iteration" consists of:
  1. Calling hexed::Solver::set_art_visc_constant, if applicable.
  2. Calling hexed::Solver::update_art_visc_smoothness, if applicable. This will itself update the artificial viscosity advection equations av_advect_iters times and the diffusion equations av_diff_iters times.
  3. Calling hexed::Solver::update. This will itself update the flow equations flow_iters times (where flow_iters defaults to 1 for simulations without shock-capturing).

visualize
Writes visualization files.

write_mesh
Writes the mesh to a file in the Hexed mesh format, which can then be used again in a future simulation using read_mesh, or, in theory, imported into another program. The file name will be iterXXXXXXXXXX.mesh.h5 in the working directory, where the Xs are replaced with the current iteration number. Also creates a symlink latest.mesh.h5 pointing to this file for convenience.

write_state
Writes the flow state to a file which can then be used in a future simulation using read_state. The file name will be iterXXXXXXXXXX.state.h5 in the working directory, where the Xs are replaced with the current iteration number. Also creates a symlink latest.state.h5 pointing to this file for convenience.

write_status
Writes the flow state to a file which can then be used in a future simulation using read_state. The file name will be iterXXXXXXXXXX.state.h5 in the working directory, where the Xs are replaced with the current iteration number. Also creates a symlink latest.state.h5 pointing to this file for convenience.