Commit 29e0f581 by Nathan Coppin

parent f2b45c1d
Pipeline #7755 passed with stage
in 1 minute and 53 seconds
 ... ... @@ -44,7 +44,7 @@ def genInitialPosition(filename, rmin, rmax, H, lx, ly, rhop) : rhop -- particles density """ # Particles structure builder p = scontact.ParticleProblem(2) p = scontact.ParticleProblem(2,True,True) # Load mesh.msh file specifying physical boundaries names p.add_boundary_segment((-lx/2,0),(lx/2,0),"bottom") p.add_boundary_segment((lx/2,0),(lx/2,ly),"right") ... ... @@ -114,10 +114,10 @@ class Weight(unittest.TestCase) : # forces = g*p.mass() def accumulate(bnd_forces) : bnd_forces += total_boundary_impulsion(p)/dt bnd_forces += total_boundary_impulsion(p) while t < tEnd : bnd_forces = np.zeros((2,)) time_integration.iterate(None,p,dt,min_nsub=2,external_particles_forces=forces, time_integration.iterate(None,p,dt,min_nsub=1,external_particles_forces=forces, after_sub_iter = lambda subdt : accumulate(bnd_forces)) t += dt if ii %outf == 0 : ... ... @@ -126,5 +126,5 @@ class Weight(unittest.TestCase) : print("%i : %.2g/%.2g" % (ii, t, tEnd)) error = np.sqrt(sum(sum(forces) - bnd_forces)**2) error /= np.sqrt(sum(sum(forces)**2)) print(error*100,"%",p.n_particles()) print(error*100,"%") self.assertLess(error,.5/100., "error is too large in weight")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!