[Users] Howto? Outer loop over coarse maps, inner loop over fine maps

Scott Hawley scott.hawley at belmont.edu
Sun Apr 15 18:06:52 CDT 2012


Ok.  What I'm trying to do is compute the inter-grid truncation error at
every point (where it's defined, on the coarse grid):

               2h      2h 2h h     2h h  h
           tau    :=  L  I  u  -  I  L  u
               h          h        h


The first term on the right hand side is the one for which I need to find
the intersection of bounding boxesŠ


Skyping tomorrow is fine.


On 4/15/12 5:54 PM, "Erik Schnetter" <eschnetter at perimeterinstitute.ca>
wrote:

>Scott
>
>In Carpet, fine boxes don't necessarily overlap a particular coarse
>box. Only the set of fine boxes overlaps (is contained in) the set of
>coarse boxes.
>
>Also, the meaning of cctk_bbox and what Carpet calls a bbox are
>distinct. cctk_bbox contains booleans indicating whether the current
>regions contains a piece of the boundary (or whether it is in the
>interior of the grid), while Carpet's bboxes contain (integer)
>coordinates describing the rectangles (but in 3D) that make up the
>refined regions.
>
>I don't quite understand what you are trying to do. Should we Skype
>tomorrow?
>
>-erik
>
>On Sun, Apr 15, 2012 at 4:47 PM, Scott Hawley <scott.hawley at belmont.edu>
>wrote:
>> Erik,
>>
>> How does one "nest" loops over grids at different levels?    In my way
>>of
>> doing things, it was something like...
>>
>>
>> l = level;
>>
>>  gblm1 = mgh[l-1];
>>  while (gblm1 != NULL) {
>>        Bbox coarse_bbox = gblm1->bbox;
>>
>>        gbl = mgh[l];
>>        while (gbl != NULL) {
>>          Bbox fine_bbox = gbl->bbox;
>>
>>          // On the regions for which the finer grid overlaps the coarse
>> grid,
>>         // do some operations...
>>
>>         gbl = gbl->next;
>>       }
>>
>>    gblm1 = gblm1->next;
>> }
>>
>>
>> I have an idea of something to try, below, but I'm worried that I'm
>>abusing
>> the SWITCH_TO_LEVEL macroŠ
>>
>>
>> //reflevel = finer gridŠ
>>  SWITCH_TO_LEVEL( cctkGH, reflevel - 1 ) {
>>     BEGIN_MAP_LOOP (cctkGH, CCTK_GF) {
>>           BEGIN_LOCAL_COMPONENT_LOOP (cctkGH, CCTK_GF) {
>>                DECLARE_CCTK_ARGUMENTS;
>>
>>
>>                      SWITCH_TO_LEVEL( cctkGH, reflevel ) {
>>                            BEGIN_MAP_LOOP (cctkGH, CCTK_GF) {
>>                                   BEGIN_LOCAL_COMPONENT_LOOP (cctkGH,
>> CCTK_GF) {
>>                                         DECLARE_CCTK_ARGUMENTS;
>>
>>                                        // where fine grid bbox overlaps
>> coarse bboxŠ.
>>                                       // do operations on coarse gridŠ
>>                                     SWITCH_TO_LEVEL( cctkGH, reflevel -
>>1 )
>> {
>>                                                 // do operationsŠ, e.g.
>>call
>> "L" operator
>>                                     } END_SWITCH_TO_LEVEL;
>>
>>                                  } END_LOCAL_COMPONENT_LOOP;
>>                           } END_MAP_LOOP;
>>                    } END_SWITCH_TO_LEVEL;
>>
>>
>>        } END_LOCAL_COMPONENT_LOOP;
>>     } END_MAP_LOOP;
>>
>>
>> } END_SWITCH_TO_LEVEL;
>>
>>
>>
>> Or?
>>
>
>
>
>-- 
>Erik Schnetter <eschnetter at perimeterinstitute.ca>
>http://www.perimeterinstitute.ca/personal/eschnetter/
>AIM: eschnett247, Skype: eschnett, Google Talk: schnetter at gmail.com
>




More information about the Users mailing list