Exemplo n.º 1
0
 def testRefine2(self):
     mydis = vc.CylinderDiscretization(nPoints=5, nRefine=2)
     mydis.compute(self.params, self.unknowns)
     npt.assert_array_equal(self.unknowns['z_param'],
                            np.array([0.0, 1.0, 3.0, 6.0, 10.0]))
     npt.assert_array_equal(
         self.unknowns['z_full'],
         np.array([0.0, 0.5, 1.0, 2.0, 3.0, 4.5, 6.0, 8.0, 10.0]))
     npt.assert_array_equal(self.unknowns['d_full'], 5.0)
     npt.assert_array_equal(self.unknowns['t_full'], 0.05)
Exemplo n.º 2
0
 def testFoundation(self):
     self.params["foundation_height"] = -30.0
     mydis = vc.CylinderDiscretization(nPoints=5, nRefine=2)
     mydis.compute(self.params, self.unknowns)
     npt.assert_array_equal(self.unknowns["z_param"],
                            np.array([0.0, 1.0, 3.0, 6.0, 10.0]) - 30.0)
     npt.assert_array_equal(
         self.unknowns["z_full"],
         np.array([0.0, 0.5, 1.0, 2.0, 3.0, 4.5, 6.0, 8.0, 10.0]) - 30.0)
     npt.assert_array_equal(self.unknowns["d_full"], 5.0)
     npt.assert_array_equal(self.unknowns["t_full"], 0.05)
Exemplo n.º 3
0
 def testRefineInterp(self):
     self.params['diameter'] = np.array([5.0, 5.0, 6.0, 7.0, 7.0])
     self.params['wall_thickness'] = 1e-2 * np.array([5.0, 5.0, 6.0, 7.0])
     mydis = vc.CylinderDiscretization(nPoints=5, nRefine=2)
     mydis.compute(self.params, self.unknowns)
     npt.assert_array_equal(self.unknowns['z_param'],
                            np.array([0.0, 1.0, 3.0, 6.0, 10.0]))
     npt.assert_array_equal(
         self.unknowns['z_full'],
         np.array([0.0, 0.5, 1.0, 2.0, 3.0, 4.5, 6.0, 8.0, 10.0]))
     npt.assert_array_equal(
         self.unknowns['d_full'],
         np.array([5.0, 5.0, 5.0, 5.5, 6.0, 6.5, 7.0, 7.0, 7.0]))
     npt.assert_array_equal(
         self.unknowns['t_full'],
         1e-2 * np.array([5.0, 5.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0]))
Exemplo n.º 4
0
 def testRefine3(self):
     mydis = vc.CylinderDiscretization(nPoints=5, nRefine=2)
     mydis.compute(self.params, self.unknowns)
     for k in self.unknowns['z_param']:
         self.assertIn(k, self.unknowns['z_full'])