report.NonlinearResiduals#

class NonlinearResiduals#

Bases: BaseChart2D

Residuals is an object for showing the solution history of nonlinear residuals.

Attributes

fig_name: str, optional#

Name of the figure file or identifier for the chart (). Only ‘^[a-zA-Z0-9._-]+$’ allowed.

Default:

None

fig_size: float#

Relative size of the figure as a fraction of text width.

Default:

0.7

items_in_row: int, optional#

Number of items to display in a row within the chart section.

Default:

None

select_indices: list[int], optional#

Specific indices to select for the chart.

Default:

None

separate_plots: bool, optional#

If True, each residual component is plotted in a separate subplot.

Default:

True

force_new_page: bool#

If True, starts the chart on a new page in the report.

Default:

False

caption: str | list[str] | PatternCaption, optional#

Caption to be shown for figures.

Default:

''

operations: list[Average | Expression | GetAttribute] | Average | Expression | GetAttribute, optional#

List of operations to perform on the data.

Default:

None

focus_x: tuple[float, float], optional#
Default:

None

xlim: ManualLimit | tuple[float, float], optional#

Limits for the x-axis. Can be a tuple (xmin, xmax) or a ManualLimit.

Default:

None

ylim: ManualLimit | SubsetLimit | FixedRangeLimit | tuple[float, float], optional#

Defines the range of y values that will be displayed on the chart. This helps with highlighting a desired portion of the chart.

Default:

None

show_grid: bool, optional#

If True, grid lines are displayed on the plot. Defaults to True.

Default:

True

Additional Constructors

classmethod from_file(filename)#

Loads a Flow360BaseModel from .json, or .yaml file.

Parameters:

filename (str) – Full path to the .yaml or .json file to load the Flow360BaseModel from.

Returns:

An instance of the component class calling load.

Return type:

Flow360BaseModel

Example

>>> params = Flow360BaseModel.from_file(filename='folder/sim.json') 

Methods

get_requirements()#

Returns requirements for this item.

is_log_plot()#

Determines if the plot is logarithmic.

Return type:

bool

get_data(cases, context)#

Loads and processes data for creating a 2D plot model.

Parameters:
  • cases (List[Case]) – A list of simulation cases to extract data from.

  • context (ReportContext) – The report context providing additional configuration and case-specific data.

Returns:

A PlotModel instance containing the processed x and y data, axis labels, legend, and optional background image for plotting.

Return type:

PlotModel

Notes

  • Handles data with physical units and ensures dimensional consistency.

  • Supports optional background images for geometry-related plots.

  • Automatically determines y-axis limits if focus_x is specified.

Examples

>>> chart = Chart2D(
...     x="x_slicing_force_distribution/X",
...     y="x_slicing_force_distribution/totalCumulative_CD_Curve",
...     background="geometry"
... )
>>> plot_model = chart.get_data(cases, context)
>>> fig = plot_model.get_plot()
>>> fig.show()
get_doc_item(context, settings=None)#

Returns doc item for chart.

Parameters:
  • context (ReportContext)

  • settings (Settings | None)

Return type:

None

help(methods=False)#

Prints message describing the fields and methods of a Flow360BaseModel.

Parameters:

methods (bool = False) – Whether to also print out information about object’s methods.

Return type:

None

Example

>>> params.help(methods=True) 
to_file(filename, **kwargs)#

Exports Flow360BaseModel instance to .json or .yaml file

Parameters:

filename (str) – Full path to the .json or .yaml or file to save the Flow360BaseModel to.

Return type:

None

Example

>>> params.to_file(filename='folder/flow360.json')