Hi,

I want to simulate a composite material made of matrix (E1) and inclusion (E2). I am not sure how to assign two different material properties and integrate over the domain.

Assume a classic elasticity problem…how can I modify the following code to separately define C1 and C2 matrices and integrate them in the “solve” command?

// Material Parameters

real E1 = 100.; // Elastic modulus of matrix

real nu1 = 0.3; // Poisson’s ratio

real mu1 = E1/(2*(1+nu1)); // Lame’s constants

real lambda1 = E1*nu1/((1+nu1)*(1-2*nu1)); // Lame’s constants

real E2 = 1; // Elastic modulus of matrix

real nu2 = 0.01; // Poisson’s ratio

real mu2 = E2/(2*(1+nu2)); // Lame’s constants

real lambda2 = E2*nu2/((1+nu2)*(1-2*nu2)); // Lame’s constants

func C1 = [[lambda1+2*mu1, lambda1, 0], [lambda1, lambda1+2*mu1, 0], [0, 0, 2*mu1]]; // matrix
func C2 = [[lambda2+2*mu2, lambda2, 0], [lambda2, lambda2+2

*mu2, 0], [0, 0, 2*mu2]]; // inclusion

// Geometric Parameters

real L = 1;

real t = 0.1;

// Geometry

border botout(a=-L/2., L/2){x=a; y=-L/2;}

border rightout(a=-L/2, L/2){x=L/2; y=a;}

border topout(a=L/2, -L/2){x=a; y=L/2;}

border leftout(a=L/2, -L/2){x=-L/2; y=a;}

border botin(a=-L/2+t/2., L/2-t/2.){x=a; y=-L/2+t/2.;}

border rightin(a=-L/2+t/2., L/2-t/2.){x=L/2-t/2.; y=a;}

border topin(a=L/2-t/2., -L/2+t/2.){x=a; y=L/2-t/2.;}

border leftin(a=L/2-t/2., -L/2+t/2.){x=-L/2+t/2.; y=a;}

// Meshing

mesh Th = buildmesh(botout(45) + rightout(45) + topout(45) + leftout(45) + botin(25) + rightin(25) + topin(25) + leftin(25));

plot(Th, wait=true);

// FE space

fespace Vh(Th, [P1, P1], periodic=[[rightout,y], [leftout,y], [botout,x], [topout,x]]);

Vh [u1, u2]; //unknowns

Vh [v1, v2]; //test functions

// Definitions

macro epsilon(u1,u2) [dx(u1), dy(u2), dx(u2)+dy(u1)] //EOM

func Ebar = [1., 0., 0.]; // Applied load

solve Elastic([u1, u2], [v1, v2]) = int2d(Th)(epsilon(v1,v2)'*C*epsilon(u1,u2)) + int2d(Th)(epsilon(v1,v2)'*C*Ebar) ;