# Implementation of a contraction force in Fenics

Is there any way to implement an element wise contraction force (i.e., a force which causes the FEs themselves to contract onto themselves)? For example this would happen when something dehydrates. Preferably with first order tetrahedral elements, but if the only way to do it is have a vertex in the centre of the elements then higher order will have to do (it just opens up other issues to be solved) also I'm only interested in the x[2] direction. This would be something like a body force such as

dot(body force, displacement)*dx(subdomain)

but instead of the body force being defined in the global sense, and acting in a global direction from a reference point (for example gravity acting downward over the whole domain constrained by a boundary condition such as the ground stopping the object falling) it would be within the local element with the reference frame being dependent on the element. I have tried implementing this with multiple body forces on multiple subdomains acting in opposite directions but this seems to cause the forces to effectively cancel each other out.

A simple physical example would be a wet sponge sitting on a table drying out. It has two forces acting on it. The first simple one being gravity in the vertical direction causing it to stay sitting on the table, with the boundary condition of the table not letting it fall. The second is the contraction force caused when the water evaporates and the sponge gets smaller. If we were to model this using say 1 element, each of the vertices defining the cell would need to contract to the cells local centre.

This is implemented in Fenics.

It simply seems that you want to calculate elasticity problem (with large displacement). I don't see a problem in this. Just check hyperelasticity demo. But be careful - if you take an initial state as reference state notice that your reference state is not stress-free which is quite usual assumption in deriving constitutive relation. After all you would calculate nothing if starting from stress-free state.
If you need (for some purpose) to deform mesh according to calculated displacement there is facility for doing this in FEniCS - check void Mesh::move(const GenericFunction& displacement). Then it is natural to use continuous piece-wise linear elements (CG1) for displacement which just defines displacement in all mesh vertices. You just need to reset your reference configuration after each time step.