# Suppress or turn off degrees of freedom

**URL:** <https://community.freefem.org/t/suppress-or-turn-off-degrees-of-freedom/2344>\
**Category:** General Discussion\
**Created:** [March 20, 2023, 12:30pm UTC](https://community.freefem.org/t/suppress-or-turn-off-degrees-of-freedom/2344 "2023-03-20T12:30:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [March 20, 2023, 12:30pm UTC](https://community.freefem.org/t/suppress-or-turn-off-degrees-of-freedom/2344/1 "2023-03-20T12:30:57Z")

</div>

Dear all,

How can we set the degrees of freedom to be 0 in a region (similar to a boundary condition)?  
or turn off so that this region would not be assembled?

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)\
**Post date:** [March 20, 2023, 2:58pm UTC](https://community.freefem.org/t/suppress-or-turn-off-degrees-of-freedom/2344/2 "2023-03-20T14:58:44Z")

</div>

You can remove points from the mesh of course - I think “trunc” is used for 2D meshes.

You can assign a varf to a matrix that i represents the equations to be solved  
and put in it whatever you want. For the penalty method search docs for “tgv”  
which I think is french but with similar english expansions 🙂

I have had a few issues however understanding how the memory works  
especially with vector fespaces although the approach seems  
to be wisdely used with expected results.

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [March 21, 2023, 4:08pm UTC](https://community.freefem.org/t/suppress-or-turn-off-degrees-of-freedom/2344/3 "2023-03-21T16:08:37Z")

</div>

I do not understand what you wan:

Defined a problem where the solution will be zero some where  
and the some where is a part on the domain.

If it is this , I need the formulation of the problem.

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [March 22, 2023, 12:28pm UTC](https://community.freefem.org/t/suppress-or-turn-off-degrees-of-freedom/2344/4 "2023-03-22T12:28:04Z")

</div>

Thank you for your reply @frederichecht …

1. How to use Lagrange multiplier method to implement a Dirichlet boundary condition?

2. If we have two connected regions -fluid and solid. **Velocity** is defined on both regions/meshes, but **displacement** is only defined on the solid region. Not sure is this legal to put this into to one variation form such as the following (that’s why my initial idea was define the displacement on the whole region and turn it off on `Thf`)?

```auto
mesh Th = Ths + Thf;

fespace Vh(Th,P2);
fespace Vhs(Ths,P2);

Vh u, v, uh, vh;
Vhs d, dh;
varf fsi([u,v,d],[uh,vh,dh]) =
	int2d(Th)(...u..v..) + int2d(Ths)(...d...)

```
