# Reactive terms that depend on the value of the field variables and other condition

**URL:** <https://fenicsproject.discourse.group/t/reactive-terms-that-depend-on-the-value-of-the-field-variables-and-other-condition/5575>\
**Category:** variational formulation\
**Created:** [April 13, 2021, 9:45pm UTC](https://fenicsproject.discourse.group/t/reactive-terms-that-depend-on-the-value-of-the-field-variables-and-other-condition/5575 "2021-04-13T21:45:02Z")\
**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:** [April 14, 2021, 6:31am UTC](https://fenicsproject.discourse.group/t/reactive-terms-that-depend-on-the-value-of-the-field-variables-and-other-condition/5575/2 "2021-04-14T06:31:27Z")

</div>

You can use a conditional, see:

[https://fenics.readthedocs.io/projects/ufl/en/latest/manual/form\_language.html?highlight=Conditional%20#conditional](https://fenics.readthedocs.io/projects/ufl/en/latest/manual/form_language.html?highlight=Conditional%20#conditional)

and

> [@Using Conditional function inside a Project function](https://fenicsproject.discourse.group/t/using-conditional-function-inside-a-project-function/3967/4):
>
> The problem is that you try to assign a function (the result of the projection), to a float. The initial kappa has to be a function. This is illustrated in the minimal example below. Please note the following: Your proposed example is not minimal, and contains alot of variables not required to reproduce the error. The example below should be used as a guideline for further inquires. To represent kappa, I am using a DG space, as kappa is discontinuous. If you decide to use a CG space, you wil…

---

_[View the full topic](https://fenicsproject.discourse.group/t/reactive-terms-that-depend-on-the-value-of-the-field-variables-and-other-condition/5575)._
