mechanoChemML.workflows.pde_solver.geometry¶
Module Contents¶
Functions¶
force_install(package, versions=None) |
install one package with versions |
check_and_install() |
|
generatePolygon(ctrX, ctrY, aveRadius, irregularity, spikeyness, numVerts) |
Start with the centre of the polygon at ctrX, ctrY, |
clip(x, min, max) |
|
create_polygon(points, pixel, shape_id=0, use_convex_hull=True) |
|
generate_poly_points(num_points, pixel, use_new_random_polygon=False) |
generate points for polygons |
distance(p1, p2, p0) |
line defined by p1 and p2 |
fit_polynomial_form(coor, y, coor_at, order=2) |
|
plot_lines(pixel, color=’b’, linewidth=0.5) |
|
add_2edge_bc(bc_definition, count, total_edges) |
|
get_bc_definition(total_edges) |
|
generate_bc_values(bc_size, bc_num, bc_range=[0.5, 1.0], bc_order_type=’constant’) |
|
assign_region_mask(img, poly, pixel) |
|
compute_bc_value(one_bc_value, bc_order_type, e0, i0, j0, bc_type) |
|
apply_bcs_one_edge(img, list_of_edges, pixel, e0, _val, one_bc_value, bc_order_type) |
apply bcs on one edge |
remove_extra_bc_pixel_one_channel(img, pixel, channel, channel_value) |
|
remove_extra_bc_pixel(img, pixel) |
|
update_neumann_bc_value(list_of_bc_values, num_ind, neumann_ind, dirichlet_ind, bc_order_type) |
update Neumann BC values to make sure that the final results are not exceeding 1.0 |
apply_bcs(poly, pixel, bc_num=5, bc_range=[0.5, 1.0], bc_order_type=’constant’, shape_id=0, selected_bcs=5) |
Apply constant, linear, quadratic, sinusoidal for the diffusion problem |
vary_domain(all_num_points, pixel, bc_num=5, total_shapes=10, selected_bcs=5) |
randomly generate polygons and apply different BCs to them. |
merge_one_folder(data_folder) |
Merge all the generated data into one file and delete individual files |
-
mechanoChemML.workflows.pde_solver.geometry.force_install(package, versions=None)[source]¶ install one package with versions
-
mechanoChemML.workflows.pde_solver.geometry.generatePolygon(ctrX, ctrY, aveRadius, irregularity, spikeyness, numVerts)[source]¶ Start with the centre of the polygon at ctrX, ctrY, then creates the polygon by sampling points on a circle around the centre. Randon noise is added by varying the angular spacing between sequential points, and by varying the radial distance of each point from the centre.
Params: ctrX, ctrY - coordinates of the “centre” of the polygon aveRadius - in px, the average radius of this polygon, this roughly controls how large the polygon is, really only useful for order of magnitude. irregularity - [0,1] indicating how much variance there is in the angular spacing of vertices. [0,1] will map to [0, 2pi/numberOfVerts] spikeyness - [0,1] indicating how much variance there is in each vertex from the circle of radius aveRadius. [0,1] will map to [0, aveRadius] numVerts - self-explanatory
Returns a list of vertices, in CCW order.
-
mechanoChemML.workflows.pde_solver.geometry.create_polygon(points, pixel, shape_id=0, use_convex_hull=True)[source]¶
-
mechanoChemML.workflows.pde_solver.geometry.generate_poly_points(num_points, pixel, use_new_random_polygon=False)[source]¶ generate points for polygons
-
mechanoChemML.workflows.pde_solver.geometry.distance(p1, p2, p0)[source]¶ line defined by p1 and p2 compute distance from p0 to the line
-
mechanoChemML.workflows.pde_solver.geometry.add_2edge_bc(bc_definition, count, total_edges)[source]¶
-
mechanoChemML.workflows.pde_solver.geometry.generate_bc_values(bc_size, bc_num, bc_range=[0.5, 1.0], bc_order_type='constant')[source]¶
-
mechanoChemML.workflows.pde_solver.geometry.compute_bc_value(one_bc_value, bc_order_type, e0, i0, j0, bc_type)[source]¶
-
mechanoChemML.workflows.pde_solver.geometry.apply_bcs_one_edge(img, list_of_edges, pixel, e0, _val, one_bc_value, bc_order_type)[source]¶ apply bcs on one edge
-
mechanoChemML.workflows.pde_solver.geometry.remove_extra_bc_pixel_one_channel(img, pixel, channel, channel_value)[source]¶
-
mechanoChemML.workflows.pde_solver.geometry.update_neumann_bc_value(list_of_bc_values, num_ind, neumann_ind, dirichlet_ind, bc_order_type)[source]¶ update Neumann BC values to make sure that the final results are not exceeding 1.0
-
mechanoChemML.workflows.pde_solver.geometry.apply_bcs(poly, pixel, bc_num=5, bc_range=[0.5, 1.0], bc_order_type='constant', shape_id=0, selected_bcs=5)[source]¶ Apply constant, linear, quadratic, sinusoidal for the diffusion problem
-
mechanoChemML.workflows.pde_solver.geometry.vary_domain(all_num_points, pixel, bc_num=5, total_shapes=10, selected_bcs=5)[source]¶ randomly generate polygons and apply different BCs to them.