analyticmeshgen.py¶
Analytic mesh creation tools for testing pyvale sensor simulation and uncertainty quantification functionality with a known analytic function for the scalar/vector/tensor field of interest.
- rectangle_mesh_2d(leng_x, leng_y, n_elem_x, n_elem_y)[source]¶
Creates the nodal coordinates and element connectivity table for a simple 2D quad mesh for a rectangular plate.
- Parameters:
- Returns:
tuple[np.ndarray,np.ndarray]– The coordinates and connectivity table as numpy arrays. The coordinates have shape=(n_nodes,coord[x,y,z]). The connectivity tables has shape= (nodes_per_elem,num_elems).
- fill_dims_2d(coord_x, coord_y, time)[source]¶
Helper function to generate 2D filled arrays tih consistent dimensions for array based maths operations. Takes 1D input vectors for the x, y and time dimensions and returns 2D arrays with shape=(num_coords,num_timesteps). Useful for evaluating analytical functions in space and time.
- Parameters:
coord_x (
np.ndarray) – 1D flattened coordinate list for the x axis.coord_y (
np.ndarray) – 1D flattened coordinate list for the y axis.time (
np.ndarray) – 1D array of time steps.
- Returns:
tuple[np.ndarray,np.ndarray,np.ndarray]– Filled 2D arrays with shape=(num_coords,num_timesteps) for the x, y and time parameters respectively.