UM2N.generator package¶
Submodules¶
UM2N.generator.burgers_solver module¶
- class BurgersSolver(mesh, mesh_fine, mesh_new, idx, **kwargs)[source]¶
Bases:
object
Solves the Burgers equation Input: - mesh: The mesh on which to solve the equation. - dist_params: The parameters of the Gaussian distribution.
Initialise the solver. kwargs: - nu: The viscosity of the fluid. - dt: The time interval.
UM2N.generator.equation_generator module¶
UM2N.generator.equation_solver module¶
UM2N.generator.mesh_generator module¶
- class MeshGenerator(params={'eq': None, 'mesh': None, 'num_grid_x': None, 'num_grid_y': None})[source]¶
Bases:
object
- Responsible for generating and moving a mesh based on a given Helmholtz
equation.
This method is based on Pyroteus/movement.
Attributes: - eq: The Helmholtz equation object. - num_grid_x: Number of grid points in the x-dimension. - num_grid_y: Number of grid points in the y-dimension. - mesh: The initial m esh.
- get_hessian(mesh)[source]¶
Computes and returns the Hessian of the Helmholtz equation on the given mesh.
Parameters: - mesh: The mesh on which to compute the Hessian.
Returns: - The Hessian as a projection in the function space.
UM2N.generator.polymesh module¶
UM2N.generator.rand_source_generator module¶
- class RandSourceGenerator(use_iso=False, dist_params={'c_max': 0.8, 'c_min': 0.2, 'max_dist': 10, 'n_dist': None, 'sigma_eps': 0.125, 'sigma_mean_scaler': 0.25, 'sigma_sigma_scaler': 0.16666666666666666, 'w_max': 0.2, 'w_min': 0.05, 'x_end': 1, 'x_start': 0, 'y_end': 1, 'y_start': 0, 'z_max': 1, 'z_min': 0})[source]¶
Bases:
object
Class for generating a random Helmholtz equation based on a Gaussian distribution.
- Attributes:
simple_u (bool): Flag for using simpler form of u. dist_params (dict): Parameters for Gaussian distribution. u_exact: Analytical Helmholtz equation solution. f: Simulated source function. function_space: Function space for problem. LHS: Left-hand side of Helmholtz equation. RHS: Right-hand side of Helmholtz equation. bc: Dirichlet boundary condition.
Initialize RandomHelmholtzGenerator.
- Parameters:
- simple_u (bool): Use simpler form of u (isotripic dataset) if True.
Default False.
dist_params (dict): Parameters for Gaussian distribution.
- get_dist_params()[source]¶
Return dictionary containing distribution parameters.
- Returns:
dict: Dictionary of distribution parameters.
UM2N.generator.squaremesh module¶
UM2N.generator.swirl_demo module¶
UM2N.generator.swirl_solver module¶
- class SwirlSolver(mesh, mesh_fine, mesh_new, mesh_model, **kwargs)[source]¶
Bases:
object
- Solver for advection swirl problem:
Solver implementation for the swirl problem
Mesh mover for the swirl problem
Error & Time evaluation
- Init the problem:
define problem on fine mesh and coarse mesh
init function space on fine & coarse mesh
define hessian solver on coarse mesh
- eval_problem(model, ds_root, eval_dir, model_name='model', callback=None, fail_callback=None, device='cuda')[source]¶
UM2N.generator.swirl_solver_step module¶
- class SwirlSolver(mesh, mesh_fine, mesh_new, **kwargs)[source]¶
Bases:
object
- Solver for advection swirl problem:
Solver implementation for the swirl problem
Mesh mover for the swirl problem
Error & Time evaluation
- Init the problem:
define problem on fine mesh and coarse mesh
init function space on fine & coarse mesh
define hessian solver on coarse mesh