def jacobian(self, x): # J = [f_{x_j}] # J = [\grad{f_i}^T] # J_{ij} = f_{i, x_j } # x.shape = (num_dims, points.shape) # return shape (output_shape, num_dims, points.shape) raise errors.MissingDerivedImplementation("XFunctions", "jacobian")
def solve_states(self, left_state, right_state, x, t, n): # state.shape (num_eqns) # x.shape (num_dims) # t scalar # n.shape (num_dims), left to right normal vector raise errors.MissingDerivedImplementation("RiemannSolver", "solve_states")
def explicit_time_step(self, q_old, t_old, delta_t, rhs_function, event_hooks=dict()): errors.MissingDerivedImplementation("LowStorageExplicitRungeKutta", "explicit_time_step")
def x_jacobian(self, q, x, t): # x_jacobian(output_shape, i, points_shape) is partial derivative of all # outputs with respect to x_i # q.shape (num_eqns, points.shape) # x.shape (num_dims, points_shape) # t scalar # return shape (output_shape, num_dims, points.shape) raise errors.MissingDerivedImplementation("FluxFunction", "x_jacobian")
def t_derivative(self, q, x, t): # derivative of all equations in all dimensions with respect to t # q.shape (points.shape, num_eqns) # x.shape (points.shape, num_dims) # t scalar # return shape (num_eqns, num_dims, points.shape) raise errors.MissingDerivedImplementation("FluxFunction", "t_derivative")
def gauss_pts_and_wgts_interface_mesh_vertex_list(quad_order, vertex_list): # Approximate integral of function over interface in mesh # f face in mesh # \dintt{f}{g(x)}{x} = \sum{i}{w_i g(x_i)} # vertex_list.shape (num_vertices_per_face, num_dims) # return (quad_pts, quad_wgts) # quad_pts.shape = (num_points, num_dims) # quad_wgts.shape = (num_points,) raise errors.MissingDerivedImplementation( "CanonicalElement", "gauss_pts_and_wgts_interface_mesh")
def q_jacobian(self, q, x, t): # matrix of all partial derivatives # ij entry is f_{i, q_j}(q, x, t) # q.shape (num_eqns, points.shape), q[i, j] = q_i(x_j, t), # value of q_i at point j # x.shape (num_dims, points.shape), x[i, j] = x_i at point j # t scalar # return shape (output_shape, num_eqns, points.shape) # result[..., i, j] = partial derivative of all outputs with respect to q_i at # point j # result[..., i, points.shape] equivalent to q_derivative(q, x, t, i) # result[i] equivalent to q_gradient(q, x, t, i) raise errors.MissingDerivedImplementation("FluxFunction", "q_jacobian")
def gauss_pts_and_wgts_interface(self, quad_order, elem_vertex_list, interface_vertex_list): # elem_vertex_list = list of vertices of element, # shape (num_vertices_per_elem, num_dims) # interface_vertex_list = list of vertices of interface, should be subset of # elem vertices, shape (num_vertices_per_face, num_dims) # return gauss quadrature points on canonical element and quadrature weights # f is face on canonical element # integral over canonical face with respect to canonical variables # \dintt{f}{g(\xi)}{\xi} ~ \sum{i=1}{w_i g(\xi_i)} # return quadrature points, \xi_i, and weights, w_i, on canonical element # return (quad_pts, quad_wgts) # quad_pts.shape = (num_dims, num_points) # quad_wgts.shape = (num_points,) raise errors.MissingDerivedImplementation( "CanonicalElement", "gauss_pts_and_wgts_interface")
def function(self, q, x, t): # q.shape (num_eqns, points.shape) # x.shape (num_dims, points.shape) # t scalar # return shape (output_shape, points.shape) raise errors.MissingDerivedImplementation("FluxFunction", "function")
def do_max(self, lower_bound, upper_bound): raise errors.MissingDerivedImplementation("Autonomous", "do_max")
def do_integral(self, q): raise errors.MissingDerivedImplementation("Autonomous", "do_integral")
def do_q_jacobian(self, q): raise errors.MissingDerivedImplementation("Autonomous", "do_q_jacobian")
def transform_to_mesh_vertex_list(xi, vertex_list): # transformation from canonical element to mesh_element # xi may be list of points should have shape (num_points, num_dims) # vertex_list should have shape (num_vertices, num_dims) raise errors.MissingDerivedImplementation("CanonicalElement", "transform_to_mesh")
def get_neighbors_indices(self, mesh_, elem_index): # get elem indices of neighbor elems using boundary conditions # Default to self + neighboring elem if on the boundary, # except for periodic which wraps around raise errors.MissingDerivedImplementation("BoundaryCondition", "get_neighbors_indices")
def get_left_right_states(self, dg_solution, face_index, x, t): # return (left_state, right_state) # left_state = np.array(num_eqns) # right_state = np.array(num_eqns) raise errors.MissingDerivedImplementation("BoundaryCondition", "get_left_right_states")
def __call__(self, s, left_state, right_state): raise errors.MissingDerivedImplementation("PathFunction", "__call__")
def transform_to_canonical_vertex_list(x, vertex_list): # linear transformation from mesh element to canonical element # x may be list should have shape (num_dims, points_shape) # vertex_list should have shape (num_vertices, num_dims) raise errors.MissingDerivedImplementation( "CanonicalElement", "convert_to_canonical_element")
def do_t_derivative(self, x, t): raise errors.MissingDerivedImplementation("XTFunction", "do_t_derivative")
def do_x_jacobian(self, x, t): raise errors.MissingDerivedImplementation("XTFunction", "do_x_jacobian")
def function(self, x, t): raise errors.MissingDerivedImplementation("XTFunction", "function")
def limit_solution(self, problem, dg_solution): # modify dg_solution in place to limited solution # also return limited solution raise errors.MissingDerivedImplementation("SlopeLimiter", "limit_solution")
def transform_to_mesh_jacobian_vertex_list(vertex_list): # jacobian of transformation to mesh # should be constant matrix as transformation is linear raise errors.MissingDerivedImplementation( "CanonicalElement", "transform_to_mesh_jacobian")
def limit_solution(self, problem, dg_solution): # update dg_solution to limited solution # return limited_solution as well raise errors.MissingDerivedImplementation( "ShockCapturingLimiter", "limit_solution" )
def plot_gauss_pts(self, axes, quad_order): raise errors.MissingDerivedImplementation("CanonicalElement", "plot_gauss_pts")
def evaluate_boundary_matrix(self, mesh_, basis_, face_index, riemann_solver, t, matrix, vector): # Get matrix such that matrix times boundary element gives numerical flux at # boundary raise errors.MissingDerivedImplementation("BoundaryCondition", "evaluate_boundary_matrix")
def max(self, lower_bound, upper_bound, x, t): raise errors.MissingDerivedImplementation("FluxFunction", "max")
def function(self, q): raise errors.MissingDerivedImplementation("Autonomous", "function")
def transform_to_canonical_jacobian_determinant_vertex_list(vertex_list): # return determinant of jacobian of transformation to canonical # should be constant scalar as transformation is linear raise errors.MissingDerivedImplementation( "CanonicalElement", "transform_to_canonical_jacobian_determinant")
def s_derivative(self, s, left_state, right_state): raise errors.MissingDerivedImplementation("PathFunction")
def integral(self, q, x, t): raise errors.MissingDerivedImplementation("FluxFunction", "integral")