# Linear elasticity of a ring with two mechanical properties

**URL:** <https://community.freefem.org/t/linear-elasticity-of-a-ring-with-two-mechanical-properties/2182>\
**Category:** General Discussion\
**Created:** [December 12, 2022, 5:05pm UTC](https://community.freefem.org/t/linear-elasticity-of-a-ring-with-two-mechanical-properties/2182 "2022-12-12T17:05:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yinghan](https://avatars.discourse-cdn.com/v4/letter/y/2bfe46/32.png) [@Yinghan](https://community.freefem.org/u/Yinghan)\
**Post date:** [December 12, 2022, 5:05pm UTC](https://community.freefem.org/t/linear-elasticity-of-a-ring-with-two-mechanical-properties/2182/1 "2022-12-12T17:05:17Z")

</div>

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:

 ![Picture1](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/b/bd15afed6ad421b6261d1ba90f846dfd7ef6ff18.jpeg)

And here is the code I generated the mesh

```auto
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;

```

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [December 12, 2022, 5:56pm UTC](https://community.freefem.org/t/linear-elasticity-of-a-ring-with-two-mechanical-properties/2182/2 "2022-12-12T17:56:13Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![Yinghan](https://avatars.discourse-cdn.com/v4/letter/y/2bfe46/32.png) [@Yinghan](https://community.freefem.org/u/Yinghan)\
**Post date:** [December 12, 2022, 8:45pm UTC](https://community.freefem.org/t/linear-elasticity-of-a-ring-with-two-mechanical-properties/2182/3 "2022-12-12T20:45:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [December 12, 2022, 8:49pm UTC](https://community.freefem.org/t/linear-elasticity-of-a-ring-with-two-mechanical-properties/2182/4 "2022-12-12T20:49:29Z")

</div>

`fespace Ph(Th, P0);`.
