dts_operators module
dts_operators.stress_visualization
Convenience module for running Fedem stress recovery with CUG export as an operator. Usage: Invoke run(df) with the input data in the DataFrame df.
dts_operators.submodel
Convenience functions for running FEDEM sub-model simulations as an operator. To use, call sub_model_run(df) with input data in df.
dts_operators.window
Convenience module for running Fedem simulations as an operator. Usage: Invoke run(df) with the input data in the DataFrame df.
- fedempy.dts_operators.window.run(df, dts=None, **kwargs)[source]
Run Fedem simulation over a time window with df as input.
- Parameters:
- dfDataFrame
Input function values
- dtsDTSContext, default=None
State data to be passed between each micro-batch
- kwargsdict
Dictionary containing output definitions and/or solver options
- Returns:
- DataFrame
Response values in output sensors
- fedempy.dts_operators.window.start_fmm_solver(fmm_file, lib_dir, use_state=False, old_state=None, ext_input=None, t_start=None, keep_old_res=True)[source]
Starts the dynamics solver on the provided Fedem model file.
- Parameters:
- fmm_filestr
The Fedem model file to run simulation on
- lib_dirstr
Path to where the model file is located, used only if fmm_file is a relative path
- use_statebool, default=False
If True, internal state vectors will be allocated
- old_statelist of float, default=None
State vector to restart simulation from
- ext_inputlist of float, default=None
Initial external function values, for initial equilibrium iterations
- t_startfloat, default=None
Optional start time of simulation, override setting in model file
- keep_old_resbool, default=True
Option to not overwrite any existing res-file in the RDB directory
- Returns:
- FmmSolver
The dynamics solver object
- int
Zero on success, negative values indicate errors
- fedempy.dts_operators.window.start_solver(solver_options, cw_dir, use_state=False, old_state=None, ext_input=None, tstart=None)[source]
Starts the dynamics solver with the provided command-line options.
- Parameters:
- solver_optionslist of str
List of command-line arguments that are passed to the solver
- cw_dirstr
Path to working directory of the solver process
- use_statebool, default=False
If True, internal state vectors will be allocated
- old_statelist of float, default=None
State vector to restart simulation from
- ext_inputlist of float, default=None
Initial external function values, for initial equilibrium iterations
- tstartfloat, default=None
Optional start time of simulation, override setting in model file
- Returns:
- FedemSolver
The dynamics solver object
- int
Zero on success, negative values indicate errors
dts_operators.driver
Convenience drivers for running FEDEM simulations as an operator.
These drivers can also take the model input as low-code (python) or no-code (yaml) files, and the corresponding fmm-file of the model will then be generated the first time the operator is invoked.
- fedempy.dts_operators.driver.run_stress_visualization(df, **kwargs)[source]
Run batch fedem simulation with df as input, to create CUG stress visualization of the FE-parts.
- Parameters:
- dfDataFrame
Input function values
- kwargsdict
Dictionary containing output definitions and/or solver options
- fedempy.dts_operators.driver.run_window(df, dts=None, **kwargs)[source]
Run fedem simulation with df as input.
- Parameters:
- dfDataFrame
Input function values
- dtsDTSContext, default=None
State data to be passed between each micro-batch
- kwargsdict
Dictionary containing output definitions and/or solver options
- Returns:
- Dataframe
Response values in output sensors
dts_operators.fmm_creator
Utility module, for generating fmm-files from low/no-code model files.
- fedempy.dts_operators.fmm_creator.create_fmm(lib_dir, fmm_file=None, mod_file=None)[source]
Creates a Fedem model file (fmm) based on a low-code (python) or no-code (yaml) model file. If the fmm_file is specified directly, that file will be used instead. If the lib_dir folder already contains fmm-files, the first one found will be used. This will be the case when starting a new micro-batch in a streaming app.
- Parameters:
- lib_dirstr
Absolute path to directory where the fmm-file should be stored
- fmm_filestr, default=None
Name of fmm-file, if provided explicitly
- mod_filestr, default=None
Name of low/no-code model file to generate fmm-file from
- Returns:
- str
Absolute path to (generated) fmm-file