[cig-commits] commit: Make the solver accept v
Mercurial
hg at geodynamics.org
Fri Feb 25 14:13:04 PST 2011
changeset: 17:b764ef2a02bc
user: Walter Landry <wlandry at caltech.edu>
date: Sat Jan 01 22:51:04 2011 -0800
files: FACStokes/solveStokes.C Makefile StokesFACSolver.h StokesFACSolver/StokesFACSolver_Destructor.C StokesFACSolver/initializeSolverState.C StokesFACSolver/solveSystem.C
description:
Make the solver accept v
diff -r c28a69e8a06b -r b764ef2a02bc FACStokes/solveStokes.C
--- a/FACStokes/solveStokes.C Fri Dec 31 16:02:29 2010 -0800
+++ b/FACStokes/solveStokes.C Sat Jan 01 22:51:04 2011 -0800
@@ -72,8 +72,7 @@ namespace SAMRAI {
tbox::plog << "solving..." << std::endl;
int solver_ret;
- solver_ret = d_stokes_fac_solver.solveSystem(p_id,
- p_rhs_id);
+ solver_ret = d_stokes_fac_solver.solveSystem(p_id,p_rhs_id,v_id,v_rhs_id);
/*
* Present data on the solve.
*/
diff -r c28a69e8a06b -r b764ef2a02bc Makefile
--- a/Makefile Fri Dec 31 16:02:29 2010 -0800
+++ b/Makefile Sat Jan 01 22:51:04 2011 -0800
@@ -8,11 +8,11 @@
##
#########################################################################
-SAMRAI = ../AMR/SAMRAI-v3.1.0-beta
+SAMRAI = ../SAMRAI-hg
SRCDIR = .
VPATH =
TESTTOOLS = ../testtools
-OBJECT = ../AMR/SAMRAI-v3.1.0-beta-build
+OBJECT = ../SAMRAI-hg-build
default: main
diff -r c28a69e8a06b -r b764ef2a02bc StokesFACSolver.h
--- a/StokesFACSolver.h Fri Dec 31 16:02:29 2010 -0800
+++ b/StokesFACSolver.h Sat Jan 01 22:51:04 2011 -0800
@@ -179,8 +179,10 @@ public:
*/
bool
solveSystem(
- const int solution,
- const int rhs,
+ const int p,
+ const int p_rhs,
+ const int v,
+ const int v_rhs,
tbox::Pointer<hier::PatchHierarchy> hierarchy,
int coarse_ln = -1,
int fine_ln = -1);
@@ -206,9 +208,7 @@ public:
* @see solveSystem( const int, const int, tbox::Pointer< hier::PatchHierarchy >, int, int);
*/
bool
- solveSystem(
- const int solution,
- const int rhs);
+ solveSystem(const int p, const int p_rhs, const int v, const int v_rhs);
/*!
* @brief Specify the boundary conditions that are to be used at the
diff -r c28a69e8a06b -r b764ef2a02bc StokesFACSolver/StokesFACSolver_Destructor.C
--- a/StokesFACSolver/StokesFACSolver_Destructor.C Fri Dec 31 16:02:29 2010 -0800
+++ b/StokesFACSolver/StokesFACSolver_Destructor.C Sat Jan 01 22:51:04 2011 -0800
@@ -18,8 +18,6 @@
namespace SAMRAI {
namespace solv {
-
-
/*
*************************************************************************
* *
@@ -28,13 +26,10 @@ namespace SAMRAI {
* *
*************************************************************************
*/
-
StokesFACSolver::~StokesFACSolver()
{
s_instance_counter[d_dim.getValue() - 1]--;
-
deallocateSolverState();
-
if (s_instance_counter[d_dim.getValue() - 1] == 0) {
hier::VariableDatabase::getDatabase()->
removeInternalSAMRAIVariablePatchDataIndex(s_weight_id[d_dim.getValue() - 1]);
diff -r c28a69e8a06b -r b764ef2a02bc StokesFACSolver/initializeSolverState.C
--- a/StokesFACSolver/initializeSolverState.C Fri Dec 31 16:02:29 2010 -0800
+++ b/StokesFACSolver/initializeSolverState.C Sat Jan 01 22:51:04 2011 -0800
@@ -31,8 +31,7 @@ namespace SAMRAI {
*************************************************************************
*/
- void StokesFACSolver::initializeSolverState(
- const int solution,
+ void StokesFACSolver::initializeSolverState(const int solution,
const int rhs,
tbox::Pointer<hier::PatchHierarchy> hierarchy,
const int coarse_level,
diff -r c28a69e8a06b -r b764ef2a02bc StokesFACSolver/solveSystem.C
--- a/StokesFACSolver/solveSystem.C Fri Dec 31 16:02:29 2010 -0800
+++ b/StokesFACSolver/solveSystem.C Sat Jan 01 22:51:04 2011 -0800
@@ -33,9 +33,8 @@ namespace SAMRAI {
*************************************************************************
*/
- bool StokesFACSolver::solveSystem(
- const int u,
- const int f)
+ bool StokesFACSolver::solveSystem(const int p, const int p_rhs,
+ const int v, const int v_rhs)
{
#ifdef DEBUG_CHECK_ASSERTIONS
if (!d_solver_is_initialized) {
@@ -49,7 +48,7 @@ namespace SAMRAI {
"solveSystem(int,int,...) to initialize the solver,\n"
<< "solve and deallocate the solver.\n");
}
- if (u < 0 || f < 0) {
+ if (p < 0 || p_rhs < 0 || v < 0 || v_rhs < 0) {
TBOX_ERROR(d_object_name << ": Bad patch data id.\n");
}
#endif
@@ -61,10 +60,10 @@ namespace SAMRAI {
* The solver overwrites it, but SimpleCellRobinBcCoefs
* needs to get to access it repeatedly.
*/
- d_simple_bc.cacheDirichletData(u);
+ d_simple_bc.cacheDirichletData(p);
}
- createVectorWrappers(u, f);
+ createVectorWrappers(p, p_rhs);
bool solver_rval;
solver_rval = d_fac_precond.solveSystem(*d_uv, *d_fv);
@@ -74,7 +73,7 @@ namespace SAMRAI {
* solve process. We do this to be backward compatible with the
* user code.
*/
- d_simple_bc.restoreDirichletData(u);
+ d_simple_bc.restoreDirichletData(p);
}
return solver_rval;
@@ -93,10 +92,12 @@ namespace SAMRAI {
*************************************************************************
*/
- bool StokesFACSolver::solveSystem(
- const int u,
- const int f,
- tbox::Pointer<hier::PatchHierarchy> hierarchy,
+ bool StokesFACSolver::solveSystem(const int p,
+ const int p_rhs,
+ const int v,
+ const int v_rhs,
+ tbox::Pointer<hier::PatchHierarchy>
+ hierarchy,
int coarse_ln,
int fine_ln)
{
@@ -124,10 +125,10 @@ namespace SAMRAI {
<< "specified.\n");
}
#endif
- initializeSolverState(u, f, hierarchy, coarse_ln, fine_ln);
+ initializeSolverState(p, p_rhs, hierarchy, coarse_ln, fine_ln);
bool solver_rval;
- solver_rval = solveSystem(u, f);
+ solver_rval = solveSystem(p, p_rhs, v, v_rhs);
deallocateSolverState();
More information about the CIG-COMMITS
mailing list