# Creating Function Space

**URL:** <https://fenicsproject.discourse.group/t/creating-function-space/12725>\
**Category:** dolfinx\
**Created:** [November 11, 2023, 11:00am UTC](https://fenicsproject.discourse.group/t/creating-function-space/12725 "2023-11-11T11:00:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dipankul\_bhattachary](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dipankul_bhattachary/32/5848_2.png) [@dipankul\_bhattachary](https://fenicsproject.discourse.group/u/dipankul_bhattachary)\
**Post date:** [November 11, 2023, 11:00am UTC](https://fenicsproject.discourse.group/t/creating-function-space/12725/1 "2023-11-11T11:00:50Z")

</div>

Hello everyone,

I am very new to fenics project and was trying to run the example of Poisson equation. However in the step where we define the element space -

from dolfinx.fem import FunctionSpace  
V = FunctionSpace(domain, (“Lagrange”, 1))

I am getting the error, -" FunctionSpace. **init** () missing 1 required positional argument: ‘cppV’ ".

I am not sure what should be this third argument and any guidance would be very helpful.

\*for installation, I followed building from the source code. My dolfinix version is 0.8.0.0.

Warm Regards

---

<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:** [November 11, 2023, 11:28am UTC](https://fenicsproject.discourse.group/t/creating-function-space/12725/2 "2023-11-11T11:28:23Z")

</div>

The API for functionspaces changed after the 0.7.0 release. You now need to call  
`dolfinx.fem.functionspace` (all non-captialized), as this is the new constructor.

---

<div class="post-metadata">

**Author:** ![dipankul\_bhattachary](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dipankul_bhattachary/32/5848_2.png) [@dipankul\_bhattachary](https://fenicsproject.discourse.group/u/dipankul_bhattachary)\
**Post date:** [November 11, 2023, 11:35am UTC](https://fenicsproject.discourse.group/t/creating-function-space/12725/3 "2023-11-11T11:35:33Z")

</div>

Yes it worked, thanks a lot. Since I am new to fenics, I was planning to follow the examples as in the documentation .[examples](https://jsdokken.com/dolfinx-tutorial/chapter1/fundamentals_code.html). So are they as per the new version? What is the best way to know if the APIs have changed with respect to what is specified in the example?

---

<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:** [November 11, 2023, 11:39am UTC](https://fenicsproject.discourse.group/t/creating-function-space/12725/4 "2023-11-11T11:39:55Z")

</div>

I do not update the tutorial before there is an official release, so the API there is compatible with 0.7.0.

The branch:

> **[GitHub - jorgensd/dolfinx-tutorial at release](https://github.com/jorgensd/dolfinx-tutorial/tree/release)**
>
> release

tries to keep up with the dolfinx main branch, But Ive been Busy lately, so haven’t had time to adapt it.

You can see the differences at

> **[Comparing v0.7.1...main · FEniCS/dolfinx](https://github.com/FEniCS/dolfinx/compare/v0.7.1...main)**
>
> Next generation FEniCS problem solving environment - Comparing v0.7.1...main · FEniCS/dolfinx

---

<div class="post-metadata">

**Author:** ![dipankul\_bhattachary](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dipankul_bhattachary/32/5848_2.png) [@dipankul\_bhattachary](https://fenicsproject.discourse.group/u/dipankul_bhattachary)\
**Post date:** [November 11, 2023, 12:20pm UTC](https://fenicsproject.discourse.group/t/creating-function-space/12725/5 "2023-11-11T12:20:36Z")

</div>

Thank you very much for the support. I shall check out the links.

---

<div class="post-metadata">

**Author:** ![dparsons](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dparsons](https://fenicsproject.discourse.group/u/dparsons)\
**Post date:** [November 12, 2023, 11:09am UTC](https://fenicsproject.discourse.group/t/creating-function-space/12725/6 "2023-11-12T11:09:32Z")

</div>

Note that if you are new to the system, you’ll find it way easier to use the released version, not the development version (which may continue to change).

---

<div class="post-metadata">

**Author:** ![dipankul\_bhattachary](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dipankul_bhattachary/32/5848_2.png) [@dipankul\_bhattachary](https://fenicsproject.discourse.group/u/dipankul_bhattachary)\
**Post date:** [November 14, 2023, 7:16am UTC](https://fenicsproject.discourse.group/t/creating-function-space/12725/7 "2023-11-14T07:16:59Z")

</div>

Yeah, true. I shall try to get back to the release version. Thanks a lot.
