# Defining the prescribed function, f, using boundary indicators

I am attempting to define the current through a wire, which has a fairly complex geometry. In this situation the current is the prescribed function, f (using the nomenclature form the FEniCS text). Since current is a vector quantity, I must define its direction, but because the geometry is rather complex, the direction is not easily defined with a mathematical equation. So my question is this: does anyone know of a good method for defining the current using the boundary indicators of the imported mesh?

Here is essentially what I would like to do:

1) for all locations outside of the wire subdomain, set f = 0.

2) for all locations inside the wire subdomain, set the magnitude of f = J.

3) for all locations where f = J, find J(hat) from a combination of the position coordinates and boundary indicator values.

My python skills are lacking, so any advice would be appreciated.

Thanks

## Question information

- Language:
- English Edit question

- Status:
- Answered

- Assignee:
- No assignee Edit question

- Last query:

- Last reply:

## Can you help with this problem?

Provide an answer of your own, or ask Simon Fowler for more information if necessary.