diff --git a/examples/ex23.py b/examples/ex23.py index 20de152b..2ab4150f 100644 --- a/examples/ex23.py +++ b/examples/ex23.py @@ -10,7 +10,8 @@ import numpy as np from numpy import sin, cos, exp, sqrt, pi, abs, array, floor, log, sum -mfem_version = mfem.MFEM_VERSION_MAJOR*10 + mfem.MFEM_VERSION_MINOR +mfem_version = (mfem.MFEM_VERSION_MAJOR*100 + mfem.MFEM_VERSION_MINOR*10+ + mfem.MFEM_VERSION_PATCH) def run(mesh_file="", @@ -46,7 +47,7 @@ def __init__(self, fespace, ess_bdr, speed): M.AddDomainIntegrator(mfem.MassIntegrator()) M.Assemble() - if mfem_version < 47: + if mfem_version < 471: dummy = mfem.intArray() self.Kmat0 = mfem.SparseMatrix() K.FormSystemMatrix(dummy, self.Kmat0) @@ -115,7 +116,7 @@ def ImplicitSolve(self, fac0, fac1, u, dudt, d2udt2): self.T_solver.Mult(z, d2udt2) - if mfem_version >= 47: + if mfem_version >= 471: d2udt2.SetSubVector(self.ess_tdof_list, 0.0) def SetParameters(self, u): diff --git a/examples/ex39p.py b/examples/ex39p.py index 3756203e..84115843 100644 --- a/examples/ex39p.py +++ b/examples/ex39p.py @@ -51,7 +51,7 @@ from mpi4py import MPI num_procs = MPI.COMM_WORLD.size myid = MPI.COMM_WORLD.rank - +smyid = '.'+'{:0>6d}'.format(myid) def run(order=1, meshfile='', @@ -254,10 +254,12 @@ def run(order=1, # local finite element solution on each processor. a.RecoverFEMSolution(X, b, x) - # 15. Save the refined mesh and the solution in parallel. This output can - # be viewed later using GLVis: "glvis -np -m mesh -g sol". - pmesh.Save('mesh') - x.Save('sol') + # 15. Save the refined mesh and the solution in parallel. + # This output can be viewed later using GLVis: "glvis -np -m mesh -g sol". + # + # Python note: In Python, suffix based on myid needs to be added explicitly. + pmesh.Print('mesh'+smyid) + x.Save('sol'+smyid) # 16. Send the solution by socket to a GLVis server. if visualization: