# Boundary Condition and coefficient from discrete data

**URL:** <https://fenicsproject.discourse.group/t/boundary-condition-and-coefficient-from-discrete-data/5796>\
**Category:** Uncategorized\
**Created:** [May 14, 2021, 6:32am UTC](https://fenicsproject.discourse.group/t/boundary-condition-and-coefficient-from-discrete-data/5796 "2021-05-14T06:32:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [May 14, 2021, 6:49am UTC](https://fenicsproject.discourse.group/t/boundary-condition-and-coefficient-from-discrete-data/5796/2 "2021-05-14T06:49:16Z")

</div>

Please format your code using 3x` to make it readable.

For your actual question, consider:

> [@RecursionError: maximum recursion depth exceeded in the ft11\_magnetostatics.py example of the "Solving PDEs in Python - The FEniCS tutorial Part 1"](https://fenicsproject.discourse.group/t/recursionerror-maximum-recursion-depth-exceeded-in-the-ft11-magnetostatics-py-example-of-the-solving-pdes-in-python-the-fenics-tutorial-part-1/1559/2):
>
> The tutorial is out of date. Change your Permeability class to the following: class Permeability(UserExpression): # UserExpression instead of Expression def \_\_init\_\_(self, markers, \*\*kwargs): super().\_\_init\_\_(\*\*kwargs) # This part is new! self.markers = markers def eval\_cell(self, values, x, cell): if self.markers[cell.index] == 0: values[0] = 4\*pi\*1e-7 # vacuum elif self.markers[cell.index] == 1: values[0] = 1e-5 # iron (shou…

---

_[View the full topic](https://fenicsproject.discourse.group/t/boundary-condition-and-coefficient-from-discrete-data/5796)._
