Ignore:
Timestamp:
Sep 6, 2004, 1:57:41 PM (21 years ago)
Author:
ole
Message:

Cleaned up distribute

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/test_quantity.py

    r265 r274  
    254254
    255255
    256 #     def test_limiter(self):
    257 
    258 #         initialise_consecutive_datastructure(points=6+4, elements=4)         
    259        
    260 #         a = Point (0.0, 0.0)
    261 #         b = Point (0.0, 2.0)
    262 #         c = Point (2.0, 0.0)
    263 #         d = Point (0.0, 4.0)
    264 #         e = Point (2.0, 2.0)
    265 #         f = Point (4.0, 0.0)
    266 
    267 #         #Set up for a gradient of (3,1), f(x) = 3x+y
    268 #         v1 = Volume(b,a,c,array([0.0,0,0]))       
    269 #         v2 = Volume(b,c,e,array([1.0,0,0]))
    270 #         v3 = Volume(e,c,f,array([10.0,0,0]))
    271 #         v4 = Volume(d,b,e,array([0.0,0,0]))
    272 
    273 #         #Setup neighbour structure
    274 #         domain = Domain([v1,v2,v3,v4])
    275 #         domain.precompute()
    276        
    277 #         #Lets's check first order first, hey
    278 #       domain.order = 1
    279 #       domain.limiter = None
    280 #         distribute_to_vertices_and_edges(domain)
    281 #         assert allclose(v2.conserved_quantities_vertex0,
    282 #                         v2.conserved_quantities_centroid)
    283 #         assert allclose(v2.conserved_quantities_vertex1,
    284 #                         v2.conserved_quantities_centroid)
    285 #         assert allclose(v2.conserved_quantities_vertex2,
    286 #                         v2.conserved_quantities_centroid)
    287 
    288 
    289 #         #Gradient of fitted pwl surface
    290 #         a, b = compute_gradient(v2.id)
    291        
    292 
    293 #         assert abs(a[0] - 5.0) < epsilon
    294 #         assert abs(b[0]) < epsilon       
    295 #         #assert qminr[0] == 0.0
    296 #         #assert qmaxr[0] == 10.0
    297        
    298 #         #And now for the second order stuff       
    299 #         # - the full second order extrapolation
    300 #       domain.order = 2       
    301 #         distribute_to_vertices_and_edges(domain)
    302 
    303 
    304 #         qmin = qmax = v2.conserved_quantities_centroid
    305 
    306 #         qmin = minimum(qmin, v1.conserved_quantities_centroid)
    307 #         qmax = maximum(qmax, v1.conserved_quantities_centroid)
    308 
    309 #         qmin = minimum(qmin, v3.conserved_quantities_centroid)
    310 #         qmax = maximum(qmax, v3.conserved_quantities_centroid)
    311 
    312 #         qmin = minimum(qmin, v4.conserved_quantities_centroid)
    313 #         qmax = maximum(qmax, v4.conserved_quantities_centroid)                   
    314 #         #assert qminr == qmin
    315 #         #assert qmaxr == qmax
    316 
    317 #         assert v2.conserved_quantities_vertex0 <= qmax
    318 #         assert v2.conserved_quantities_vertex0 >= qmin
    319 #         assert v2.conserved_quantities_vertex1 <= qmax
    320 #         assert v2.conserved_quantities_vertex1 >= qmin
    321 #         assert v2.conserved_quantities_vertex2 <= qmax
    322 #         assert v2.conserved_quantities_vertex2 >= qmin                   
    323 
    324 
    325 #         #Check that volume has been preserved   
    326 
    327 #         q = v2.conserved_quantities_centroid[0]
    328 #         w = (v2.conserved_quantities_vertex0[0] +
    329 #              v2.conserved_quantities_vertex1[0] +
    330 #              v2.conserved_quantities_vertex2[0])/3
    331 
    332 #         assert allclose(q, w)
    333 
    334 
    335        
    336 
    337 
    338256    def test_first_order_extrapolator(self):
    339257        quantity = Conserved_quantity(self.mesh4)               
Note: See TracChangeset for help on using the changeset viewer.