# Mapping NodeIDs to DOFs in Ferrite.jl V1.1.0

**URL:** https://discourse.julialang.org/t/mapping-nodeids-to-dofs-in-ferrite-jl-v1-1-0/131975
**Category:** General Usage
**Tags:** question
**Created:** [August 30, 2025, 7:28pm UTC](https://discourse.julialang.org/t/mapping-nodeids-to-dofs-in-ferrite-jl-v1-1-0/131975 "2025-08-30T19:28:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![noetheriankoala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/noetheriankoala/32/218462_2.png) [@noetheriankoala](https://discourse.julialang.org/u/noetheriankoala)
#### Post date: [August 30, 2025, 7:28pm UTC](https://discourse.julialang.org/t/mapping-nodeids-to-dofs-in-ferrite-jl-v1-1-0/131975/1 "2025-08-30T19:28:13Z")

</div>

Hello! What is the canonical way to get the DOFs corresponding to a specific node in Ferrite.jl? I am sure there is a way to iterate over all cells to look for which cells share which nodes, but this seems cumbersome for such a seemingly simple and common task. Does Ferrite really not provide such a function in their API? Thanks in advance!

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [August 30, 2025, 7:50pm UTC](https://discourse.julialang.org/t/mapping-nodeids-to-dofs-in-ferrite-jl-v1-1-0/131975/2 "2025-08-30T19:50:25Z")

</div>

First, welcome to the Julia community!

@noetheriankoala EDIT:

> **[The proper way of setting concentrated loads on the right-hand side vector...](https://github.com/Ferrite-FEM/Ferrite.jl/discussions/788?utm_source=chatgpt.com#discussioncomment-6713528)**
>
> This might be a simple issue, but is there a handy way to assign arbitrary values on the right-hand side vector that correspond to the degrees of freedom of a specific node and field? That is, I wa...

> .. That being said, it is of course a common thing to want to apply forces to nodes, so we have talked about adding utility functions for this 🙂 . But in the meanwhile, maybe this example code can help you?

Is the example code there what you need or a step in the right direction? I wouldn’t know, I only pasted your question verbatim to OpenAI (GPT-5), and got a seemingly fine answer (at least with link to the above, with source code there and in the AI answer itself too).

> **[Ferrite.jl DOF retrieval](https://chatgpt.com/s/t_68b35a18dd34819187eab33c8067733e)**
>
> A conversational AI system that listens, learns, and challenges

> Ferrite doesn’t offer a built-in “get all DOFs for a given node” function. That’s because internally, DOFs are assigned on a per-cell basis rather than being tied directly to nodes. The system doesn’t keep an explicit node→DOF mapping under the hood. [GitHub](https://github.com/Ferrite-FEM/Ferrite.jl/discussions/788?utm_source=chatgpt.com)
> 
> A Ferrite collaborator confirmed this outright:
> 
> > “There has never been a straightforward way of extracting the DOFs on nodes in Ferrite. The reason … is because we distribute the DOFs on cells, which means we never store the node-to-dof information.” [GitHub](https://github.com/Ferrite-FEM/Ferrite.jl/discussions/788?utm_source=chatgpt.com)
> 
> So yes, it’s kind of glaringly common, but also kind of intentionally missing—because Ferrite’s power lies in weak forms (integrals) rather than point-wise manipulation. That said, application of nodal loads and constraints _is_ common, so they’ve sprinkled helpful code samples in discussions.
> 
> ### Your best workaround (for now)
> 
> …

You’ll be the judge if the AI (and/or me) was helpful. I know the AI is often very helpful for me, for (coding) discussions, for Julia (and Forth, the other language I’m fascinated by, can code in Julia, not always correctly (in any language), but showing Julia errors often fixes. Opus 4 is also claimed good for Julia.

I want to help you, I really do, but this does not seem to fit “General Usage”. I suppose you looked at the docs, and searched for DOF, degrees of freedom and NodeID? I took a quick look, DOF gave me too many results:

> **[Dof handler · Ferrite.jl](https://ferrite-fem.github.io/Ferrite.jl/stable/devdocs/dofhandler/)**
>
> Documentation for Ferrite.jl.

I couldn’t change the category to anything (not even sure which subcategory fits, or if it’s needed), like (you might want to, and maybe add another tag?):

> **[Specific Domains](https://discourse.julialang.org/c/domain/10)**
>
> Discussion of Julia in various specialized subject domains that have a dedicated community. Don’t see your domain? Fear not, post your topic in general usage.

---

<div class="post-metadata">

### Author: ![noetheriankoala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/noetheriankoala/32/218462_2.png) [@noetheriankoala](https://discourse.julialang.org/u/noetheriankoala)
#### Post date: [August 31, 2025, 5:37pm UTC](https://discourse.julialang.org/t/mapping-nodeids-to-dofs-in-ferrite-jl-v1-1-0/131975/3 "2025-08-31T17:37:38Z")

</div>

The first link you provided is essentially what I am looking for 🙂. I should have spent longer searching through the `Ferrite.jl` issues. Thanks!
