diff options
Diffstat (limited to 'src/patch/patch_system.cc')
-rw-r--r-- | src/patch/patch_system.cc | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/patch/patch_system.cc b/src/patch/patch_system.cc index fa0d28d..2fb1f17 100644 --- a/src/patch/patch_system.cc +++ b/src/patch/patch_system.cc @@ -22,6 +22,9 @@ // patch_system::type_of_name // patch_system::patch_number_of_name // +// patch_system::gridfn_copy +// patch_system::add_to_ghosted_gridfn +// // patch_system::synchronize // patch_system::compute_synchronize_Jacobian // patch_system::synchronize_Jacobian_y_ipar_posn @@ -1060,6 +1063,54 @@ error_exit(ERROR_EXIT, //****************************************************************************** // +// This function copies one (nominal-grid) gridfn to another. +// +void patch_system::gridfn_copy(int src_gfn, int dst_gfn) +{ + for (int pn = 0 ; pn < N_patches() ; ++pn) + { + patch& p = ith_patch(pn); + for (int irho = p.min_irho() ; irho <= p.max_irho() ; ++irho) + { + for (int isigma = p.min_isigma() ; + isigma <= p.max_isigma() ; + ++isigma) + { + p.gridfn(dst_gfn, irho,isigma) = p.gridfn(src_gfn, irho,isigma); + } + } + } +} + +//****************************************************************************** + +// +// This function adds a scalar to a ghosted gridfn. +// +void patch_system::add_to_ghosted_gridfn(fp delta, int ghosted_dst_gfn) +{ + for (int pn = 0 ; pn < N_patches() ; ++pn) + { + patch& p = ith_patch(pn); + for (int irho = p.ghosted_min_irho() ; + irho <= p.ghosted_max_irho() ; + ++irho) + { + for (int isigma = p.ghosted_min_isigma() ; + isigma <= p.ghosted_max_isigma() ; + ++isigma) + { + p.ghosted_gridfn(ghosted_dst_gfn, irho,isigma) += delta; + } + } + } +} + +//****************************************************************************** +//****************************************************************************** +//****************************************************************************** + +// // This function "synchronizes" all ghost zones of all patches, i.e. it // update the ghost-zone values of the specified gridfns via the appropriate // sequence of symmetry operations and interpatch interpolations. This |