neuron_morphology.transforms.streamline
¶
Module Contents¶
Functions¶
solve_laplace_2d (V: fem.FunctionSpace, domain, bcs: List[fem.bcs.DirichletBCMetaClass]) |
Solves the laplace equation with boundary conditions bcs on V |
compute_gradient (uh, W, bcs=[]) |
|
generate_laplace_field (top_line: List[Tuple], bottom_line: List[Tuple], mesh_res: float = 20, top_value: float = 1.0, bottom_value: float = 0.0, eps_bounds: float = 1e-08) |
Solve Laplace equation inside a polygon bounded |
-
neuron_morphology.transforms.streamline.
solve_laplace_2d
(V: fem.FunctionSpace, domain, bcs: List[fem.bcs.DirichletBCMetaClass])¶ Solves the laplace equation with boundary conditions bcs on V
Parameters: - V: Fenics FunctionSpace object created from a mesh
- bcs: List of Fenics DirichletBC Boundary Conditions
-
neuron_morphology.transforms.streamline.
compute_gradient
(uh, W, bcs=[])¶
-
neuron_morphology.transforms.streamline.
generate_laplace_field
(top_line: List[Tuple], bottom_line: List[Tuple], mesh_res: float = 20, top_value: float = 1.0, bottom_value: float = 0.0, eps_bounds: float = 1e-08)¶ Solve Laplace equation inside a polygon bounded by two lines (top_line and bottom_line) and the artificial straight side lines connecting the ends of the two lines. Apply Dirichlet BC on top_line and bottom_line and zero Neuman BC on the side lines.
- Demo of fenics: https://github.com/hplgit/fenics-tutorial/
- blob/master/pub/python/vol1/ft01_poisson.py
If top_value and bottom_value defaults are used, value_field will be the normalized distance to the top_line
Parameters: - top_line: line that will have top_value boundary condition
- bottom_line: line that will have bottom_value boundary condition
- mesh_res: resolution of the mesh
- top_value: value for top Dirichlet Boundary
- bottom_value: value for bottom Dirichlet Boundary
Returns: - u: returns value at input point e.g. 0.5 = u((0.5, 0.5))
- grad_u: returns gradient at input point e.g. [0, 1] = u((0.5, 0.5))
- mesh_coords: coordinates of each vertex in the mesh
- mesh_values: values at each vertex in the mesh
- gradient_mesh: gradient at each vertex in the mesh