[cig-commits] commit: Remove P_MDPI_Refine

Mercurial hg at geodynamics.org
Thu Jun 7 13:35:31 PDT 2012


changeset:   252:4bf62b161d54
user:        Walter Landry <wlandry at caltech.edu>
date:        Tue Jun 05 16:02:47 2012 -0700
files:       src/P_MDPI_Refine.C src/P_MDPI_Refine.h src/StokesFACOps/smooth_V_3D.C src/main.C wscript
description:
Remove P_MDPI_Refine


diff -r 98b2459454af -r 4bf62b161d54 src/P_MDPI_Refine.C
--- a/src/P_MDPI_Refine.C	Tue Jun 05 13:03:21 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-/*************************************************************************
- *
- * This file is part of the SAMRAI distribution.  For full copyright 
- * information, see COPYRIGHT and COPYING.LESSER. 
- *
- * Copyright:     (c) 1997-2010 Lawrence Livermore National Security, LLC
- * Description:   Linear refine operator for cell-centered double data on
- *                a Cartesian mesh. 
- *
- ************************************************************************/
-
-#ifndef included_geom_P_MDPI_Refine_C
-#define included_geom_P_MDPI_Refine_C
-
-#include "P_MDPI_Refine.h"
-
-#include <float.h>
-#include <math.h>
-#include "SAMRAI/geom/CartesianPatchGeometry.h"
-#include "SAMRAI/hier/Index.h"
-#include "SAMRAI/pdat/CellData.h"
-#include "SAMRAI/pdat/SideData.h"
-#include "SAMRAI/pdat/NodeData.h"
-#include "SAMRAI/tbox/Utilities.h"
-#include "dRc_dp.h"
-
-void SAMRAI::geom::P_MDPI_Refine::refine(
-   hier::Patch& fine,
-   const hier::Patch& coarse,
-   const int dst_component,
-   const int src_component,
-   const hier::BoxOverlap& fine_overlap,
-   const hier::IntVector& ratio) const
-{
-   const pdat::CellOverlap* t_overlap =
-      dynamic_cast<const pdat::CellOverlap *>(&fine_overlap);
-
-   TBOX_ASSERT(t_overlap != NULL);
-
-   const hier::BoxList& boxes = t_overlap->getDestinationBoxList();
-   for (hier::BoxList::Iterator b(boxes); b; b++) {
-      refine(fine,
-         coarse,
-         dst_component,
-         src_component,
-         b(),
-         ratio);
-   }
-}
-
-void SAMRAI::geom::P_MDPI_Refine::refine(
-   hier::Patch& fine_patch,
-   const hier::Patch& coarse_patch,
-   const int dst_component,
-   const int src_component,
-   const hier::Box& fine_box,
-   const hier::IntVector& ratio) const
-{
-   const tbox::Dimension& dimension(getDim());
-   const int dim(dimension.getValue());
-   TBOX_DIM_ASSERT_CHECK_DIM_ARGS4(dimension, fine_patch, coarse_patch,
-                                   fine_box, ratio);
-
-   tbox::Pointer<pdat::CellData<double> >
-     p_ptr = coarse_patch.getPatchData(src_component);
-   pdat::CellData<double> &p(*p_ptr);
-   tbox::Pointer<pdat::CellData<double> >
-     p_fine_ptr = fine_patch.getPatchData(dst_component);
-   pdat::CellData<double> &p_fine(*p_fine_ptr);
-   tbox::Pointer<pdat::SideData<double> >
-     v_ptr = fine_patch.getPatchData(v_id);
-   pdat::SideData<double> &v(*v_ptr);
-   tbox::Pointer<pdat::CellData<double> >
-     cell_viscosity_ptr = fine_patch.getPatchData(cell_viscosity_id);
-   pdat::CellData<double> &cell_viscosity(*cell_viscosity_ptr);
-   tbox::Pointer<pdat::NodeData<double> > edge_viscosity2D_ptr;
-   tbox::Pointer<pdat::EdgeData<double> > edge_viscosity3D_ptr;
-   if(dim==2)
-     edge_viscosity2D_ptr = fine_patch.getPatchData(edge_viscosity_id);
-   else
-     edge_viscosity3D_ptr = fine_patch.getPatchData(edge_viscosity_id);
-
-#ifdef DEBUG_CHECK_ASSERTIONS
-   TBOX_ASSERT(!p_ptr.isNull());
-   TBOX_ASSERT(!p_fine_ptr.isNull());
-   TBOX_ASSERT(p.getDepth() == p_fine.getDepth());
-#endif
-
-   tbox::Pointer<geom::CartesianPatchGeometry>
-     geom = fine_patch.getPatchGeometry();
-
-   const double *Dx=geom->getDx();
-
-   hier::Box interior(p_fine.getBox());
-
-   const hier::Box coarse_box
-     (hier::Box::coarsen(fine_box,hier::IntVector::getOne(dimension)*2));
-
-   hier::Box cell_box(hier::Index::getZeroIndex(dimension),
-                      hier::Index::getOneIndex(dimension));
-
-   for(pdat::CellIterator ci(coarse_box); ci; ci++)
-     {
-       pdat::CellIndex coarse(*ci);
-       pdat::CellIndex fine(coarse*2);
-
-       if(interior.contains(fine))
-         {
-           pdat::CellData<double>
-             dRc_dp(cell_box,1,hier::Index::getZeroIndex(dimension));
-           double dRc_dp_total(0);
-
-           for(pdat::CellIterator ii(cell_box); ii; ii++)
-             {
-               pdat::CellIndex c_fine(fine+*ii);
-               
-               if(dim==2)
-                 {
-                   pdat::SideIndex x(c_fine,0,pdat::SideIndex::Lower),
-                     y(c_fine,1,pdat::SideIndex::Lower);
-                   dRc_dp(*ii)=dRc_dp_2D(fine_box,c_fine,x,y,cell_viscosity,
-                                         *edge_viscosity2D_ptr,v,Dx[0],Dx[1]);
-                 }
-               else
-                 {
-                   const hier::Index ip(1,0,0), jp(0,1,0), kp(0,0,1);
-                   const hier::Index pp[]={ip,jp,kp};
-                   dRc_dp(*ii)=dRc_dp_3D(fine_box,c_fine,cell_viscosity,
-                                         *edge_viscosity3D_ptr,v,Dx,pp);
-                 }
-               dRc_dp_total+=dRc_dp(*ii,0);
-             }
-
-           for(pdat::CellIterator ii(cell_box); ii; ii++)
-             {
-               pdat::CellIndex c_fine(fine+*ii);
-               p_fine(c_fine)=p(coarse)*dRc_dp_total
-                 /(4*(dim-1)*dRc_dp(*ii));
-             }
-         }
-       else
-         {
-           /* This should never be used as a real value, so we put in
-            * a bad value so that we will notice when it happens */
-           for(pdat::CellIterator ii(cell_box); ii; ii++)
-             {
-               pdat::CellIndex c_fine(fine+*ii);
-               if(fine_box.contains(c_fine))
-                 p_fine(c_fine)=boundary_value;
-             }
-         }
-     }
-}
-#endif
diff -r 98b2459454af -r 4bf62b161d54 src/P_MDPI_Refine.h
--- a/src/P_MDPI_Refine.h	Tue Jun 05 13:03:21 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-/*************************************************************************
- *
- * This file is part of the SAMRAI distribution.  For full copyright 
- * information, see COPYRIGHT and COPYING.LESSER. 
- *
- * Copyright:     (c) 1997-2010 Lawrence Livermore National Security, LLC
- * Description:   Linear refine operator for cell-centered double data on
- *                a Cartesian mesh. 
- *
- ************************************************************************/
-
-#ifndef included_geom_P_MDPI_Refine
-#define included_geom_P_MDPI_Refine
-
-#include "SAMRAI/SAMRAI_config.h"
-
-#include "SAMRAI/xfer/RefineOperator.h"
-#include "SAMRAI/hier/Box.h"
-#include "SAMRAI/hier/IntVector.h"
-#include "SAMRAI/hier/Patch.h"
-#include "SAMRAI/tbox/Pointer.h"
-#include "SAMRAI/pdat/CellVariable.h"
-
-#include <string>
-
-namespace SAMRAI {
-namespace geom {
-
-/**
- * Class P_MDPI_Refine implements matrix dependent 
- * interpolation for cell-centered double patch data defined over a Cartesian
- * mesh.  It should work better for variable viscosity.
- *
- * The findRefineOperator() operator function returns true if the input
- * variable is cell-centered double, and the std::string is "P_MDPI_REFINE".
- *
- * @see xfer::RefineOperator
- */
-
-class P_MDPI_Refine:
-  public xfer::RefineOperator
-{
-public:
-  /**
-   * Uninteresting default constructor.
-   */
-  explicit P_MDPI_Refine(const tbox::Dimension& dim, const int &v,
-                         const int &cell_viscosity,
-                         const int &edge_viscosity):
-    xfer::RefineOperator(dim, "P_MDPI_REFINE"),
-    v_id(v),
-    cell_viscosity_id(cell_viscosity),
-    edge_viscosity_id(edge_viscosity)
-  {
-    d_name_id = "P_MDPI_REFINE";
-  }
-
-
-  /**
-   * Uninteresting virtual destructor.
-   */
-  virtual ~P_MDPI_Refine(){}
-
-  /**
-   * Return true if the variable and name std::string match cell-centered
-   * double linear interpolation; otherwise, return false.
-   */
-  bool findRefineOperator(const tbox::Pointer<hier::Variable>& var,
-                          const std::string& op_name) const
-  {
-    TBOX_DIM_ASSERT_CHECK_ARGS2(*this, *var);
-
-    const tbox::Pointer<pdat::CellVariable<double> > cast_var(var);
-    if (!cast_var.isNull() && (op_name == d_name_id)) {
-      return true;
-    } else {
-      return false;
-    }
-  }
-  /**
-   * Return name std::string identifier of this refinement operator.
-   */
-  const std::string& getOperatorName() const
-  {
-    return d_name_id;
-  }
-
-  /**
-   * The priority of cell-centered double linear interpolation is 0.
-   * It will be performed before any user-defined interpolation operations.
-   */
-  int getOperatorPriority() const
-  {
-    return 0;
-  }
-
-  /**
-   * The stencil width of the linear interpolation operator is the vector
-   * of ones.  That is, its stencil extends one cell outside the fine box.
-   */
-  hier::IntVector getStencilWidth() const
-  {
-    return hier::IntVector::getOne(getDim());
-  }
-
-  /**
-   * Refine the source component on the coarse patch to the destination
-   * component on the fine patch using the cell-centered double linear
-   * interpolation operator.  Interpolation is performed on the intersection
-   * of the destination patch and the boxes contained in fine_overlap
-   * It is assumed that the coarse patch contains sufficient data for the
-   * stencil width of the refinement operator.
-   */
-  void refine(hier::Patch& fine,
-              const hier::Patch& coarse,
-              const int dst_component,
-              const int src_component,
-              const hier::BoxOverlap& fine_overlap,
-              const hier::IntVector& ratio) const;
-
-  /**
-   * Refine the source component on the coarse patch to the destination
-   * component on the fine patch using the cell-centered double linear
-   * interpolation operator.  Interpolation is performed on the intersection
-   * of the destination patch and the fine box.   It is assumed that the
-   * coarse patch contains sufficient data for the stencil width of the
-   * refinement operator.  This differs from the above refine() method
-   * only in that it operates on a single fine box instead of a BoxOverlap.
-   */
-  void refine(hier::Patch& fine,
-              const hier::Patch& coarse,
-              const int dst_component,
-              const int src_component,
-              const hier::Box& fine_box,
-              const hier::IntVector& ratio) const;
-
-private:
-  std::string d_name_id;
-  int v_id, cell_viscosity_id, edge_viscosity_id;
-};
-
-}
-}
-#endif
diff -r 98b2459454af -r 4bf62b161d54 src/StokesFACOps/smooth_V_3D.C
--- a/src/StokesFACOps/smooth_V_3D.C	Tue Jun 05 13:03:21 2012 -0700
+++ b/src/StokesFACOps/smooth_V_3D.C	Tue Jun 05 16:02:47 2012 -0700
@@ -1,6 +1,6 @@
 #include "StokesFACOps.h"
 #include "Constants.h"
-#include "dRc_dp.h"
+#include "dRm_dv.h"
 /*
 ********************************************************************
 * Updates one component of the velocity during a red-black *
diff -r 98b2459454af -r 4bf62b161d54 src/main.C
--- a/src/main.C	Tue Jun 05 13:03:21 2012 -0700
+++ b/src/main.C	Tue Jun 05 16:02:47 2012 -0700
@@ -35,7 +35,6 @@ using namespace std;
 #include "V_Boundary_Refine.h"
 #include "V_Coarsen.h"
 #include "Resid_Coarsen.h"
-#include "P_MDPI_Refine.h"
 
 #include "FACStokes.h"
 
@@ -190,11 +189,6 @@ int main(
                          input_db->getDatabase("FACStokes") :
                          tbox::Pointer<tbox::Database>(NULL));
 
-    grid_geometry->addSpatialRefineOperator
-      (tbox::Pointer<SAMRAI::xfer::RefineOperator>
-       (new SAMRAI::geom::P_MDPI_Refine(dim,fac_stokes.v_id,
-                                        fac_stokes.cell_viscosity_id,
-                                        fac_stokes.edge_viscosity_id)));
     grid_geometry->addSpatialCoarsenOperator
       (tbox::Pointer<SAMRAI::xfer::CoarsenOperator>
        (new SAMRAI::geom::Resid_Coarsen(dim,fac_stokes.cell_viscosity_id)));
diff -r 98b2459454af -r 4bf62b161d54 wscript
--- a/wscript	Tue Jun 05 13:03:21 2012 -0700
+++ b/wscript	Tue Jun 05 16:02:47 2012 -0700
@@ -20,7 +20,6 @@ def build(bld):
                         'src/FACStokes/setupPlotter.C',
                         'src/FACStokes/solveStokes.C',
                         'src/P_Refine.C',
-                        'src/P_MDPI_Refine.C',
                         'src/V_Refine.C',
                         'src/Resid_Coarsen.C',
                         'src/V_Coarsen/coarsen_2D.C',
@@ -75,7 +74,7 @@ def build(bld):
                         'src/StokesFACSolver/solveSystem.C',
                         'src/StokesHypreSolver.C'],
 
-        target       = 'gamr',
+        target       = 'gamra',
         # cxxflags      = ['-std=c++0x','-g','-D_GLIBCXX_DEBUG'],
         cxxflags      = ['-g', '-Wall', '-Wextra', '-Wconversion',
                          '-DTESTING=0'],



More information about the CIG-COMMITS mailing list