Ignition Riemann¶
Language¶
Defines the Riemann language
- class ignition.riemann.language.Conserved[source]¶
Represents a conserved variable
For multi-dimension variables, the dimension can be set with fields or with dim.
The given a list of expressions, jacobian will compute the jacobian of the expressions with respect to the fields of the conserved variable.
Examples:
>>> q = Conserved('q', dim=2) >>> q_0, q_1 = q.fields() >>> q.jacobian([.5*q_0+q_1, q_1**2]) [0.5, 1] [ 0, 2*q_1] >>> nq = Conserved('nq') >>> u, uh = nq.fields(['u', 'uh']) >>> nq.jacobian([.5*u+uh, uh**2]) [0.5, 1] [ 0, 2*uh]
- fields(list_of_names=None)[source]¶
Generates and returns the fields inside the conserve fields.
If list of names is given, the fields are named accordingly once initialized with different names the names field is ignored.
If a dimension wasn’t set when the Conserved object was constructed, the dimension is determined from the number of names. If the number of names and the dimension are different, an error is thrown.
Generator¶
Generator for simple Riemann solver
- class ignition.riemann.generator.Generator(**kws)[source]¶
Manager of the code generation of Riemann problem kernels of the form:
q_t + f(q)*q_x = 0, or q_t + A * q_x = 0
The conserved variable (q) and either the flux (f) or the jacobian (A) must be provided. See either demos/Riemann or Riemann.language for defining these variables.
Parameters (see help(Generator.parameter) for more details):
- conserved
- The conserved field passed to the generated kernel.
- flux
- The flux being solved.
- A
- The jacobian of the flux.
- constant_fields
- Constant fields used by generate passed via aux_{l,r}.
- eig_method
- Generation method for solving eigen decompostion of A.
- evaluation
- The evaluation type for single kernel.
- jacobian_averaging
- The method for averaging left and right values of a cell interface used in the kernel.
- language
- Language to generate.
- A[source]¶
The jacobian of f(q) of the hyperbolic system q_t + f(q)*q_x = 0.
If f is provided but not A, then A will be generated.
- eig_method[source]¶
The method for the generating the eigen decomposition of A.
- Options:
- “analytic” - Using symbolic expression generate the analytic values
- of the eigenvalue decomposition. Throws SymbolicEigenvalueError if unable to formulate the analytic eigen decomposition
- “numerical” - Generates a simple eigenvalue decomposition algorithm
- in the generated kernel.
- “auto” (default) - Tries symbolic generation but if it fails it a
- simple numerical eigen solver will be generated.
- evaluation[source]¶
The evaluation method of the generated kernel.
- Options:
- “pointwise” (default) - the kernel will expect a single point for
- left and right values of a cell.
- “vectorized” - the kernel will expect a vector of points for left
- and right values of cells.
- jacobian_averaging[source]¶
The jacobian_averaging method of the generated kernel.
- Options:
- “arithmetic” (default) - Any evaluation over a cell interface
- required by the jacobian will use an average of the left and right states.
- “LR_eigs” - A left and right jacobian will be formed and the
- eigen decomposition of each will operate on the appropriate plus or minus fluctuation (amdq or apdq).
RiemannPrinter¶
Base classes for code printers