File initialprofiles.hxx

Functions

void initial_profile(const std::string &name, Field3D &var)

Set a field from options

This is called by Solver for each evolving field at the beginning of a simulation.

To create the value, it looks for a setting “function” in a section called name. If that is not found, then it looks for “function” in a section called “All”. If that is also not found, then the value defaults to zero.

Parameters
  • name: The name of the field. This will be used as the section name in the options
  • var: The field, which will be set to a value depending on the options

A second variable, “scale”, can be used to multiply the function, and defaults to 1.0

Example

Given the input file:

[All] function = sin(y)

[pressure]

[density] scale = 0.2

[vorticity] function = cos(y)

initial_profile would generate:

o pressure -> sin(y) o density -> 0.2*sin(y) o vorticity -> cos(y)

void initial_profile(const std::string &name, Field2D &var)

Set a Field2D from options

Parameters
  • name: The name of the field, used as a section name
  • var: The field which will be set to a value

void initial_profile(const std::string &name, Vector2D &var)

Set a vector to a value. The options used depend on whether the vector is covariant or contravariant.

If covariant, then each component will be initialised by adding “_x”, “_y”, “_z” to the name.

If contravariant, then each component will be initialised by adding “x”, “y” and “z” to the name.

void initial_profile(const std::string &name, Vector3D &var)

Set a vector to a value. The options used depend on whether the vector is covariant or contravariant.

If covariant, then each component will be initialised by adding “_x”, “_y”, “_z” to the name.

If contravariant, then each component will be initialised by adding “x”, “y” and “z” to the name.