tardis.simulation.convergence module¶
- class tardis.simulation.convergence.ConvergenceSolver(strategy)[source]¶
Bases:
objectConvergence solver. Sets convergence strategy and assigns a method to the converge property.
- Parameters:
- strategystring
Convergence strategy for the physical property
- Raises:
- NotImplementedError
Custom convergence type specified
- ValueError
Unknown convergence type specified
- adaptive_damped(value, estimated_value)[source]¶
Adaptive damped convergence solver
Dynamically updates the damping factor by locally searching around the current value and selecting the step that minimizes the residual
- Parameters:
- valuenp.float64
The current value of the physical property
- estimated_valuenp.float64
The estimated value of the physical property
- Returns:
- np.float64
Updated value after applying adaptive damping
Notes
The damping factor is updated in place and constrained in the interval [lambda_min, lambda_max]
- damped_converge(value, estimated_value)[source]¶
Damped convergence solver
- Parameters:
- valuenp.float64
The current value of the physical property
- estimated_valuenp.float64
The estimated value of the physical property
- Returns:
- np.float64
The converged value
- get_convergence_status(value, estimated_value, no_of_cells)[source]¶
Get the status of convergence for the physical property
- Parameters:
- valuenp.float64, Quantity
The current value of the physical property
- estimated_valuenp.float64, Quantity
The estimated value of the physical property
- no_of_cellsnp.int64
The number of cells to measure convergence over
- Returns:
- bool
True if convergence is reached