aboutsummaryrefslogtreecommitdiff
path: root/src/elliptic
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-01-30 14:35:28 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-01-30 14:35:28 +0000
commit4ec18979a82a22785cbf9410b9b59a3cbe66a691 (patch)
treefa3db830e6a956001adc639f3fecaa05f31a5c3c /src/elliptic
parent0ae05c01ea24aab5e0f1412a3574997fd297a143 (diff)
* print a bit more info about setting up data structures
* fix a few bugs where error messages had mismatched printf (CCTK_VWarn) formats and arguments git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@941 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/elliptic')
-rw-r--r--src/elliptic/Jacobian.hh6
-rw-r--r--src/elliptic/dense_Jacobian.cc8
-rw-r--r--src/elliptic/dense_Jacobian.hh5
-rw-r--r--src/elliptic/row_sparse_Jacobian.cc22
-rw-r--r--src/elliptic/row_sparse_Jacobian.hh5
5 files changed, 30 insertions, 16 deletions
diff --git a/src/elliptic/Jacobian.hh b/src/elliptic/Jacobian.hh
index 4edd963..7d70f5b 100644
--- a/src/elliptic/Jacobian.hh
+++ b/src/elliptic/Jacobian.hh
@@ -132,13 +132,17 @@ public:
// not be changed, i.e. no new nonzeros should be introduced
// into the matrix
//
- virtual fp solve_linear_system(int rhs_gfn, int x_gfn) = 0;
+ virtual fp solve_linear_system(int rhs_gfn, int x_gfn,
+ bool print_msg_flag) = 0;
//
// constructor, destructor
//
protected:
+ // ... derived class constructors have a print_msg_flag
+ // argument controlling messages about the construction
+ // and element-setting process
Jacobian(patch_system& ps)
: ps_(ps),
N_rows_(ps.N_grid_points())
diff --git a/src/elliptic/dense_Jacobian.cc b/src/elliptic/dense_Jacobian.cc
index 7999513..6a499cf 100644
--- a/src/elliptic/dense_Jacobian.cc
+++ b/src/elliptic/dense_Jacobian.cc
@@ -132,7 +132,7 @@ dense_Jacobian::dense_Jacobian(patch_system& ps,
{
if (print_msg_flag)
then CCTK_VInfo(CCTK_THORNSTRING,
- "constructing dense_Jacobian: N_rows_=%d",
+ " dense Jacobian matrix (N_rows_=%d)",
N_rows_);
}
#endif // HAVE_DENSE_JACOBIAN
@@ -171,6 +171,9 @@ dense_Jacobian__LAPACK::dense_Jacobian__LAPACK(patch_system& ps,
iwork_(new integer[ N_rows_]),
rwork_(new fp [4*N_rows_])
{
+if (print_msg_flag)
+ then CCTK_VInfo(CCTK_THORNSTRING,
+ " LAPACK linear-equations solver");
}
#endif // HAVE_DENSE_JACOBIAN__LAPACK
@@ -197,7 +200,8 @@ delete[] pivot_;
// It returns the estimated infinity-norm condition number of the linear
// system, or 0.0 if the matrix is numerically singular
//
-fp dense_Jacobian__LAPACK::solve_linear_system(int rhs_gfn, int x_gfn)
+fp dense_Jacobian__LAPACK::solve_linear_system(int rhs_gfn, int x_gfn,
+ bool print_msg_flag)
{
const fp *rhs = ps_.gridfn_data(rhs_gfn);
fp *x = ps_.gridfn_data(x_gfn);
diff --git a/src/elliptic/dense_Jacobian.hh b/src/elliptic/dense_Jacobian.hh
index 0c85f47..b56d226 100644
--- a/src/elliptic/dense_Jacobian.hh
+++ b/src/elliptic/dense_Jacobian.hh
@@ -59,6 +59,8 @@ public:
// constructor, destructor
//
protected:
+ // ... print_msg_flag controls messages about data structure setup
+ // during construction and element-setting process
dense_Jacobian(patch_system& ps,
bool print_msg_flag = false);
~dense_Jacobian() { }
@@ -85,7 +87,8 @@ public:
// ... returns condition number if known,
// 0.0 if matrix is numerically singular,
// -1.0 if condition number is unknown
- fp solve_linear_system(int rhs_gfn, int x_gfn);
+ fp solve_linear_system(int rhs_gfn, int x_gfn,
+ bool print_msg_flag);
// constructor, destructor
public:
diff --git a/src/elliptic/row_sparse_Jacobian.cc b/src/elliptic/row_sparse_Jacobian.cc
index 7d0be44..875ab7d 100644
--- a/src/elliptic/row_sparse_Jacobian.cc
+++ b/src/elliptic/row_sparse_Jacobian.cc
@@ -145,14 +145,9 @@ row_sparse_Jacobian::row_sparse_Jacobian(patch_system& ps,
A_(new fp [N_nonzeros_allocated_])
{
if (print_msg_flag)
- then {
- CCTK_VInfo(CCTK_THORNSTRING,
- "constructing row_sparse_Jacobian: N_rows_=%d",
+ then CCTK_VInfo(CCTK_THORNSTRING,
+ " row sparse matrix Jacobian (N_rows_=%d)",
N_rows_);
- CCTK_VInfo(CCTK_THORNSTRING,
- " initial N_nonzeros_allocated_=%d",
- N_nonzeros_allocated_);
- }
zero_matrix();
}
@@ -373,7 +368,11 @@ row_sparse_Jacobian__ILUCG::row_sparse_Jacobian__ILUCG
print_msg_flag_(print_msg_flag),
itemp_(NULL),
rtemp_(NULL)
-{ }
+{
+if (print_msg_flag)
+ then CCTK_VInfo(CCTK_THORNSTRING,
+ " ILUCG linear-equations solver");
+}
#endif // HAVE_ROW_SPARSE_JACOBIAN__ILUCG
//******************************************************************************
@@ -398,7 +397,8 @@ delete[] itemp_;
// provided to me in 1985 (!) by Tom Nicol of the UBC Computing Center.
// It returns -1.0 (no condition number estimate).
//
-fp row_sparse_Jacobian__ILUCG::solve_linear_system(int rhs_gfn, int x_gfn)
+fp row_sparse_Jacobian__ILUCG::solve_linear_system(int rhs_gfn, int x_gfn,
+ bool print_msg_flag)
{
assert(current_N_rows_ == N_rows_);
@@ -407,7 +407,7 @@ assert(current_N_rows_ == N_rows_);
//
if (itemp_ == NULL)
then {
- if (print_msg_flag_)
+ if (print_msg_flag)
then {
CCTK_VInfo(CCTK_THORNSTRING,
"row_sparse_Jacobian__ILUCG::solve_linear_system()");
@@ -465,7 +465,7 @@ if (ierror != 0)
,
rhs_gfn, x_gfn,
int(istatus)); /*NOTREACHED*/
-if (print_msg_flag_)
+if (print_msg_flag)
then CCTK_VInfo(CCTK_THORNSTRING,
" solution found in %d CG iterations",
istatus);
diff --git a/src/elliptic/row_sparse_Jacobian.hh b/src/elliptic/row_sparse_Jacobian.hh
index 2eb6f6d..e66a962 100644
--- a/src/elliptic/row_sparse_Jacobian.hh
+++ b/src/elliptic/row_sparse_Jacobian.hh
@@ -100,6 +100,8 @@ public:
// constructor, destructor
//
protected:
+ // ... print_msg_flag controls messages about data structure setup
+ // during construction and element-setting process
row_sparse_Jacobian(patch_system& ps,
bool print_msg_flag = false);
~row_sparse_Jacobian();
@@ -183,7 +185,8 @@ public:
// ... returns condition number if known,
// 0.0 if matrix is numerically singular,
// -1.0 if condition number is unknown
- fp solve_linear_system(int rhs_gfn, int x_gfn);
+ fp solve_linear_system(int rhs_gfn, int x_gfn,
+ bool print_msg_flag);
// constructor, destructor
public: