# Linear elasticity of a ring with two mechanical properties

Hi, guys
I’m trying to do an elastic simulation on a ring with an insertion to it, which ends up with the ring having two different mechanical properties.
I wonder how should I assign different properties to different regions of the mesh. and how should I change the linear elasticity equation to have both E and v in it.

Thank you so much for your help.

The mesh looks like this:

And here is the code I generated the mesh

``````real R2 = 0.00852; // outer radius [m]
real R1 = 0.00708; // inner radius [m]
real Rd = 0.00778; // notch outer radius [m]
real delta = 17.3*pi/180.; // half of notch angle

border S1(t=2*pi,0){x=R1*cos(t); y=R1*sin(t); label=1;} //inner surface
border S2a(t=0,angle-delta){x=R2*cos(t); y=R2*sin(t); label=2;} // S2a-e outer surface
border S2b(t=R2,Rd){x=t*cos(angle-delta);y=t*sin(angle-delta); label=3;}
border S2c(t=angle-delta,angle+delta){x=Rd*cos(t); y=Rd*sin(t); label=4;}
border S2d(t=Rd,R2){x=t*cos(angle+delta);y=t*sin(angle+delta); label=5;}
border S2e(t=angle+delta,2*pi){x=R2*cos(t); y=R2*sin(t); label=6;}
border S3a(t=angle+delta,angle-delta){x=R2*cos(t); y=R2*sin(t); label=7;}// S3 Inclusion
mesh Th1=buildmesh( S1(n)+S2a(3*n/4-nc/2)+S2b(7)+S2c(nc)+S2d(7)+S2e(n/4-nc/2));

//plot(Th1,ps="tube.ps"); // notched tube shape before deformation
mesh Th2=buildmesh(S2b(-7)+S2c(-nc)+S2d(-7)+S3a(-nc));
//plot(Th2,ps="inclusion.ps"); // inclusion part before deformation
mesh Th = Th1+Th2;
``````

Before you glue the meshes together, change the region number using the `change` function. Then, set your `E` and `v` values using a `P0` function depending on the keyword `region`.

Thank you!!
But I’m pretty new to this, what do you mean by P0 function? Could you please elaborate on that or direct me to certain articles?

Thank you so much in advance.

YX

`fespace Ph(Th, P0);`.
{"ft_lang_label":"__label__en","ft_lang_prob":0.5619594,"math_prob":0.985794,"size":1419,"snap":"2022-40-2023-06","text_gpt3_token_len":500,"char_repetition_ratio":0.13710247,"word_repetition_ratio":0.0,"special_character_ratio":0.35658914,"punctuation_ratio":0.15273775,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9996346,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-02-05T00:35:34Z\",\"WARC-Record-ID\":\"<urn:uuid:9af7a558-38fc-4ce5-b2e8-8c7e4dcc77ea>\",\"Content-Length\":\"25205\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:fe308200-d916-4c5c-bf55-3dd193bd17ce>\",\"WARC-Concurrent-To\":\"<urn:uuid:b72994ab-60b1-42ef-99a2-c90de084f698>\",\"WARC-IP-Address\":\"64.62.250.111\",\"WARC-Target-URI\":\"https://community.freefem.org/t/linear-elasticity-of-a-ring-with-two-mechanical-properties/2182\",\"WARC-Payload-Digest\":\"sha1:5G5ZPKUS2VB3F2RSEFZ55EG6B2UZOZIU\",\"WARC-Block-Digest\":\"sha1:HTDJR56547BET7X7ILLB6A7FGZTYIE4D\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764500158.5_warc_CC-MAIN-20230205000727-20230205030727-00049.warc.gz\"}"}