UM2N.test package

Submodules

UM2N.test.bench_burgers module

class BurgersEvaluator(mesh, mesh_fine, mesh_new, dataset, model, eval_dir, ds_root, 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.

eval_problem()[source]

Solves the Burgers equation.

get_error()[source]
make_log_dir()[source]
make_plot_data_dir()[source]
make_plot_dir()[source]
make_plot_more_dir()[source]
project_u_()[source]
get_first_entry(dataset, target_idx)[source]
get_log_og(log_path, idx)[source]

Read log file from dataset log dir and return value in it

UM2N.test.bench_helmholtz module

UM2N.test.bench_swirl module

class SwirlEvaluator(mesh, mesh_coarse, mesh_fine, mesh_new, mesh_model, dataset, model, eval_dir, ds_root, **kwargs)[source]

Bases: object

Evaluate error for advection swirl problem:
  1. Solver implementation for the swirl problem

  2. Error & Time evaluation

Init the problem:
  1. define problem on fine mesh and coarse mesh

  2. init function space on fine & coarse mesh

eval_problem(model_name='model')[source]
get_error()[source]
make_log_dir()[source]
make_plot_data_dir()[source]
make_plot_dir()[source]
make_plot_more_dir()[source]
plot_res()[source]
project_u_()[source]
solve_u(t)[source]

Solve the PDE problem using RK (SSPRK) scheme on the coarse mesh store the solution field to a varaible: self.u_cur

solve_u_fine(t)[source]

Solve the PDE problem using RK (SSPRK) scheme on the fine mesh store the solution field to a varaible: self.u_cur_fine

vis_evaluate(sample)[source]

It would be great if we have some visuals here to assist out judgment.

get_log_og(log_path, idx)[source]

Read log file from dataset log dir and return value in it

UM2N.test.burgers_bench module

UM2N.test.compare_hlmhltz module

compare_error(data_in, mesh, mesh_fine, mesh_model, mesh_MA, num_tangle, model_name, problem_type='helmholtz')[source]

UM2N.test.stat module

write_stat(eval_dir, log_folder_name='log')[source]

UM2N.test.tangle module

check_dataset_tangle(dataset, model, n_elem_x, n_elem_y)[source]

Return the percentage of tangling grid of a mesh in a dataset.

plot_prediction(data_set, model, prediction_dir, mode, n_elem_x, n_elem_y, loss_fn, savefig=True)[source]
plot_sample(model, val_item, prediction_dir, loss_fn, n_elem_x, n_elem_y, idx, mode, savefig=True)[source]

Module contents