Module Contents


solve_laplace_2d(V: fem.FunctionSpace, 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, bcs: List[fem.bcs.DirichletBCMetaClass])

Solves the laplace equation with boundary conditions bcs on V

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:

If top_value and bottom_value defaults are used, value_field will be the normalized distance to the top_line

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
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