[Users] Carpet: operate on one refinement level?

Erik Schnetter schnetter at cct.lsu.edu
Mon May 20 17:07:45 CDT 2013


Scott

Your "inelegant" solution is correct.

The most elegant way is

BEGIN_GLOBAL_MODE(cctkGH) {
  ENTER_LEVEL_MODE(cctkGH, 0) {
   // code
  } LEAVE_LEVEL_MODE;
} END_GLOBAL_MODE;

-erik




On Mon, May 20, 2013 at 5:35 PM, Scott Hawley <scott.hawley at belmont.edu>wrote:

> Hi, I can't seem to get the right combinations of modes correct...
>
> I want to do a set of operations on the base grid, i.e. reflevel==0.
>
> I've used BEGIN_REFLEVEL_LOOP before, but I no longer want a loop, just
> level zero.
> I'm trying this....
>
>   BEGIN_GLOBAL_MODE (cctkGH) {
>      BEGIN_LEVEL_MODE (cctkGH) {
>         SWITCH_TO_LEVEL( cctkGH, 0) {
>
>              //my other code here...
>         } END_SWITCH_TO_LEVEL;
>      } END_LEVEL_MODE;
>   } END_GLOBAL_MODE;
>
>
>
> ...but I get a failed assertion:
> Assertion failed: (not is_global_mode()), function level_escape, file
> /Users/shawley/Cactus/configs/bruiser/build/Carpet/modes.cc, line 1123.
>
>
> If I take out the two lines with "GLOBAL_MODE", I get the same failed
> assertion.
>
>
> What's the proper way to implement this?
> Thanks,
> Scott
>
>
>
> P.S.- For now, I'll just use...
>
> BEGIN_GLOBAL_MODE (cctkGH) {
>    BEGIN_REFLEVEL_LOOP (cctkGH) {
>
>       if (reflevel != 0) break;
>       //my other code here....
>    } END_REFLEVEL_LOOP;
> } END_GLOBAL_MODE;
>
>
>
> ...but this seems pretty inelegant.
>
>
> _______________________________________________
> Users mailing list
> Users at einsteintoolkit.org
> http://lists.einsteintoolkit.org/mailman/listinfo/users
>



-- 
Erik Schnetter <schnetter at cct.lsu.edu>
http://www.perimeterinstitute.ca/personal/eschnetter/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/users/attachments/20130520/66c9bc6d/attachment.html 


More information about the Users mailing list