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

Scott Hawley scott.hawley at belmont.edu
Sun Apr 15 16:50:52 CDT 2012


Maybe like...?


 typedef bboxset <int, dim> ibboxset;
...


 // list of all bboxes on finer level
 vector <ibboxset> fine_bboxset (reflevel);

 SWITCH_TO_LEVEL( cctkGH, reflevel - 1 ) {

    CCTK_INT coarse_icstride = pow(2,reflevel-1); // TODO: Better way of
getting this info?

    //Sync up on coarser grid
    CCTK_SyncGroup(cctkGH, "BruiserConstraints::temp");

    BEGIN_MAP_LOOP (cctkGH, CCTK_GF) {
       BEGIN_LOCAL_COMPONENT_LOOP (cctkGH, CCTK_GF) {
           DECLARE_CCTK_ARGUMENTS;

              ibbox coarse_bbox;
              coarse_bbox.lower()[0] = cctk_bbox[0];
              coarse_bbox.upper()[0] = cctk_bbox[1];
              coarse_bbox.lower()[1] = cctk_bbox[2];
              coarse_bbox.upper()[1] = cctk_bbox[3];
              coarse_bbox.lower()[2] = cctk_bbox[4];
              coarse_bbox.upper()[2] = cctk_bbox[5];

             

              // loop over bboxes on finer level
              for (ibbox fine_bbox = fine_bboxset; fine_bbox != NULL;
fine_bbox = fine_bbox.next() ) {  //  ???

                 // determine overlap region for fine & coarse
                  ibbox iolap = coarse_bbox & fine_bbox;
                  CCTK_INT overlap[6];
                  overlap[0] = iolap.lower()[0];
                  overlap[1] = iolap.upper()[0];
                  overlap[2] = iolap.lower()[1];
                  overlap[3] = iolap.upper()[1];
                  overlap[4] = iolap.lower()[2];
                  overlap[5] = iolap.upper()[2];

                  /* Call lop, but only operate on region covered by fine
grid(s) */
                  //Call L operator (lop) using temp as input, placing
result into tau
                  CCTK_REAL hc = CCTK_DELTA_SPACE(0);

                  CCTK_FNAME(omplop)(
                        tauphi,      tauwx,         tauwy,      tauwz,
                        t1,          t2,            t3,         t4,
                        gxx,         gxy,           gxz,
                        gyy,         gyz,           gzz,
                        kxx,         kxy,           kxz,
                        kyy,         kyz,           kzz,
                        x,           y,             z,
                        bruiser_mask,
                        overlap,   overlap,  &coarse_icstride,
                        &(cctk_lsh[0]),&(cctk_lsh[1]),&(cctk_lsh[2]), &hc);

               }  // loop over fine bboxes
       } END_LOCAL_COMPONENT_LOOP;
    } END_MAP_LOOP;
    
   CCTK_SyncGroup(cctkGH, "BruiserConstraints::tau");

 } END_SWITCH_TO_LEVEL;







On 4/15/12 4:02 PM, "Scott Hawley" <scott.hawley at belmont.edu> wrote:

>SureŠ What are the set operations?   I've found info in the User's Guide
>and Reference Manual to "Parameter Sets", various  Reset operations, Setup
>routines, Table SetsŠ. ?
>
>
>
>On 4/15/12 3:56 PM, "Frank Loeffler" <knarf at cct.lsu.edu> wrote:
>
>>On Sun, Apr 15, 2012 at 01:47:31PM -0700, Scott Hawley wrote:
>>>          // On the regions for which the finer grid overlaps the coarse
>>>grid,
>>>         // do some operations...
>>
>>You might be able to use the set operations on the regions first to find
>>out what that region is without looping and then loop over whatever
>>level you want and use the result from before to know where to do
>>something.
>>
>>Frank
>>
>
>
>_______________________________________________
>Users mailing list
>Users at einsteintoolkit.org
>http://lists.einsteintoolkit.org/mailman/listinfo/users
>




More information about the Users mailing list