Mark Subdomains in 3D
Ok so I know there are a lot of posts on this but I can't seem to find one to address the error I am getting. I am simply trying to make two subdomains in a 3D mesh but I keep getting the following error:
Traceback (most recent call last):
File "BulkDiffusion.py", line 45, in <module>
k.vector(
IndexError: list index out of range
Here is a snippet of the relevant code, if someone can notice something I am doing wrong it would be greatly appreciated. Let me know if you have any questions. (The .xml file is just a 3D cylinder with spherical caps).
#Create mesh from Coli problem
mesh = Mesh('coli.xml')
V = FunctionSpace(mesh, "Lagrange", 1)
subdomains = MeshFunction(
class Omega0(SubDomain):
def inside(self, x, on_boundary):
return True if x[1] <= 1 else False
class Omega1(SubDomain):
def inside(self, x, on_boundary):
return True if x[1] >= 1 else False
# Mark subdomains with numbers 0 and 1
subdomain0 = Omega0()
subdomain0.
subdomain1 = Omega1()
subdomain1.
V0 = FunctionSpace(mesh, 'DG', 0)
k = Function(V0)
k_values = [1.5, 50] # values of k in the two subdomains
for cell_no in range(len(
subdomain_no = subdomains.
k.vector(
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Michael Trogdon
- Solved:
- Last query:
- Last reply: