AdvectionDiffusionModel

class pyapprox.fenics_models.advection_diffusion_wrappers.AdvectionDiffusionModel(final_time, degree, qoi_functional, second_order_timestepping=True, options={})[source]

Bases: object

Methods Summary

__call__(samples)

Call self as a function.

get_boundary_conditions_and_function_space(…)

By Default the boundary conditions are deterministic, Dirichlet and and set to zero

get_diffusivity(random_sample)

Use the random diffusivity specified in [JEGGIJNME2020].

get_forcing(random_sample)

By Default the forcing is deterministic and set to

get_initial_condition(random_sample)

By Default the initial condition is deterministic and set to zero

get_mesh(resolution_levels)

The arguments to this function are the outputs of get_degrees_of_freedom_and_timestep()

get_mesh_resolution(mesh_levels)

get_timestep(dt_level)

get_velocity(random_sample)

By Default the advection is deterministic and set to zero

initialize_random_expressions(random_sample)

Overide this class to split random_samples into the parts that effect the 5 random quantities

set_num_config_vars()

Should be equal to the number of physical dimensions + 1 (for the temporal resolution)

solve(samples)

Run the simulation

Methods Documentation

__call__(samples)[source]

Call self as a function.

get_boundary_conditions_and_function_space(random_sample)[source]

By Default the boundary conditions are deterministic, Dirichlet and and set to zero

get_diffusivity(random_sample)[source]

Use the random diffusivity specified in [JEGGIJNME2020].

get_forcing(random_sample)[source]

By Default the forcing is deterministic and set to

\[(1.5+\cos(2\pi t))*cos(x_1)\]

where \(t\) is time and \(x_1\) is the first spatial dimension.

get_initial_condition(random_sample)[source]

By Default the initial condition is deterministic and set to zero

get_mesh(resolution_levels)[source]

The arguments to this function are the outputs of get_degrees_of_freedom_and_timestep()

get_mesh_resolution(mesh_levels)[source]
get_timestep(dt_level)[source]
get_velocity(random_sample)[source]

By Default the advection is deterministic and set to zero

initialize_random_expressions(random_sample)[source]

Overide this class to split random_samples into the parts that effect the 5 random quantities

set_num_config_vars()[source]

Should be equal to the number of physical dimensions + 1 (for the temporal resolution)

solve(samples)[source]

Run the simulation

Notes

Dolfin objects must be initialized inside this function otherwise this object cannot be pickled and used with multiprocessing.Pool