diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-05-10 22:24:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-05-10 22:24:00 +0000 |
commit | 5fa7f4fab331f53618268be3240bf47ef4f6b4ef (patch) | |
tree | d8e37b4c72e463e9001cd2b4d8dbcbda70185d17 /Carpet/CarpetLib/src | |
parent | 653cc3ae18ef861f4abe354b150f8636b8193e65 (diff) |
CarpetLib: Allow empty domains
darcs-hash:20070510222457-dae7b-63f0ce31174188709611001c19feb58f3c516862.gz
Diffstat (limited to 'Carpet/CarpetLib/src')
-rw-r--r-- | Carpet/CarpetLib/src/dh.cc | 27 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/gh.cc | 3 |
2 files changed, 19 insertions, 11 deletions
diff --git a/Carpet/CarpetLib/src/dh.cc b/Carpet/CarpetLib/src/dh.cc index 1172c60e5..4aa5ce560 100644 --- a/Carpet/CarpetLib/src/dh.cc +++ b/Carpet/CarpetLib/src/dh.cc @@ -93,13 +93,16 @@ regrid () // Domain: ibbox const & domain_exterior = h.baseextent(ml,rl); - assert (not domain_exterior.empty()); + // Variables may have size zero + // assert (not domain_exterior.empty()); i2vect const & boundary_width = h.boundary_width; assert (all (all (boundary_width >= 0))); ibbox const domain_active = domain_exterior.expand (- boundary_width); - assert (not domain_active.empty()); + // Variables may have size zero + // assert (not domain_active.empty()); + assert (domain_active <= domain_exterior); ibset domain_boundary = domain_exterior - domain_active; domain_boundary.normalize(); @@ -120,8 +123,9 @@ regrid () // regridding thorn intr = h.extent (ml,rl,c); - // The interior must not be empty - assert (not intr.empty()); + // (The interior must not be empty) + // Variables may have size zero + // assert (not intr.empty()); // The interior must be contained in the domain assert (intr <= h.baseextent(ml,rl)); @@ -154,8 +158,9 @@ regrid () assert (all (all (ghost_width >= 0))); extr = intr.expand (i2vect (not is_outer_boundary) * ghost_width); - // The exterior must not be empty - assert (not extr.empty()); + // (The exterior must not be empty) + // Variables may have size zero + // assert (not extr.empty()); // The exterior must be contained in the domain assert (extr <= domain_exterior); @@ -182,8 +187,9 @@ regrid () comm = extr.expand (i2vect (is_outer_boundary) * (- boundary_width)); - // The communicated region must not be empty - assert (not comm.empty()); + // (The communicated region must not be empty) + // Variables may have size zero + // assert (not comm.empty()); // The communicated region must be contained in the active // part of the domain @@ -210,8 +216,9 @@ regrid () owned = intr.expand (i2vect (is_outer_boundary) * (- boundary_width)); - // The owned region must not be empty - assert (not owned.empty()); + // (The owned region must not be empty) + // Variables may have size zero + // assert (not owned.empty()); // The owned region must be contained in the active part of // the domain diff --git a/Carpet/CarpetLib/src/gh.cc b/Carpet/CarpetLib/src/gh.cc index e85d010d8..66722e11d 100644 --- a/Carpet/CarpetLib/src/gh.cc +++ b/Carpet/CarpetLib/src/gh.cc @@ -58,7 +58,8 @@ gh (vector<ivect> const & reffacts_, centering const refcent_, for (int ml = 0; ml < (int)baseextents.size(); ++ ml) { for (int rl = 0; rl < (int)baseextents.AT(ml).size(); ++ rl) { ibbox const & box = baseextents.AT(ml).AT(rl); - assert (all (box.shape() / box.stride() > + // This condition must hold even for zero-sized grid arrays + assert (all (box.shape() / box.stride() >= boundary_width[0] + boundary_width[1])); } } |