# 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 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.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9383558,"math_prob":0.85976326,"size":1624,"snap":"2020-34-2020-40","text_gpt3_token_len":323,"char_repetition_ratio":0.12345679,"word_repetition_ratio":0.0,"special_character_ratio":0.19273399,"punctuation_ratio":0.06270627,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9609458,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-09-26T12:50:01Z\",\"WARC-Record-ID\":\"<urn:uuid:c669c636-734f-47eb-9bce-41f449e52cca>\",\"Content-Length\":\"151639\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:cf4f190f-3660-4d3c-89da-7ad5f1e68030>\",\"WARC-Concurrent-To\":\"<urn:uuid:cbc117a5-7012-40ea-922b-188a18e3beb3>\",\"WARC-IP-Address\":\"151.101.129.69\",\"WARC-Target-URI\":\"https://scicomp.stackexchange.com/questions/7592/implementation-of-a-contraction-force-in-fenics\",\"WARC-Payload-Digest\":\"sha1:TA3JO3VNZSWTPDU7FPNXIN5G5XEMFU2F\",\"WARC-Block-Digest\":\"sha1:CZNYLSG2GIIFJJHNXKLH4YRFXEQA5V2U\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-40/CC-MAIN-2020-40_segments_1600400241093.64_warc_CC-MAIN-20200926102645-20200926132645-00323.warc.gz\"}"}