diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-08-01 14:56:27 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-08-01 14:56:27 +0000 |
commit | cb8484757929a737a84350df1674b60ef50612c8 (patch) | |
tree | e0a41fee172a51c8a7c500e4893e2cb435af98cc /src/patch/patch_system.hh | |
parent | cd8d513ba9bac10e6fc0b72620e32191a2916d06 (diff) |
permute order of various functions in these files for greater clarity
-- no changes to actual code
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@679 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/patch/patch_system.hh')
-rw-r--r-- | src/patch/patch_system.hh | 219 |
1 files changed, 111 insertions, 108 deletions
diff --git a/src/patch/patch_system.hh b/src/patch/patch_system.hh index 6c07fb3..d7b39bd 100644 --- a/src/patch/patch_system.hh +++ b/src/patch/patch_system.hh @@ -107,27 +107,6 @@ public: int N_grid_points() const { return N_grid_points_; } int ghosted_N_grid_points() const { return ghosted_N_grid_points_; } - // convert (patch,irho,isigma) <--> 1-D 0-origin grid point number (gpn) - int gpn_of_patch_irho_isigma(const patch& p, int irho, int isigma) - const - { - return starting_gpn_[p.patch_number()] - + p.gpn_of_irho_isigma(irho,isigma); - } - int ghosted_gpn_of_patch_irho_isigma(const patch& p, - int irho, int isigma) - const - { - return ghosted_starting_gpn_[p.patch_number()] - + p.ghosted_gpn_of_irho_isigma(irho,isigma); - } - // ... n.b. we return patch as a reference via the function result; - // an alternative would be to have a patch*& argument - patch& patch_irho_isigma_of_gpn(int gpn, int& irho, int& isigma) - const; - patch& ghosted_patch_irho_isigma_of_gpn(int gpn, int& irho, int& isigma) - const; - // // ***** meta-info about gridfns ***** @@ -143,6 +122,88 @@ public: // + // ***** synchronize() and its Jacobian ***** + // +public: + // "synchronize" all ghost zones of all patches, + // i.e. update the ghost-zone values of the specified gridfns + // via the appropriate sequence of symmetry operations + // and interpatch interpolations + void synchronize(int ghosted_min_gfn_to_sync, + int ghosted_max_gfn_to_sync); + + // ... do this for all ghosted gridfns + void synchronize() + { + synchronize(ghosted_min_gfn(), + ghosted_max_gfn()); + } + + + // + // compute Jacobian of synchronize() into internal buffers, + // taking into account synchronize()'s full 3-phase algorithm + // + void compute_synchronize_Jacobian(int ghosted_min_gfn_to_sync, + int ghosted_max_gfn_to_sync) + const; + + // ... do this for all ghosted gridfns + void compute_synchronize_Jacobian() + const + { + compute_synchronize_Jacobian(ghosted_min_gfn(), + ghosted_max_gfn()); + } + + // + // The following functions access the Jacobian computed by + // compute_synchronize_Jacobian() . Note this API has the + // same implicit assumptions on the Jacobian structure documented + // in the comments in "ghost_zone.hh" immediately following + // ghost_zone::compute_Jacobian() . + // + + // to which patch/edge do the y points in a Jacobian row belong? + patch& synchronize_Jacobian_y_patch(const ghost_zone& xgz) + const + { return xgz.Jacobian_y_patch(); } + const patch_edge& synchronize_Jacobian_y_edge (const ghost_zone& xgz) + const + { return xgz.Jacobian_y_edge(); } + + // what is the [min,max] range of m for a Jacobian row? + int synchronize_Jacobian_min_y_ipar_m(const ghost_zone& xgz) + const + { return xgz.Jacobian_min_y_ipar_m(); } + int synchronize_Jacobian_max_y_ipar_m(const ghost_zone& xgz) + const + { return xgz.Jacobian_max_y_ipar_m(); } + + // what is the iperp of the Jacobian y points in their (y) patch? + int synchronize_Jacobian_y_iperp(const ghost_zone& xgz, int x_iperp) + const + { return xgz.Jacobian_y_iperp(x_iperp); } + + // what is the posn value of the y points in this Jacobian row? + int synchronize_Jacobian_y_ipar_posn(const ghost_zone& xgz, + int x_iperp, int x_ipar) + const; + + // what is the Jacobian + // partial synchronize() gridfn(ghosted_gfn, px, x_iperp, x_ipar) + // ------------------------------------------------------------- + // partial gridfn(ghosted_gfn, py, y_iperp, y_posn+y_ipar_m) + // where + // y_iperp = Jacobian_y_iperp(x_iperp) + // y_posn = Jacobian_y_ipar_posn(x_iperp, x_ipar) + // taking into account synchronize()'s full 3-phase algorithm + fp synchronize_Jacobian(const ghost_zone& xgz, int x_iperp, int x_ipar, + int y_ipar_m) + const; + + + // // ***** gridfn operations ***** // @@ -154,23 +215,6 @@ public: // - // ***** access to gridfns as 1-D arrays[gpn] ***** - // ... n.b. this interface implicitly assumes that gridfn data - // arrays are contiguous across patches; this is ensured by - // setup_gridfn_storage() (called by our constructor) - // -public: - const fp* gridfn_data(int gfn) const - { return ith_patch(0).gridfn_data_array(gfn); } - fp* gridfn_data(int gfn) - { return ith_patch(0).gridfn_data_array(gfn); } - const fp* ghosted_gridfn_data(int ghosted_gfn) const - { return ith_patch(0).ghosted_gridfn_data_array(ghosted_gfn); } - fp* ghosted_gridfn_data(int ghosted_gfn) - { return ith_patch(0).ghosted_gridfn_data_array(ghosted_gfn); } - - - // // ***** I/O ***** // public: @@ -248,86 +292,45 @@ private: // - // ***** ghost zone operations ***** + // ***** access to gridfns as 1-D arrays ***** + // + // ... n.b. this interface implicitly assumes that gridfn data + // arrays are contiguous across patches; this is ensured by + // setup_gridfn_storage() (called by our constructor) // public: - // "synchronize" all ghost zones of all patches, - // i.e. update the ghost-zone values of the specified gridfns - // via the appropriate sequence of symmetry operations - // and interpatch interpolations - void synchronize(int ghosted_min_gfn_to_sync, - int ghosted_max_gfn_to_sync); - - // ... do this for all ghosted gridfns - void synchronize() + // convert (patch,irho,isigma) <--> 1-D 0-origin grid point number (gpn) + int gpn_of_patch_irho_isigma(const patch& p, int irho, int isigma) + const { - synchronize(ghosted_min_gfn(), - ghosted_max_gfn()); + return starting_gpn_[p.patch_number()] + + p.gpn_of_irho_isigma(irho,isigma); } - - - // - // compute Jacobian of synchronize() into internal buffers, - // taking into account synchronize()'s full 3-phase algorithm - // - void compute_synchronize_Jacobian(int ghosted_min_gfn_to_sync, - int ghosted_max_gfn_to_sync) - const; - - // ... do this for all ghosted gridfns - void compute_synchronize_Jacobian() + int ghosted_gpn_of_patch_irho_isigma(const patch& p, + int irho, int isigma) const { - compute_synchronize_Jacobian(ghosted_min_gfn(), - ghosted_max_gfn()); + return ghosted_starting_gpn_[p.patch_number()] + + p.ghosted_gpn_of_irho_isigma(irho,isigma); } - - // - // The following functions access the Jacobian computed by - // compute_synchronize_Jacobian() . Note this API has the - // same implicit assumptions on the Jacobian structure documented - // in the comments in "ghost_zone.hh" immediately following - // ghost_zone::compute_Jacobian() . - // - - // to which patch/edge do the y points in a Jacobian row belong? - patch& synchronize_Jacobian_y_patch(const ghost_zone& xgz) - const - { return xgz.Jacobian_y_patch(); } - const patch_edge& synchronize_Jacobian_y_edge (const ghost_zone& xgz) - const - { return xgz.Jacobian_y_edge(); } - - // what is the [min,max] range of m for a Jacobian row? - int synchronize_Jacobian_min_y_ipar_m(const ghost_zone& xgz) - const - { return xgz.Jacobian_min_y_ipar_m(); } - int synchronize_Jacobian_max_y_ipar_m(const ghost_zone& xgz) - const - { return xgz.Jacobian_max_y_ipar_m(); } - - // what is the iperp of the Jacobian y points in their (y) patch? - int synchronize_Jacobian_y_iperp(const ghost_zone& xgz, int x_iperp) - const - { return xgz.Jacobian_y_iperp(x_iperp); } - - // what is the posn value of the y points in this Jacobian row? - int synchronize_Jacobian_y_ipar_posn(const ghost_zone& xgz, - int x_iperp, int x_ipar) + // ... n.b. we return patch as a reference via the function result; + // an alternative would be to have a patch*& argument + patch& patch_irho_isigma_of_gpn(int gpn, int& irho, int& isigma) const; - - // what is the Jacobian - // partial synchronize() gridfn(ghosted_gfn, px, x_iperp, x_ipar) - // ------------------------------------------------------------- - // partial gridfn(ghosted_gfn, py, y_iperp, y_posn+y_ipar_m) - // where - // y_iperp = Jacobian_y_iperp(x_iperp) - // y_posn = Jacobian_y_ipar_posn(x_iperp, x_ipar) - // taking into account synchronize()'s full 3-phase algorithm - fp synchronize_Jacobian(const ghost_zone& xgz, int x_iperp, int x_ipar, - int y_ipar_m) + patch& ghosted_patch_irho_isigma_of_gpn(int gpn, int& irho, int& isigma) const; + // access actual gridfn data arrays + // (low-level, dangerous, use with caution) + const fp* gridfn_data(int gfn) const + { return ith_patch(0).gridfn_data_array(gfn); } + fp* gridfn_data(int gfn) + { return ith_patch(0).gridfn_data_array(gfn); } + const fp* ghosted_gridfn_data(int ghosted_gfn) const + { return ith_patch(0).ghosted_gridfn_data_array(ghosted_gfn); } + fp* ghosted_gridfn_data(int ghosted_gfn) + { return ith_patch(0).ghosted_gridfn_data_array(ghosted_gfn); } + // // ***** constructor, destructor ***** |