Finding an ex of one geometry with two different materials
Dear all,
Is there an example where applying two different materials to different part of one geometry?
For example, in the following example, how to change a single material to have the top half of the model as material 1 and the bottom half as material 2:
import matplotlib
matplotlib.
from esys.escript import *
from esys.weipa import saveVTK
import os
# smoothing operator
from esys.escript.
from esys.escript.
import numpy as np
import pylab as pl
import matplotlib.cm as cm
from esys.escript.
try:
# This imports the rectangle domain function
from esys.finley import Rectangle
HAVE_FINLEY = True
except ImportError:
print("Finley module not available")
HAVE_FINLEY = False
#######
if getMPISizeWorld() > 1:
import sys
print("This example will not run in an MPI world.")
sys.exit(0)
if HAVE_FINLEY:
###
# where to save output data
savepath = "data/example08b"
mkDir(savepath)
#Geometric and material property related variables.
mx = 1000. # model lenght
my = 1000. # model width
ndx = 300 # steps in x direction
ndy = 300 # steps in y direction
xstep=mx/ndx # calculate the size of delta x
ystep=
lam=3.462e9 #lames constant
mu=3.462e9 #bulk modulus
rho=1154. #density
# Time related variables.
testing=True
if testing:
print('The testing end time is currently selected. This severely limits the number of time iterations.')
print("Try changing testing to False for more iterations.")
tend=0.001
else:
tend=0.5 # end time
Cheers,
Yu
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Jingchi Yu for more information if necessary.