diff options
author | swhite <schnetter@cct.lsu.edu> | 2004-11-22 17:34:00 +0000 |
---|---|---|
committer | swhite <schnetter@cct.lsu.edu> | 2004-11-22 17:34:00 +0000 |
commit | 2dae3d02afaf0eee1e0151322fca29b8def3b914 (patch) | |
tree | edc941d1e29012f129344fdcfa72fed4f2d9ebec /Carpet/CarpetLib/src/dh.hh | |
parent | 3f9c169f9357c1d537ec8b44f6904e6d279f7fca (diff) |
dh_decompose
Broke up dh<D>::recompose( bool ) into bite-sized chunks.
Made use of member function pointers to cut down as many as three
levels of blocks. See 'foreach_reflevel_component_mglevel'.
Advantages:
1) the code of the main function 'recompose' now presents an outline of
its functionality, rather than a post-ice-age deluge.
2) component functions are named according to some comment found in the
code. For those who want to minimise comments.
3) most of the functions conform to my "rule of thumb" (comprehensible
chunks of code are no longer than my thumb)
4) nesting substantially reduced (The functions that still have more
than 5 levels of nested blocks are mostly those that are also
unthumbworthy. More room on the screen, but still room for
improvement.)
darcs-hash:20041122173415-32473-616506e73f5c93be610bc773adaa7867663cb726.gz
Diffstat (limited to 'Carpet/CarpetLib/src/dh.hh')
-rw-r--r-- | Carpet/CarpetLib/src/dh.hh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Carpet/CarpetLib/src/dh.hh b/Carpet/CarpetLib/src/dh.hh index 4abee1112..17374caf2 100644 --- a/Carpet/CarpetLib/src/dh.hh +++ b/Carpet/CarpetLib/src/dh.hh @@ -96,10 +96,14 @@ private: typedef vector<dbases> mbases; // ... for each multigrid level typedef vector<mbases> rbases; // ... for each refinement level - void allocate_bboxes(); + void allocate_bboxes(); + // generic member function taking a dboxes, + // a refinement level, a component, and a + // multigrid level typedef void (dh<D>::*boxesop)( dboxes &, int rl, int c, int ml ); void foreach_reflevel_component_mglevel ( boxesop op ); + // these all of form 'boxesop' void setup_sync_and_refine_boxes( dboxes & b, int rl, int c, int ml ); void intersect_sync_with_interior( dboxes & b, int rl, int c, int ml ); void setup_multigrid_boxes( dboxes & b, int rl, int c, int ml ); @@ -109,6 +113,7 @@ private: void trim_unsynced_boundaries( dboxes & b, int rl, int c, int ml ); void output_bboxes( dboxes & b, int rl, int c, int ml ); void assert_assert_assert( dboxes & b, int rl, int c, int ml ); + void calculate_bases(); void output_bases(); void save_time( bool do_prolongate); |