コード例 #1
0
   def test_one(self):
      if os.path.exists('test_data') and os.path.isdir('multiplex'):
          shutil.rmtree('test_data')

      mymanifold = multiplex.BifurcatedManifold('./test_data/','test01', verbose=True)
      mymanifold.load(pkg_resources.resource_filename('multiplex','default.yaml'))
      mymanifold.solve()
      assert np.sum(mymanifold.get_Q()) - 1.0215314871585195e-05 < 1e-6
コード例 #2
0
 def test_six(self):
    mymanifold = multiplex.BifurcatedManifold('./test_data/','test06',verbose=True)
    with pytest.raises(Exception):
       mymanifold.change('inlet_width (m)', 5)
    with pytest.raises(Exception):
       mymanifold.plot()
    with pytest.raises(Exception):
       mymanifold.solve()
    with pytest.raises(Exception):
       mymanifold.hdf2pvd()
    with pytest.raises(Exception):
       mymanifold.get_Q()
    with pytest.raises(Exception):
       mymanifold.get_Qin()
    mymanifold.load(pkg_resources.resource_filename('multiplex','default.yaml'))
    with pytest.raises(Exception):
       mymanifold.change('mesh_type', 'rectangular_false')
コード例 #3
0
 def test_five_6(self):
    mymanifold = multiplex.BifurcatedManifold('./test_data/','test05', verbose=True)
    with pytest.raises(Exception):
       mymanifold.load(pkg_resources.resource_filename('multiplex','default.yaml'))
コード例 #4
0
 def test_five_5(self):
    mymanifold = multiplex.BifurcatedManifold('./test_data/','test05', verbose=True)
    mymanifold.plot()
    assert(isfile("./test_data/foo.pdf"))
    with pytest.raises(Exception):
       mymanifold.change('inlet_width (m)', 5)
コード例 #5
0
 def test_five_4(self):
    mymanifold = multiplex.BifurcatedManifold('./test_data/','test05', verbose=True)
    mymanifold.solve(50)
    assert np.sum(mymanifold.get_Q()) > 0
コード例 #6
0
 def test_five_3(self):
    mymanifold = multiplex.BifurcatedManifold('./test_data/','test05', verbose=True)
    assert mymanifold.get_Qin() > 0
コード例 #7
0
 def test_five_2(self):
    mymanifold = multiplex.BifurcatedManifold('./test_data/','test05', verbose=True)
    mymanifold.hdf2pvd()
    assert isdir("./test_data/test05/")
コード例 #8
0
 def test_five_1(self):
    mymanifold = multiplex.BifurcatedManifold('./test_data/','test05', verbose=True)
    mymanifold.load(pkg_resources.resource_filename('multiplex','default.yaml'))
    mymanifold.change('manifold_type','curved')
    mymanifold.solve()
    assert np.sum(mymanifold.get_Q()) > 0 
コード例 #9
0
 def test_four_4(self):
    mymanifold = multiplex.BifurcatedManifold('./test_data/','test04', verbose=True)
    u = mymanifold.getVelocity()
    assert np.mean(u(0,0)) > 0 
コード例 #10
0
 def test_four_2(self):
    mymanifold = multiplex.BifurcatedManifold('./test_data/','test04', verbose=True)
    assert len(mymanifold.get_time_intervals()) > 0 
コード例 #11
0
 def test_two(self):
    mymanifold = multiplex.BifurcatedManifold('./test_data/','test02', verbose=True)
    mymanifold.load(pkg_resources.resource_filename('multiplex','default.yaml'))
    mymanifold.change('mass_density (kg/cubic meter)',500)
    mymanifold.solve()
    assert np.sum(mymanifold.get_Q()) > 0