Changeset 274 for inundation/ga/storm_surge/pyvolution/test_quantity.py
- Timestamp:
- Sep 6, 2004, 1:57:41 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/test_quantity.py
r265 r274 254 254 255 255 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+y268 # 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 structure274 # domain = Domain([v1,v2,v3,v4])275 # domain.precompute()276 277 # #Lets's check first order first, hey278 # domain.order = 1279 # domain.limiter = None280 # 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 surface290 # a, b = compute_gradient(v2.id)291 292 293 # assert abs(a[0] - 5.0) < epsilon294 # assert abs(b[0]) < epsilon295 # #assert qminr[0] == 0.0296 # #assert qmaxr[0] == 10.0297 298 # #And now for the second order stuff299 # # - the full second order extrapolation300 # domain.order = 2301 # distribute_to_vertices_and_edges(domain)302 303 304 # qmin = qmax = v2.conserved_quantities_centroid305 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 == qmin315 # #assert qmaxr == qmax316 317 # assert v2.conserved_quantities_vertex0 <= qmax318 # assert v2.conserved_quantities_vertex0 >= qmin319 # assert v2.conserved_quantities_vertex1 <= qmax320 # assert v2.conserved_quantities_vertex1 >= qmin321 # assert v2.conserved_quantities_vertex2 <= qmax322 # assert v2.conserved_quantities_vertex2 >= qmin323 324 325 # #Check that volume has been preserved326 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])/3331 332 # assert allclose(q, w)333 334 335 336 337 338 256 def test_first_order_extrapolator(self): 339 257 quantity = Conserved_quantity(self.mesh4)
Note: See TracChangeset
for help on using the changeset viewer.