# Changing the faceset where the force is acting to another location and change the Force vector Values

**URL:** https://discourse.julialang.org/t/changing-the-faceset-where-the-force-is-acting-to-another-location-and-change-the-force-vector-values/119339
**Category:** Numerics
**Tags:** question, fem
**Created:** [September 12, 2024, 4:36pm UTC](https://discourse.julialang.org/t/changing-the-faceset-where-the-force-is-acting-to-another-location-and-change-the-force-vector-values/119339 "2024-09-12T16:36:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kings94](https://avatars.discourse-cdn.com/v4/letter/k/c67d28/32.png) [@kings94](https://discourse.julialang.org/u/kings94)
#### Post date: [September 12, 2024, 4:36pm UTC](https://discourse.julialang.org/t/changing-the-faceset-where-the-force-is-acting-to-another-location-and-change-the-force-vector-values/119339/1 "2024-09-12T16:36:39Z")

</div>

So i am currently tring to run a simulation on a simple beam using the arc length method, where for a certain number of increments a certain load (in the negative x direction) is applied with specific boundary conditions so that the beam would arch, then after that number of increments is reached, change the faceset where the the force is acting, and also change the force so that it only works in the negative y achses, to study the snap through affect through the arc length method.  
My biggest issue is if i can set thi through a  
while loop  
if n\<10 (or any other number)  
apply bcs1  
force= Vec{3}(-0.001, 0, 0)  
etc etc.  
else  
apply bcs2  
force = Vec{3}(0,-0.001,0)  
faceset2.  
apply arclength method.

my issue is i have tried to recet the faceset where the force is working, but if it is set, no changes to it can be applied.  
would just doing an if else loop each with the assemble\_global\_G!, assemble\_element\_P!, assemble\_global\_P! , and assemble\_element\_G being calculated for each force and each faceset where the force is acting ?

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [September 13, 2024, 8:42am UTC](https://discourse.julialang.org/t/changing-the-faceset-where-the-force-is-acting-to-another-location-and-change-the-force-vector-values/119339/2 "2024-09-13T08:42:14Z")

</div>

(I assume this is related to [Ferrite.jl release announcements - #15 by kings94](https://discourse.julialang.org/t/ferrite-jl-release-announcements/93157/15) and that you thus are using Ferrite.jl for this).

It is a bit difficult to understand what you are trying to do exactly, but my understanding is that you want to switch the boundary conditions mid-simulation? Based on the limited information in this post I think the easiest way would be to create two different constraint handlers with different conditions inside and apply the one you want based on the step.

---

<div class="post-metadata">

### Author: ![kings94](https://avatars.discourse-cdn.com/v4/letter/k/c67d28/32.png) [@kings94](https://discourse.julialang.org/u/kings94)
#### Post date: [September 14, 2024, 1:34pm UTC](https://discourse.julialang.org/t/changing-the-faceset-where-the-force-is-acting-to-another-location-and-change-the-force-vector-values/119339/4 "2024-09-14T13:34:07Z")

</div>

correct, this is regarding Ferrite.jl

i have used this loop  
‘’'while n\<nmax  
if n\<20  
boundary condition 1  
faceset 1  
forcevector ={0.01, 0, 0}

```
else 
   boundary conditions 2
   faceset 2 (where my forcevector is acting)
   forcevector={0 , -0.1, 0}

```

end’‘’

my question is if could remove a facecet later down my loop, so that i dont have to redefine my new faceset where my force is acting, and as such also redefine my assemble\_element\_P, assemble\_global\_P, and element and global G for the resiudal. if i try to redefine it using the same name, it tells me it has already been defined so i cant overwrite it, and julia doesnt allow modifying pointers.
