Skip to content

DimredRun

This class can be used in order to comfortably represent multiple D3plot samples in a 3D graph through dimensionality reduction. In the 3D graph every simulation is a data point and the closeness of the data points represents the similarity of the result field. It offers functions to:

  • Subsample simulations to reduce the computational effort and account for different meshing.
  • Reduce order which is the black magic reducing complex field results to a few numbers which can then be plotted in 3D.
  • Clustering with sklearn to group simulations semi-automatically (mostly just a visual feature).
  • Output 3D similarity plot as a webpage

For ease of use, check out the Tool section, which explains the command line tool for this dimensionality reduction feature.

Class to control and run the dimensionality reduction process

__init__(simulation_runs, start_stage, end_stage, project_dir, html_name='3d-beta-plot', html_set_timestamp=False, reference_run=None, console=None, img_path=None, exclude_runs=None, logfile_filepath=None, n_processes=1, part_id_filter=None, timestep=-1, show_output=True, cluster_args=None, outlier_args=None)

Class handling a dimensionality reduction

Parameters:

Name Type Description Default
simulation_runs Sequence[str]

simulation runs to analyze

required
start_stage str

where to start

required
end_stage str

where to stop

required
project_dir Union[None, str]

required project directory for creation of buffer files. Allows restart in between.

required
html_name str

Name of the output .html file

'3d-beta-plot'
html_set_timestamp bool

If true, the output .html will include a timestamp (hh_mm_ss) at the end of the filename

False
reference_run str

filepath to the reference run. If not set, first entry in simulation_runs will be used as reference run.

None
console Union[Console, None]

Console for information printing and logging. Rich offers pretty text printing, syntax highlighting etc.

None
img_path Union[None, str]

optional image directory to show images in visualization.

None
exclude_runs Union[None, Sequence[str]]

optional list of runs to exclude from processing

None
logfile_filepath Union[str, None]

path of the log file (always appends)

None
n_processes int

number of processes to use during execution

1
part_id_filter Union[None, Sequence[int]]

which part ids to process

None
timestep int

specifies timestep to analyze in clustering and show in output visualization

-1
show_output bool

Set to false not to show the output html in the browser

True
cluster_args Union[None, Sequence[str]]

Arguments for cluster algorithm

None
outlier_args Union[None, Sequence[str]]

Arguments for outlier detection algorithm

None

Notes

Using a project directory allows to restart stages of the entire
process.

process_reference_run()

Process the reference run

subsample_to_reference_run()

Subsamples all runs

dimension_reduction_svd()

Calculate V_ROB and Betas

clustering_results()

clustering results

visualize_results()

creates an output .html file