Hi here!
I am looking for the new syntax corresponding to this old fenics syntax:
Update (u_old β u)
v_old.vector()[:], a_old.vector()[:] = v_vec, a_vec
u_old.vector()[:] = u.vector()
I need this when coding the time-stepping of an elato-dynamics problem, just as in
https://comet-fenics.readthedocs.io/en/latest/demo/elastodynamics/demo_elastodynamics.py.html
thanks!
sebastien
dokken
December 2, 2022, 9:51am
2
Are you talking about dolfinx?
Then you can call
u_old.x.array[:] = u.x.array
1 Like
Yes, thank you!
Corrado also showed me (to put u_source into u_target):
u_source.vector.copy(result=u_target.vector)
I guess, itβs exactly the same, right?
dokken
December 5, 2022, 8:37am
4
Well, with that kind of update you might need to update ghost values with a scatter forward afterwards, as petsc (the .vector
object) does not necessarily do any communication of ghost values
1 Like