aboutsummaryrefslogtreecommitdiff
path: root/src/elliptic
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-07-26 14:57:48 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-07-26 14:57:48 +0000
commit720ce53a79ef5bdff53b3db18bc45c46101aa0fa (patch)
tree5e15ab1aa1346cdbe63a8dd3e8cad3010d438827 /src/elliptic
parent625a1471be9b782048d0db40fec675bee6bca0a4 (diff)
re-sync changes from laptop
- parameter to control how Jacobian is computed - can hardwire geometry to Schwarzschild/EF git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@661 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/elliptic')
-rw-r--r--src/elliptic/Jacobian.cc24
-rw-r--r--src/elliptic/Jacobian.hh9
2 files changed, 32 insertions, 1 deletions
diff --git a/src/elliptic/Jacobian.cc b/src/elliptic/Jacobian.cc
index 58009ec..603abac 100644
--- a/src/elliptic/Jacobian.cc
+++ b/src/elliptic/Jacobian.cc
@@ -10,6 +10,8 @@
// dense_Jacobian::zero_row
// dense_Jacobian::solve_linear_system
//
+// new_Jacobian
+//
#include <stdio.h>
using std::fopen;
@@ -180,3 +182,25 @@ if (info != 0)
rhs_gfn, x_gfn,
int(info)); /*NOTREACHED*/
}
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+//
+// This function is an "object factory" for Jacobians: it constructs
+// and returns a new-allocated Jacobian object of a specified type.
+//
+// FIXME: the patch system shouldn't really have to be non-const, but
+// the Jacobian constructors all require this to allow the
+// linear solvers to directly update gridfns
+//
+Jacobian& new_Jacobian(patch_system& ps,
+ const char Jacobian_type[])
+{
+if (STRING_EQUAL(Jacobian_type, "dense matrix"))
+ then return *new dense_Jacobian(ps);
+else CCTK_VWarn(-1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "unknown Jacobian_type=\"%s\"!",
+ Jacobian_type); /*NOTREACHED*/
+}
diff --git a/src/elliptic/Jacobian.hh b/src/elliptic/Jacobian.hh
index 6d20e63..7bd37db 100644
--- a/src/elliptic/Jacobian.hh
+++ b/src/elliptic/Jacobian.hh
@@ -3,7 +3,8 @@
//
// Jacobian -- abstract base class to describe a Jacobian matrix
-// dense_Jacobian - Jacobian stored as a dense matrix
+// dense_Jacobian -- Jacobian stored as a dense matrix
+// new_Jacobian - factory method
//
//
@@ -132,3 +133,9 @@ private:
// pivot vector for LAPACK routines
integer *pivot_;
};
+
+//******************************************************************************
+
+// construct and return new-allocated Jacobian object of specified type
+Jacobian& new_Jacobian(patch_system& ps,
+ const char Jacobian_type[]);