aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib
diff options
context:
space:
mode:
Diffstat (limited to 'Carpet/CarpetLib')
-rw-r--r--Carpet/CarpetLib/src/dh.cc15
-rw-r--r--Carpet/CarpetLib/src/dh.hh14
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_real8_2tl_o3.F776
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_real8_3tl_o3.F776
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_real8_o3.F776
5 files changed, 30 insertions, 17 deletions
diff --git a/Carpet/CarpetLib/src/dh.cc b/Carpet/CarpetLib/src/dh.cc
index 8524b1d5a..ec51bfd65 100644
--- a/Carpet/CarpetLib/src/dh.cc
+++ b/Carpet/CarpetLib/src/dh.cc
@@ -1,12 +1,12 @@
/***************************************************************************
dh.cc - Data Hierarchy
- a grid hierarchy plus ghost zones
+ A grid hierarchy plus ghost zones
-------------------
begin : Sun Jun 11 2000
copyright : (C) 2000 by Erik Schnetter
email : schnetter@astro.psu.edu
- $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.cc,v 1.11 2001/03/27 22:26:31 eschnett Exp $
+ $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.cc,v 1.12 2001/03/28 18:56:09 eschnett Exp $
***************************************************************************/
@@ -38,10 +38,13 @@ using namespace std;
// Constructors
template<int D>
-dh<D>::dh (gh<D>& h, const ivect& lghosts, const ivect& ughosts)
- : h(h), lghosts(lghosts), ughosts(ughosts)
+dh<D>::dh (gh<D>& h, const ivect& lghosts, const ivect& ughosts,
+ int prolongation_order)
+ : h(h), lghosts(lghosts), ughosts(ughosts),
+ prolongation_order(prolongation_order)
{
assert (all(lghosts>=0 && ughosts>=0));
+ assert (prolongation_order>=0);
CHECKPOINT;
h.add(this);
recompose();
@@ -196,7 +199,9 @@ void dh<D>::recompose () {
// (the prolongation may use the exterior of the
// coarse grid, and must fill all of the boundary of
// the fine grid)
- const ibbox recv = extr.contracted_for(bndf) & bndf;
+ const int pss = prolongation_stencil_size();
+ const ibbox recv = (extr.expand(-pss,-pss).contracted_for(bndf)
+ & bndf);
const ibbox send = recv.expanded_for(extr);
assert (send.is_contained_in(extr));
boxes[rl+1][cc][ml].recv_ref_bnd_coarse[c ].push_back(recv);
diff --git a/Carpet/CarpetLib/src/dh.hh b/Carpet/CarpetLib/src/dh.hh
index 09b185ec5..2267db505 100644
--- a/Carpet/CarpetLib/src/dh.hh
+++ b/Carpet/CarpetLib/src/dh.hh
@@ -1,12 +1,12 @@
/***************************************************************************
dh.hh - Data Hierarchy
- A grid hierarchy plus ghost zones
+ A grid hierarchy plus ghost zones
-------------------
begin : Sun Jun 11 2000
copyright : (C) 2000 by Erik Schnetter
email : schnetter@astro.psu.edu
- $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.hh,v 1.5 2001/03/27 22:26:31 eschnett Exp $
+ $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.hh,v 1.6 2001/03/28 18:56:09 eschnett Exp $
***************************************************************************/
@@ -101,6 +101,7 @@ public: // should be readonly
// Fields
gh<D> &h; // hierarchy
ivect lghosts, ughosts; // ghost zones
+ int prolongation_order; // order of spatial prolongation operator
rboxes boxes;
rbases bases;
@@ -110,11 +111,18 @@ public: // should be readonly
public:
// Constructors
- dh (gh<D>& h, const ivect& lghosts, const ivect& ughosts);
+ dh (gh<D>& h, const ivect& lghosts, const ivect& ughosts,
+ int prolongation_order);
// Destructors
~dh ();
+ // Helpers
+ int prolongation_stencil_size () const {
+ assert (prolongation_order>=0);
+ return prolongation_order/2;
+ }
+
// Modifiers
void recompose ();
diff --git a/Carpet/CarpetLib/src/prolongate_3d_real8_2tl_o3.F77 b/Carpet/CarpetLib/src/prolongate_3d_real8_2tl_o3.F77
index 5b0f6b930..4f17e67c0 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_real8_2tl_o3.F77
+++ b/Carpet/CarpetLib/src/prolongate_3d_real8_2tl_o3.F77
@@ -1,5 +1,5 @@
c -*-Fortran-*-
-c $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/prolongate_3d_real8_2tl_o3.F77,v 1.2 2001/03/26 02:27:47 eschnett Exp $
+c $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/prolongate_3d_real8_2tl_o3.F77,v 1.3 2001/03/28 18:56:09 eschnett Exp $
#include "cctk.h"
@@ -62,8 +62,8 @@ c bbox(:,3) is stride
$ .or. mod(regbbox(d,1), regbbox(d,3)).ne.0) then
call CCTK_WARN (0, "Internal error: array origins are not integer multiples of the strides")
end if
- if (regbbox(d,1)-1.lt.srcbbox(d,1)
- $ .or. regbbox(d,2)+1.gt.srcbbox(d,2)
+ if (regbbox(d,1)-regbbox(d,3).lt.srcbbox(d,1)
+ $ .or. regbbox(d,2)+regbbox(d,3).gt.srcbbox(d,2)
$ .or. regbbox(d,1).lt.dstbbox(d,1)
$ .or. regbbox(d,2).gt.dstbbox(d,2)) then
call CCTK_WARN (0, "Internal error: region extent is not contained in array extents")
diff --git a/Carpet/CarpetLib/src/prolongate_3d_real8_3tl_o3.F77 b/Carpet/CarpetLib/src/prolongate_3d_real8_3tl_o3.F77
index 3d9b1506e..7c16e8d35 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_real8_3tl_o3.F77
+++ b/Carpet/CarpetLib/src/prolongate_3d_real8_3tl_o3.F77
@@ -1,5 +1,5 @@
c -*-Fortran-*-
-c $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/prolongate_3d_real8_3tl_o3.F77,v 1.2 2001/03/26 02:27:47 eschnett Exp $
+c $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/prolongate_3d_real8_3tl_o3.F77,v 1.3 2001/03/28 18:56:09 eschnett Exp $
#include "cctk.h"
@@ -64,8 +64,8 @@ c bbox(:,3) is stride
$ .or. mod(regbbox(d,1), regbbox(d,3)).ne.0) then
call CCTK_WARN (0, "Internal error: array origins are not integer multiples of the strides")
end if
- if (regbbox(d,1)-1.lt.srcbbox(d,1)
- $ .or. regbbox(d,2)+1.gt.srcbbox(d,2)
+ if (regbbox(d,1)-regbbox(d,3).lt.srcbbox(d,1)
+ $ .or. regbbox(d,2)+regbbox(d,3).gt.srcbbox(d,2)
$ .or. regbbox(d,1).lt.dstbbox(d,1)
$ .or. regbbox(d,2).gt.dstbbox(d,2)) then
call CCTK_WARN (0, "Internal error: region extent is not contained in array extents")
diff --git a/Carpet/CarpetLib/src/prolongate_3d_real8_o3.F77 b/Carpet/CarpetLib/src/prolongate_3d_real8_o3.F77
index d6510695c..5ee417885 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_real8_o3.F77
+++ b/Carpet/CarpetLib/src/prolongate_3d_real8_o3.F77
@@ -1,5 +1,5 @@
c -*-Fortran-*-
-c $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/prolongate_3d_real8_o3.F77,v 1.2 2001/03/26 02:27:47 eschnett Exp $
+c $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/prolongate_3d_real8_o3.F77,v 1.3 2001/03/28 18:56:09 eschnett Exp $
#include "cctk.h"
@@ -57,8 +57,8 @@ c bbox(:,3) is stride
$ .or. mod(regbbox(d,1), regbbox(d,3)).ne.0) then
call CCTK_WARN (0, "Internal error: array origins are not integer multiples of the strides")
end if
- if (regbbox(d,1)-1.lt.srcbbox(d,1)
- $ .or. regbbox(d,2)+1.gt.srcbbox(d,2)
+ if (regbbox(d,1)-regbbox(d,3).lt.srcbbox(d,1)
+ $ .or. regbbox(d,2)+regbbox(d,3).gt.srcbbox(d,2)
$ .or. regbbox(d,1).lt.dstbbox(d,1)
$ .or. regbbox(d,2).gt.dstbbox(d,2)) then
call CCTK_WARN (0, "Internal error: region extent is not contained in array extents")