[cig-commits] commit: Make [PV]_Refine_Patch_Strategy just call set_boundary in the header file, removing the .C files
Mercurial
hg at geodynamics.org
Sat Apr 16 09:55:15 PDT 2011
changeset: 165:b631fcd5107d
tag: tip
user: Walter Landry <wlandry at caltech.edu>
date: Sat Apr 16 09:54:07 2011 -0700
files: P_Refine_Patch_Strategy.C P_Refine_Patch_Strategy.h V_Refine_Patch_Strategy.C V_Refine_Patch_Strategy.h wscript
description:
Make [PV]_Refine_Patch_Strategy just call set_boundary in the header file, removing the .C files
diff -r 4da8a7a0723a -r b631fcd5107d P_Refine_Patch_Strategy.C
--- a/P_Refine_Patch_Strategy.C Sat Apr 16 09:35:26 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/* Extrapolate pressure onto ghost cells at physical boundaries.
- Everywhere else the pressure should already be set correctly. */
-
-#include "P_Refine_Patch_Strategy.h"
-
-void
-SAMRAI::solv::P_Refine_Patch_Strategy::preprocessRefine
-(hier::Patch& ,
- const hier::Patch& coarse,
- const hier::Box& ,
- const hier::IntVector& )
-{
- tbox::Pointer<pdat::CellData<double> >
- p = coarse.getPatchData(p_id);
-
- hier::Box pbox=coarse.getBox();
- hier::Box gbox=p->getGhostBox();
-
- tbox::Pointer<geom::CartesianPatchGeometry>
- geom = coarse.getPatchGeometry();
- for(int j=gbox.lower(1); j<=gbox.upper(1); ++j)
- for(int i=gbox.lower(0); i<=gbox.upper(0); ++i)
- {
- pdat::CellIndex center(tbox::Dimension(2));
- center[0]=i;
- center[1]=j;
- hier::Index ip(1,0), jp(0,1);
-
- /* This is a bit complicated because we have to deal with
- corners. I have a feeling that corners are impossible on
- these boundary boxes, but this is just to be safe. */
-
- /* x=0 */
- if(i<pbox.lower(0) && geom->getTouchesRegularBoundary(0,0))
- {
- /* y=0 */
- if(j<pbox.lower(1) && geom->getTouchesRegularBoundary(1,0))
- {
- (*p)(center)=4*(*p)(center+ip+jp) + (*p)(center+ip*2+jp*2)
- - 2*((*p)(center+ip*2+jp) + (*p)(center+ip+jp*2));
- }
- /* y=y_max */
- else if(j>pbox.upper(1) && geom->getTouchesRegularBoundary(1,1))
- {
- (*p)(center)=4*(*p)(center+ip-jp) + (*p)(center+ip*2-jp*2)
- - 2*((*p)(center+ip*2-jp) + (*p)(center+ip-jp*2));
- }
- else
- {
- (*p)(center)=2*(*p)(center+ip) - (*p)(center+ip*2);
- }
- }
- /* x=x_max */
- else if(i>pbox.upper(0) && geom->getTouchesRegularBoundary(0,1))
- {
- /* y=0 */
- if(j<pbox.lower(1) && geom->getTouchesRegularBoundary(1,0))
- {
- (*p)(center)=4*(*p)(center-ip+jp) + (*p)(center-ip*2+jp*2)
- - 2*((*p)(center-ip*2+jp) + (*p)(center-ip+jp*2));
- }
- /* y=y_max */
- else if(j>pbox.upper(1) && geom->getTouchesRegularBoundary(1,1))
- {
- (*p)(center)=4*(*p)(center-ip-jp) + (*p)(center-ip*2-jp*2)
- - 2*((*p)(center-ip*2-jp) + (*p)(center-ip-jp*2));
- }
- else
- {
- (*p)(center)=2*(*p)(center-ip) - (*p)(center-ip*2);
- }
- }
- /* These boundaries are simpler because we have already
- handled the corners */
- /* y=0 */
- else if(j<pbox.lower(1) && geom->getTouchesRegularBoundary(1,0))
- {
- (*p)(center)=2*(*p)(center+jp) - (*p)(center+jp*2);
- }
- /* y=y_max */
- else if(j>pbox.upper(1) && geom->getTouchesRegularBoundary(1,1))
- {
- (*p)(center)=2*(*p)(center-jp) - (*p)(center-jp*2);
- }
- }
-}
diff -r 4da8a7a0723a -r b631fcd5107d P_Refine_Patch_Strategy.h
--- a/P_Refine_Patch_Strategy.h Sat Apr 16 09:35:26 2011 -0700
+++ b/P_Refine_Patch_Strategy.h Sat Apr 16 09:54:07 2011 -0700
@@ -17,6 +17,7 @@
#include "SAMRAI/pdat/CellData.h"
#include "SAMRAI/pdat/CellIndex.h"
#include "Boundary.h"
+#include "set_boundary.h"
namespace SAMRAI {
namespace solv {
@@ -66,10 +67,13 @@ public:
// const hier::BoxList& fine_boxes,
// const hier::IntVector& ratio) {}
virtual void
- preprocessRefine(hier::Patch& fine,
+ preprocessRefine(hier::Patch& ,
const hier::Patch& coarse,
- const hier::Box& fine_box,
- const hier::IntVector& ratio);
+ const hier::Box& ,
+ const hier::IntVector& )
+ {
+ set_boundary(coarse,p_id,-1,true);
+ }
virtual void
postprocessRefineBoxes(
diff -r 4da8a7a0723a -r b631fcd5107d V_Refine_Patch_Strategy.C
--- a/V_Refine_Patch_Strategy.C Sat Apr 16 09:35:26 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-#include "V_Refine_Patch_Strategy.h"
-#include "set_boundary.h"
-
-void
-SAMRAI::solv::V_Refine_Patch_Strategy::preprocessRefine
-(hier::Patch& ,
- const hier::Patch& coarse,
- const hier::Box& ,
- const hier::IntVector& )
-{
- set_boundary(coarse,-1,v_id,true);
-}
diff -r 4da8a7a0723a -r b631fcd5107d V_Refine_Patch_Strategy.h
--- a/V_Refine_Patch_Strategy.h Sat Apr 16 09:35:26 2011 -0700
+++ b/V_Refine_Patch_Strategy.h Sat Apr 16 09:54:07 2011 -0700
@@ -17,6 +17,7 @@
#include "SAMRAI/pdat/SideData.h"
#include "SAMRAI/pdat/CellIndex.h"
#include "Boundary.h"
+#include "set_boundary.h"
namespace SAMRAI {
namespace solv {
@@ -66,10 +67,13 @@ public:
// const hier::BoxList& fine_boxes,
// const hier::IntVector& ratio) {}
virtual void
- preprocessRefine(hier::Patch& fine,
+ preprocessRefine(hier::Patch& ,
const hier::Patch& coarse,
- const hier::Box& fine_box,
- const hier::IntVector& ratio);
+ const hier::Box& ,
+ const hier::IntVector& )
+ {
+ set_boundary(coarse,-1,v_id,true);
+ }
virtual void
postprocessRefineBoxes(
diff -r 4da8a7a0723a -r b631fcd5107d wscript
--- a/wscript Sat Apr 16 09:35:26 2011 -0700
+++ b/wscript Sat Apr 16 09:54:07 2011 -0700
@@ -27,8 +27,6 @@ def build(bld):
'P_Boundary_Refine.C',
'V_Boundary_Refine/refine.C',
'V_Boundary_Refine/Update_V.C',
- 'P_Refine_Patch_Strategy.C',
- 'V_Refine_Patch_Strategy.C',
'V_Coarsen_Patch_Strategy/postprocessCoarsen_2D.C',
'V_Coarsen_Patch_Strategy/postprocessCoarsen_3D.C',
'Cell_Viscosity_Coarsen.C',
More information about the CIG-COMMITS
mailing list