diff options
author | Erik Schnetter <schnetter@aei.mpg.de> | 2005-02-01 23:17:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@aei.mpg.de> | 2005-02-01 23:17:00 +0000 |
commit | 110560c0ca649c883ae861806c5c51007c552e11 (patch) | |
tree | 4188cf591219a4903f43ba5b8ed34ba2af62ff34 /Carpet/CarpetLib/src | |
parent | 6b17562e66b64ffc53aeca248d9ef5f03ebc5188 (diff) |
CarpetLib: Whitespace change
darcs-hash:20050201231759-891bb-db87543a706110d2cd819a7f38c1e67cf27e16a3.gz
Diffstat (limited to 'Carpet/CarpetLib/src')
-rw-r--r-- | Carpet/CarpetLib/src/dh.cc | 137 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/dh.hh | 35 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/gf.cc | 7 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/gf.hh | 6 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/ggf.cc | 11 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/ggf.hh | 9 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/gh.cc | 28 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/gh.hh | 15 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/th.cc | 9 |
9 files changed, 151 insertions, 106 deletions
diff --git a/Carpet/CarpetLib/src/dh.cc b/Carpet/CarpetLib/src/dh.cc index dc3354204..e13d1ad6b 100644 --- a/Carpet/CarpetLib/src/dh.cc +++ b/Carpet/CarpetLib/src/dh.cc @@ -39,13 +39,15 @@ dh::~dh () } // Helpers -int dh::prolongation_stencil_size () const { +int dh::prolongation_stencil_size () const +{ assert (prolongation_order_space>=0); return prolongation_order_space/2; } // Modifiers -void dh::recompose (const bool do_prolongate) { +void dh::recompose (const bool do_prolongate) +{ DECLARE_CCTK_PARAMETERS; CHECKPOINT; @@ -54,28 +56,28 @@ void dh::recompose (const bool do_prolongate) { allocate_bboxes(); - foreach_reflevel_component_mglevel (&dh::setup_sync_and_refine_boxes ); - foreach_reflevel_component_mglevel (&dh::intersect_sync_with_interior ); - foreach_reflevel_component_mglevel (&dh::setup_multigrid_boxes ); - foreach_reflevel_component_mglevel (&dh::setup_refinement_interior_boxes ); - foreach_reflevel_component_mglevel (&dh::setup_refinement_exterior_boxes ); - foreach_reflevel_component_mglevel (&dh::setup_restrict_interior_boxes ); - foreach_reflevel_component_mglevel (&dh::trim_unsynced_boundaries ); + foreach_reflevel_component_mglevel (&dh::setup_sync_and_refine_boxes); + foreach_reflevel_component_mglevel (&dh::intersect_sync_with_interior); + foreach_reflevel_component_mglevel (&dh::setup_multigrid_boxes); + foreach_reflevel_component_mglevel (&dh::setup_refinement_interior_boxes); + foreach_reflevel_component_mglevel (&dh::setup_refinement_exterior_boxes); + foreach_reflevel_component_mglevel (&dh::setup_restrict_interior_boxes); + foreach_reflevel_component_mglevel (&dh::trim_unsynced_boundaries); calculate_bases(); if (output_bboxes) { cout << endl << h << endl; - foreach_reflevel_component_mglevel (&dh::do_output_bboxes ); + foreach_reflevel_component_mglevel (&dh::do_output_bboxes); output_bases(); } - foreach_reflevel_component_mglevel (&dh::assert_assert_assert ); + foreach_reflevel_component_mglevel (&dh::assert_assert_assert); if (! save_memory_during_regridding) { - save_time( do_prolongate); + save_time(do_prolongate); } else { - save_memory( do_prolongate); + save_memory(do_prolongate); } } @@ -130,7 +132,7 @@ void dh::foreach_reflevel_component_mglevel (dh::boxesop op) } } -void dh::setup_sync_and_refine_boxes( dh::dboxes & b, int rl, int c, int ml ) +void dh::setup_sync_and_refine_boxes (dh::dboxes & b, int rl, int c, int ml) { // Sync boxes const int cs = h.components(rl); @@ -152,7 +154,7 @@ void dh::setup_sync_and_refine_boxes( dh::dboxes & b, int rl, int c, int ml ) } } -void dh::intersect_sync_with_interior( dh::dboxes & box, int rl, int c, int ml ) +void dh::intersect_sync_with_interior (dh::dboxes & box, int rl, int c, int ml) { const ibset& bnds = box.boundaries; @@ -164,12 +166,12 @@ void dh::intersect_sync_with_interior( dh::dboxes & box, int rl, int c, int ml ) ovlp.normalize(); for (ibset::const_iterator b=ovlp.begin();b!=ovlp.end(); ++b) { box .recv_sync.at(cc).push_back(*b); - box1.send_sync.at(c ).push_back(*b); + box1.send_sync.at(c).push_back(*b); } } } -void dh::setup_multigrid_boxes( dh::dboxes & box, int rl, int c, int ml ) +void dh::setup_multigrid_boxes (dh::dboxes & box, int rl, int c, int ml) { const ibbox& intr = box.interior; const ibbox& extr = box.exterior; @@ -210,7 +212,7 @@ void dh::setup_multigrid_boxes( dh::dboxes & box, int rl, int c, int ml ) } // if not finest multigrid level } -void dh::setup_refinement_interior_boxes( dh::dboxes & box, int rl, int c, int ml ) +void dh::setup_refinement_interior_boxes (dh::dboxes & box, int rl, int c, int ml) { const ibbox& extr = box.exterior; @@ -229,9 +231,11 @@ void dh::setup_refinement_interior_boxes( dh::dboxes & box, int rl, int c, int m ibset recvs = extr.expand(-pss,-pss).contracted_for(intrf) & intrf; const iblistvect& rrc = box1.recv_ref_coarse; for (iblistvect::const_iterator lvi=rrc.begin(); - lvi!=rrc.end(); ++lvi) { + lvi!=rrc.end(); ++lvi) + { for (iblist::const_iterator li=lvi->begin(); - li!=lvi->end(); ++li) { + li!=lvi->end(); ++li) + { recvs -= *li; } } @@ -242,7 +246,7 @@ void dh::setup_refinement_interior_boxes( dh::dboxes & box, int rl, int c, int m const ibbox send = recv.expanded_for(extr); assert (! send.empty()); assert (send.is_contained_in(extr)); - box1.recv_ref_coarse.at(c ).push_back(recv); + box1.recv_ref_coarse.at(c).push_back(recv); box. send_ref_fine .at(cc).push_back(send); } } @@ -250,7 +254,7 @@ void dh::setup_refinement_interior_boxes( dh::dboxes & box, int rl, int c, int m } // if not finest refinement level } -void dh::setup_refinement_exterior_boxes( dh::dboxes & box, int rl, int c, int ml ) +void dh::setup_refinement_exterior_boxes (dh::dboxes & box, int rl, int c, int ml) { const ibbox& extr = box.exterior; @@ -274,9 +278,11 @@ void dh::setup_refinement_exterior_boxes( dh::dboxes & box, int rl, int c, int m // Do not count what is synced const iblistvect& rs = box1.recv_sync; for (iblistvect::const_iterator lvi=rs.begin(); - lvi!=rs.end(); ++lvi) { + lvi!=rs.end(); ++lvi) + { for (iblist::const_iterator li=lvi->begin(); - li!=lvi->end(); ++li) { + li!=lvi->end(); ++li) + { pbndsf -= *li; } } @@ -286,7 +292,8 @@ void dh::setup_refinement_exterior_boxes( dh::dboxes & box, int rl, int c, int m ibset buffers; { for (ibset::const_iterator pbi=pbndsf.begin(); - pbi!=pbndsf.end(); ++pbi) { + pbi!=pbndsf.end(); ++pbi) + { buffers |= (*pbi).expand(buffer_width, buffer_width) & extrf; } buffers.normalize(); @@ -299,9 +306,11 @@ void dh::setup_refinement_exterior_boxes( dh::dboxes & box, int rl, int c, int m // Do not prolongate what is already prolongated const iblistvect& rrbc = box1.recv_ref_bnd_coarse; for (iblistvect::const_iterator lvi=rrbc.begin(); - lvi!=rrbc.end(); ++lvi) { + lvi!=rrbc.end(); ++lvi) + { for (iblist::const_iterator li=lvi->begin(); - li!=lvi->end(); ++li) { + li!=lvi->end(); ++li) + { recvs -= *li; } } @@ -309,13 +318,14 @@ void dh::setup_refinement_exterior_boxes( dh::dboxes & box, int rl, int c, int m } { for (ibset::const_iterator ri = recvs.begin(); - ri != recvs.end(); ++ri) { + ri != recvs.end(); ++ri) + { const ibbox & recv = *ri; const ibbox send = recv.expanded_for(extr); assert (! send.empty()); assert (send.is_contained_in(extr)); assert (send.is_contained_in(extr.expand(-pss,-pss))); - box1.recv_ref_bnd_coarse.at(c ).push_back(recv); + box1.recv_ref_bnd_coarse.at(c).push_back(recv); box .send_ref_bnd_fine .at(cc).push_back(send); } } @@ -325,7 +335,7 @@ void dh::setup_refinement_exterior_boxes( dh::dboxes & box, int rl, int c, int m } // if not finest refinement level } -void dh::setup_restrict_interior_boxes( dh::dboxes & box, int rl, int c, int ml ) +void dh::setup_restrict_interior_boxes (dh::dboxes & box, int rl, int c, int ml) { const ibbox& intr = box.interior; @@ -346,18 +356,20 @@ void dh::setup_restrict_interior_boxes( dh::dboxes & box, int rl, int c, int ml for (int ccc=0; ccc<h.components(rl); ++ccc) { const iblist& sendlist = box1.recv_ref_bnd_coarse.at(ccc); for (iblist::const_iterator sli = sendlist.begin(); - sli != sendlist.end(); ++sli) { + sli != sendlist.end(); ++sli) + { sends -= *sli; } } sends.normalize(); for (ibset::const_iterator si = sends.begin(); - si != sends.end(); ++si) { + si != sends.end(); ++si) + { const ibbox recv = (*si).contracted_for(intr); if (! recv.empty()) { const ibbox & send = recv.expanded_for(intrf); assert (! send.empty()); - box1.send_ref_coarse.at(c ).push_back(send); + box1.send_ref_coarse.at(c).push_back(send); box .recv_ref_fine .at(cc).push_back(recv); } } @@ -367,7 +379,7 @@ void dh::setup_restrict_interior_boxes( dh::dboxes & box, int rl, int c, int ml } // if not finest refinement level } -void dh::trim_unsynced_boundaries( dh::dboxes & box, int rl, int c, int ml ) +void dh::trim_unsynced_boundaries (dh::dboxes & box, int rl, int c, int ml) { // Boundaries that are not synced, or are neither synced nor // prolonged to from coarser grids (outer boundaries) @@ -381,9 +393,11 @@ void dh::trim_unsynced_boundaries( dh::dboxes & box, int rl, int c, int ml ) // Subtract boxes received during synchronisation const iblistvect& recv_sync = box.recv_sync; for (iblistvect::const_iterator lvi=recv_sync.begin(); - lvi!=recv_sync.end(); ++lvi) { + lvi!=recv_sync.end(); ++lvi) + { for (iblist::const_iterator li=lvi->begin(); - li!=lvi->end(); ++li) { + li!=lvi->end(); ++li) + { sync_not -= *li; recv_not -= *li; } @@ -392,15 +406,17 @@ void dh::trim_unsynced_boundaries( dh::dboxes & box, int rl, int c, int ml ) // Subtract boxes received during prolongation const iblistvect& recv_ref_bnd_coarse = box.recv_ref_bnd_coarse; for (iblistvect::const_iterator lvi=recv_ref_bnd_coarse.begin(); - lvi!=recv_ref_bnd_coarse.end(); ++lvi) { + lvi!=recv_ref_bnd_coarse.end(); ++lvi) + { for (iblist::const_iterator li=lvi->begin(); - li!=lvi->end(); ++li) { + li!=lvi->end(); ++li) + { recv_not -= *li; } } } -void dh::assert_assert_assert( dh::dboxes & box, int rl, int c, int ml ) +void dh::assert_assert_assert (dh::dboxes & box, int rl, int c, int ml) { // Assert that all boundaries are synced or received { @@ -426,11 +442,10 @@ void dh::assert_assert_assert( dh::dboxes & box, int rl, int c, int ml ) const iblistvect& recv_ref_coarse = box.recv_ref_coarse; ibset intr = box.interior; ibset received; - for (iblistvect::const_iterator - lvi=recv_ref_coarse.begin(); - lvi!=recv_ref_coarse.end(); ++lvi) { - for (iblist::const_iterator li=lvi->begin(); - li!=lvi->end(); ++li) { + for (iblistvect::const_iterator lvi=recv_ref_coarse.begin(); + lvi!=recv_ref_coarse.end(); ++lvi) + { + for (iblist::const_iterator li=lvi->begin(); li!=lvi->end(); ++li) { const int old_sz = intr.size(); const int this_sz = li->size(); intr -= *li; @@ -460,9 +475,11 @@ void dh::assert_assert_assert( dh::dboxes & box, int rl, int c, int ml ) ibset bnds = box.boundaries; ibset received; for (iblistvect::const_iterator lvi=recv_sync.begin(); - lvi!=recv_sync.end(); ++lvi) { + lvi!=recv_sync.end(); ++lvi) + { for (iblist::const_iterator li=lvi->begin(); - li!=lvi->end(); ++li) { + li!=lvi->end(); ++li) + { const int old_sz = bnds.size(); const int this_sz = li->size(); bnds -= *li; @@ -472,11 +489,10 @@ void dh::assert_assert_assert( dh::dboxes & box, int rl, int c, int ml ) received |= *li; } } - for (iblistvect::const_iterator - lvi=recv_ref_bnd_coarse.begin(); - lvi!=recv_ref_bnd_coarse.end(); ++lvi) { - for (iblist::const_iterator li=lvi->begin(); - li!=lvi->end(); ++li) { + for (iblistvect::const_iterator lvi=recv_ref_bnd_coarse.begin(); + lvi!=recv_ref_bnd_coarse.end(); ++lvi) + { + for (iblist::const_iterator li=lvi->begin(); li!=lvi->end(); ++li) { const int old_sz = bnds.size(); const int this_sz = li->size(); bnds -= *li; @@ -502,7 +518,8 @@ void dh::assert_assert_assert( dh::dboxes & box, int rl, int c, int ml ) } } -void dh::calculate_bases () { +void dh::calculate_bases () +{ // Calculate bases bases.resize(h.mglevels()); for (int ml=0; ml<h.mglevels(); ++ml) { @@ -521,7 +538,8 @@ void dh::calculate_bases () { } } -void dh::save_time ( bool do_prolongate ) { +void dh::save_time (bool do_prolongate) +{ for (list<ggf*>::iterator f=gfs.begin(); f!=gfs.end(); ++f) { (*f)->recompose_crop (); } @@ -550,7 +568,7 @@ void dh::save_time ( bool do_prolongate ) { } // for rl } -void dh::save_memory ( bool do_prolongate ) { +void dh::save_memory (bool do_prolongate) { ggf* vectorleader = NULL; for (list<ggf*>::iterator f=gfs.begin(); f!=gfs.end(); ++f) { @@ -599,19 +617,22 @@ void dh::save_memory ( bool do_prolongate ) { } // Grid function management -void dh::add (ggf* f) { +void dh::add (ggf* f) +{ CHECKPOINT; gfs.push_back(f); } -void dh::remove (ggf* f) { +void dh::remove (ggf* f) +{ CHECKPOINT; gfs.remove(f); } // Output -void dh::output (ostream& os) const { +void dh::output (ostream& os) const +{ os << "dh:" << "ghosts=[" << lghosts << "," << ughosts << "]," << "gfs={"; @@ -624,7 +645,7 @@ void dh::output (ostream& os) const { os << "}"; } -void dh::do_output_bboxes( dh::dboxes & box, int rl, int c, int ml ) +void dh::do_output_bboxes(dh::dboxes & box, int rl, int c, int ml) { cout << endl; cout << "dh bboxes:" << endl; diff --git a/Carpet/CarpetLib/src/dh.hh b/Carpet/CarpetLib/src/dh.hh index 8fa11f152..49a7ed7f9 100644 --- a/Carpet/CarpetLib/src/dh.hh +++ b/Carpet/CarpetLib/src/dh.hh @@ -87,21 +87,21 @@ private: typedef void (dh::*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 ); - void setup_refinement_interior_boxes( dboxes & b, int rl, int c, int ml ); - void setup_refinement_exterior_boxes( dboxes & b, int rl, int c, int ml ); - void setup_restrict_interior_boxes( dboxes & b, int rl, int c, int ml ); - void trim_unsynced_boundaries( dboxes & b, int rl, int c, int ml ); - void do_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); - void save_memory( bool do_prolongate); + // 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); + void setup_refinement_interior_boxes (dboxes & b, int rl, int c, int ml); + void setup_refinement_exterior_boxes (dboxes & b, int rl, int c, int ml); + void setup_restrict_interior_boxes (dboxes & b, int rl, int c, int ml); + void trim_unsynced_boundaries (dboxes & b, int rl, int c, int ml); + void do_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); + void save_memory (bool do_prolongate); public: // should be readonly @@ -142,8 +142,9 @@ public: -inline ostream& operator<< (ostream& os, const dh& d) { - d.output(os); +inline ostream& operator<< (ostream& os, const dh& d) +{ + d.output (os); return os; } diff --git a/Carpet/CarpetLib/src/gf.cc b/Carpet/CarpetLib/src/gf.cc index e3fde8dd0..cc51697fd 100644 --- a/Carpet/CarpetLib/src/gf.cc +++ b/Carpet/CarpetLib/src/gf.cc @@ -44,7 +44,9 @@ gf<T>::gf (const int varindex_, const operator_type transport_operator_, // Destructors template<typename T> -gf<T>::~gf () { } +gf<T>::~gf () +{ +} @@ -73,7 +75,8 @@ data<T>* gf<T>::operator() (int tl, int rl, int c, int ml) // Output template<typename T> -ostream& gf<T>::output (ostream& os) const { +ostream& gf<T>::output (ostream& os) const +{ T Tdummy; os << "gf<" << typestring(Tdummy) << ">:" << varindex << "[" << CCTK_VarName(varindex) << "]," diff --git a/Carpet/CarpetLib/src/gf.hh b/Carpet/CarpetLib/src/gf.hh index fcfb82b3e..36891b86d 100644 --- a/Carpet/CarpetLib/src/gf.hh +++ b/Carpet/CarpetLib/src/gf.hh @@ -72,9 +72,9 @@ public: // Output virtual ostream& output (ostream& os) const; private: - gf (); // canonical default construtor - gf ( const gf & ); // canonical copy construtor - gf & operator =( const gf & ); // canonical copy + gf (); // canonical default construtor + gf (const gf &); // canonical copy construtor + gf & operator= (const gf &); // canonical copy }; diff --git a/Carpet/CarpetLib/src/ggf.cc b/Carpet/CarpetLib/src/ggf.cc index 7387dd298..1aa55619b 100644 --- a/Carpet/CarpetLib/src/ggf.cc +++ b/Carpet/CarpetLib/src/ggf.cc @@ -99,7 +99,7 @@ void ggf::recompose_crop () } // for c } // for rl storage.at(ml).resize(h.reflevels()); - } // for mrl + } // for ml } void ggf::recompose_allocate (const int rl) @@ -340,7 +340,8 @@ void ggf::copycat (comm_state& state, assert (recv.size()==send.size()); // walk all boxes for (iblist::const_iterator r=recv.begin(), s=send.begin(); - r!=recv.end(); ++r, ++s) { + r!=recv.end(); ++r, ++s) + { // (use the send boxes for communication) // copy the content storage.at(ml1).at(rl1).at(c1).at(tl1)->copy_from @@ -445,7 +446,8 @@ void ggf::intercat (comm_state& state, assert (recv.size()==send.size()); // walk all boxes for (iblist::const_iterator r=recv.begin(), s=send.begin(); - r!=recv.end(); ++r, ++s) { + r!=recv.end(); ++r, ++s) + { // (use the send boxes for communication) // interpolate the content storage.at(ml1).at(rl1).at(c1).at(tl1)->interpolate_from @@ -486,7 +488,8 @@ void ggf::intercat (comm_state& state, assert (recv.size()==send.size()); // walk all boxes for (iblist::const_iterator r=recv.begin(), s=send.begin(); - r!=recv.end(); ++r, ++s) { + r!=recv.end(); ++r, ++s) + { // (use the send boxes for communication) // interpolate the content storage.at(ml1).at(rl1).at(c1).at(tl1)->interpolate_from diff --git a/Carpet/CarpetLib/src/ggf.hh b/Carpet/CarpetLib/src/ggf.hh index 0fcaf960f..28e7f3e85 100644 --- a/Carpet/CarpetLib/src/ggf.hh +++ b/Carpet/CarpetLib/src/ggf.hh @@ -212,16 +212,17 @@ public: virtual ostream& output (ostream& os) const = 0; private: - ggf (); // canonical default construtor - ggf ( const ggf & ); // canonical copy construtor - ggf & operator =( const ggf & ); // canonical copy + ggf (); // canonical default construtor + ggf (const ggf &); // canonical copy construtor + ggf & operator= (const ggf &); // canonical copy }; template<int D> -inline ostream& operator<< (ostream& os, const ggf& f) { +inline ostream& operator<< (ostream& os, const ggf& f) +{ return f.output(os); } diff --git a/Carpet/CarpetLib/src/gh.cc b/Carpet/CarpetLib/src/gh.cc index 7b5f97c81..55c23def9 100644 --- a/Carpet/CarpetLib/src/gh.cc +++ b/Carpet/CarpetLib/src/gh.cc @@ -53,8 +53,8 @@ void gh::recompose (const mexts& exts, calculate_base_extents_of_all_levels (); if (output_bboxes) { - do_output_bboxes ( cout); - do_output_bases ( cout); + do_output_bboxes (cout); + do_output_bases (cout); } // Recompose the other hierarchies @@ -68,7 +68,8 @@ void gh::recompose (const mexts& exts, } } -void gh::check_processor_number_consistency () { +void gh::check_processor_number_consistency () +{ for (int rl=0; rl<reflevels(); ++rl) { assert (processors().size() == extents().at(0).size()); assert (outer_boundaries().size() == extents().at(0).size()); @@ -117,7 +118,8 @@ void gh::check_component_consistency () } } -void gh::check_base_grid_extent () { +void gh::check_base_grid_extent () +{ if (reflevels()>0) { for (int c=0; c<components(0); ++c) { // TODO: put the check back in, taking outer boundaries into @@ -169,7 +171,8 @@ void gh::calculate_base_extents_of_all_levels () } // Accessors -int gh::local_components (const int rl) const { +int gh::local_components (const int rl) const +{ int lc = 0; for (int c=0; c<components(rl); ++c) { if (is_local(rl,c)) ++lc; @@ -180,22 +183,26 @@ int gh::local_components (const int rl) const { // Time hierarchy management -void gh::add (th* t) { +void gh::add (th* t) +{ ths.push_back(t); } -void gh::remove (th* t) { +void gh::remove (th* t) +{ ths.remove(t); } // Data hierarchy management -void gh::add (dh* d) { +void gh::add (dh* d) +{ dhs.push_back(d); } -void gh::remove (dh* d) { +void gh::remove (dh* d) +{ dhs.remove(d); } @@ -230,7 +237,8 @@ void gh::do_output_bases (ostream& os) const } } -ostream& gh::output (ostream& os) const { +ostream& gh::output (ostream& os) const +{ os << "gh:" << "reffactor=" << reffact << ",refcentering=" << refcent << "," << "mgfactor=" << mgfact << ",mgcentering=" << mgcent << "," diff --git a/Carpet/CarpetLib/src/gh.hh b/Carpet/CarpetLib/src/gh.hh index 3b7f0a2c8..1520bcc6d 100644 --- a/Carpet/CarpetLib/src/gh.hh +++ b/Carpet/CarpetLib/src/gh.hh @@ -85,15 +85,18 @@ public: return _extents; } - const rbnds & outer_boundaries() const { + const rbnds & outer_boundaries() const + { return _outer_boundaries; } - const rprocs & processors() const { + const rprocs & processors() const + { return _processors; } - const vector<vector<ibbox> > & bases() const { + const vector<vector<ibbox> > & bases() const + { return _bases; } @@ -114,11 +117,13 @@ public: return (int)_extents.at(0).at(rl).size(); } - bbvect outer_boundary (const int rl, const int c) const { + bbvect outer_boundary (const int rl, const int c) const + { return _outer_boundaries.at(rl).at(c); } - int proc (const int rl, const int c) const { + int proc (const int rl, const int c) const + { return _processors.at(rl).at(c); } diff --git a/Carpet/CarpetLib/src/th.cc b/Carpet/CarpetLib/src/th.cc index 77415fffc..84b896b55 100644 --- a/Carpet/CarpetLib/src/th.cc +++ b/Carpet/CarpetLib/src/th.cc @@ -15,12 +15,14 @@ using namespace std; // Constructors th::th (gh& h_, const CCTK_REAL basedelta) - : h(h_), delta(basedelta) { + : h(h_), delta(basedelta) +{ h.add(this); } // Destructors -th::~th () { +th::~th () +{ h.remove(this); } @@ -56,7 +58,8 @@ void th::recompose () // Output -void th::output (ostream& os) const { +void th::output (ostream& os) const +{ os << "th:" << "times={"; const char * sep = ""; |