burgers module¶
Burgers dataset¶
This Dataset
contains solutions to the Burgers’ equation with
periodic boundary conditions on the interval \([0, 2\pi]\) for different
time steps:
An analytical expression can be obtained for the solution, using the Cole-Hopf transform:
where \(\phi\) is solution to the heat equation \(\phi_t = \nu \phi_{xx}\).
This Dataset
is based on a full-factorial
design of experiments. Each sample corresponds to a given time step \(t\),
while each feature corresponds to a given spatial point \(x\).
- class gemseo.problems.dataset.burgers.BurgersDiscipline[source]
Bases:
MDODiscipline
A software integrated in the workflow.
To be used, subclass
MDODiscipline
and implement the_run()
method which defines the execution of the software. Typically,_run()
gets the input data stored in thelocal_data
, passes them to the callable computing the output data, e.g. a software, and stores these output data in thelocal_data
.Then, the end-user calls the
execute()
method with optionalinput_data
; if not,default_inputs
are used.This
execute()
method uses name grammars to check the variable names and types of both the passed input data before callingrun()
and the returned output data before they are stored in thecache
. A grammar can be either aSimpleGrammar
or aJSONGrammar
, or your own which derives fromBaseGrammar
.- cache: AbstractCache | None
The cache containing one or several executions of the discipline according to the cache policy.
- data_processor: DataProcessor
A tool to pre- and post-process discipline data.
- exec_for_lin: bool
Whether the last execution was due to a linearization.
- input_grammar: BaseGrammar
The input grammar.
- jac: dict[str, dict[str, ndarray]]
The Jacobians of the outputs wrt inputs.
The structure is
{output: {input: matrix}}
.
- name: str
The name of the discipline.
- output_grammar: BaseGrammar
The output grammar.
- re_exec_policy: ReExecutionPolicy
The policy to re-execute the same discipline.
- residual_variables: Mapping[str, str]
The output variables mapping to their inputs, to be considered as residuals; they shall be equal to zero.
- run_solves_residuals: bool
Whether the run method shall solve the residuals.
- gemseo.problems.dataset.burgers.create_burgers_dataset(n_samples=30, n_x=501, fluid_viscosity=0.1, categorize=True)[source]
Burgers dataset parametrization.
- Parameters:
n_samples (int) –
The number of samples.
By default it is set to 30.
n_x (int) –
The number of spatial points.
By default it is set to 501.
fluid_viscosity (float) –
The fluid viscosity.
By default it is set to 0.1.
categorize (bool) –
Whether to distinguish between the different groups of variables.
By default it is set to True.
- Returns:
The Burgers dataset.
- Return type: