Skip to content

Commit 05280ff

Browse files
committed
Time depepdent problem in work
1 parent 7cead6e commit 05280ff

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

demo/time_dependent_diffusion/dolfinx_time_dependent_diffusion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
uD_sol = dolfinx.fem.Function(VD)
2222
uD_prev = dolfinx.fem.Function(VD)
2323
# uD_prev.x.array[:] = 0.2 # Initial value
24-
uD_prev.interpolate(lambda x: 5 * np.sin(x[0] * 2 * np.pi) * np.cos(x[1] * 2 * np.pi))
24+
uD_prev.interpolate(lambda x: 5. * np.sin(x[0] * 2 * np.pi) * np.cos(x[1] * 2 * np.pi))
2525
D = ufl.as_tensor([[1., 0., 0.],[0., 1.2, 0.],[0., 0., 3.]])
2626
f_source = dolfinx.fem.Constant(mesh, PETSc.ScalarType(0.))
2727
flux = dolfinx.fem.Constant(mesh, PETSc.ScalarType(0.))
@@ -65,7 +65,7 @@
6565
uD_prev.x.array[:] = uD_sol.x.array
6666

6767
xdmf.write_function(uD_sol, t)
68-
print(mesh.comm.allreduce(dolfinx.fem.assemble_scalar(dolfinx.fem.form(ufl.inner(uD_sol.dx(2), uD_sol.dx(2)) * ufl.dx)), op=MPI.MAX))
68+
print(mesh.comm.allreduce(dolfinx.fem.assemble_scalar(dolfinx.fem.form(ufl.inner(uD_sol.dx(2), uD_sol.dx(2)) * ufl.dx)), op=MPI.SUM))
6969

7070
xdmf.close()
7171

demo/time_dependent_diffusion/mesh_data/mesh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
gmsh.initialize(" ", False)
66
gdim = 3
77

8-
center_x, center_y, center_z, radius = 0., 0., 0., 2.
8+
center_x, center_y, center_z, radius = 0., 0., -1., 2.
99
circle = gmsh.model.occ.addCircle(center_x, center_y, center_z, radius)
1010
circle_loop = gmsh.model.occ.addCurveLoop([circle])
1111
surface = gmsh.model.occ.addPlaneSurface([circle_loop])
1212
gmsh.model.occ.synchronize()
1313

14-
h = 1
14+
h = 2
1515
extrusion = gmsh.model.occ.extrude([(2, surface)], 0, 0, h)
1616
gmsh.model.occ.synchronize()
1717

0 commit comments

Comments
 (0)