Skip to content
Snippets Groups Projects
Commit 0c527b8a authored by David Seus's avatar David Seus
Browse files

reorganise repo

parent 715daf79
No related branches found
No related tags found
No related merge requests found
File moved
...@@ -142,6 +142,8 @@ class DomainPatch(df.SubDomain): ...@@ -142,6 +142,8 @@ class DomainPatch(df.SubDomain):
# dictionary holding the dof indices corresponding to an interface of # dictionary holding the dof indices corresponding to an interface of
# given interface. see self._calc_dof_indices_of_interfaces() # given interface. see self._calc_dof_indices_of_interfaces()
self._dof_indices_of_interface = dict() self._dof_indices_of_interface = dict()
# List of objects of clas outerBoundary initialised by self._init_markers()
# can be NONE if no outer boundary is present.
self.outer_boundary = [] self.outer_boundary = []
# measures are set by self._init_measures() # measures are set by self._init_measures()
self.iteration_number = 0 self.iteration_number = 0
... ...
......
File moved
#!/usr/bin/python3
import dolfin as df
mesh = df.UnitIntervalMesh(2)
dx = df.dx
ds = df.ds
V = df.FunctionSpace(mesh, 'CG', 1)
v = df.TestFunction(V)
u = df.Function(V)
# set k constant to 42
# k = df.Constant(42)
k = df.Expression('2*x[0]', domain = mesh, degree=1)
k = df.interpolate(k, V)
n = df.FacetNormal(mesh)
print(k.vector().get_local())
print(df.assemble(k*v*dx).get_local())
print(df.assemble(df.dot(df.grad(k),n)*v*ds).get_local())
# solve k*u'' = 0
a = u.dx(0)*k*v.dx(0)*dx + u.dx(0)*k.dx(0)*v*dx
print('Form: \n', df.assemble(a).get_local())
bcL = df.DirichletBC(V,df.Constant(10.),"on_boundary && x[0] < 0.5")
bcR = df.DirichletBC(V,df.Constant(1.),"on_boundary && x[0] > 0.5")
bcs= [bcL,bcR]
df.solve(a == 0,u,bcs=bcs)
df.File('./taaeschd_u1.pvd') << u
# change value of k at one boundary point
k.vector()[0] = 1.e6
print(k.vector().get_local())
print(df.assemble(k*dx))
print(df.assemble(k*ds))
df.solve(a == 0,u,bcs=bcs)
df.File('./taaeschd_u2.pvd') << u
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment