[cig-commits] commit: Have smooth not update pressure outside of the boundary and on corners of coarse/fine interfaces. It did not really matter, but it does seem to get rid of all of the inf's and nan's in the output.
Mercurial
hg at geodynamics.org
Fri Feb 25 14:16:24 PST 2011
changeset: 78:2ab32fdb1026
user: Walter Landry <wlandry at caltech.edu>
date: Wed Feb 09 10:37:34 2011 -0800
files: StokesFACOps/smoothErrorByRedBlack.C
description:
Have smooth not update pressure outside of the boundary and on corners of coarse/fine interfaces. It did not really matter, but it does seem to get rid of all of the inf's and nan's in the output.
diff -r 7fb6c9822763 -r 2ab32fdb1026 StokesFACOps/smoothErrorByRedBlack.C
--- a/StokesFACOps/smoothErrorByRedBlack.C Wed Feb 09 07:04:25 2011 -0800
+++ b/StokesFACOps/smoothErrorByRedBlack.C Wed Feb 09 10:37:34 2011 -0800
@@ -157,17 +157,57 @@ void SAMRAI::solv::StokesFACOps::smoothE
hier::Box gbox=p->getGhostBox();
std::vector<bool> set_p(gbox.size(),true);
- const tbox::Array<hier::BoundaryBox >&boundaries
+ const tbox::Array<hier::BoundaryBox >&edges
=d_cf_boundary[ln]->getEdgeBoundaries(patch->getGlobalId());
- for(int mm=0; mm<boundaries.size(); ++mm)
- for(int j=boundaries[mm].getBox().lower(1);
- j<=boundaries[mm].getBox().upper(1); ++j)
- for(int i=boundaries[mm].getBox().lower(0);
- i<=boundaries[mm].getBox().upper(0); ++i)
+ for(int mm=0; mm<edges.size(); ++mm)
+ for(int j=edges[mm].getBox().lower(1);
+ j<=edges[mm].getBox().upper(1); ++j)
+ for(int i=edges[mm].getBox().lower(0);
+ i<=edges[mm].getBox().upper(0); ++i)
{
set_p[(i-gbox.lower(0))
+ (gbox.upper(0)+1)*(j-gbox.lower(1))]=false;
}
+
+ const tbox::Array<hier::BoundaryBox >&nodes
+ =d_cf_boundary[ln]->getNodeBoundaries(patch->getGlobalId());
+ for(int mm=0; mm<nodes.size(); ++mm)
+ {
+ tbox::plog << "nodes "
+ << mm << " "
+ << nodes[mm].getBox().lower(0) << " "
+ << nodes[mm].getBox().upper(0) << " "
+ << nodes[mm].getBox().lower(1) << " "
+ << nodes[mm].getBox().upper(1) << " "
+ << "\n";
+
+ for(int j=nodes[mm].getBox().lower(1);
+ j<=nodes[mm].getBox().upper(1); ++j)
+ for(int i=nodes[mm].getBox().lower(0);
+ i<=nodes[mm].getBox().upper(0); ++i)
+ {
+ set_p[(i-gbox.lower(0))
+ + (gbox.upper(0)+1)*(j-gbox.lower(1))]=false;
+ }
+ }
+
+ if(geom->getTouchesRegularBoundary(0,0))
+ for(int j=gbox.lower(1); j<=gbox.upper(1); ++j)
+ set_p[(gbox.upper(0)+1)*(j-gbox.lower(1))]=false;
+
+ if(geom->getTouchesRegularBoundary(0,1))
+ for(int j=gbox.lower(1); j<=gbox.upper(1); ++j)
+ set_p[(gbox.upper(0)-gbox.lower(0))
+ + (gbox.upper(0)+1)*(j-gbox.lower(1))]=false;
+
+ if(geom->getTouchesRegularBoundary(1,0))
+ for(int i=gbox.lower(0); i<=gbox.upper(0); ++i)
+ set_p[i-gbox.lower(0)]=false;
+
+ if(geom->getTouchesRegularBoundary(1,1))
+ for(int i=gbox.lower(0); i<=gbox.upper(0); ++i)
+ set_p[(i-gbox.lower(0))
+ + (gbox.upper(0)+1)*(gbox.upper(1)-gbox.lower(1))]=false;
for(int j=pbox.lower(1); j<=pbox.upper(1)+1; ++j)
{
More information about the CIG-COMMITS
mailing list