Commit bcca5599 authored by Kirill Terekhov's avatar Kirill Terekhov
Browse files

Backward compatibility for solvers

parent fa2d47d7
......@@ -4896,17 +4896,21 @@ void svg_draw(std::ostream & file)
if( oclipper )
{
//std::vector<face2gl> temp_boundary;
//oclipper->gen_clip(temp_boundary,n);
//face2gl::radix_sort_dist(temp_boundary);
//svg_draw_faces(file,temp_boundary,modelview,projection,viewport);
/*
std::vector<face2gl> temp_boundary;
oclipper->gen_clip(temp_boundary,n);
for(INMOST_DATA_ENUM_TYPE q = 0; q < temp_boundary.size() ; q++)
temp_boundary[q].compute_dist(campos);
face2gl::radix_sort_dist(temp_boundary);
svg_draw_faces(file,temp_boundary,modelview,projection,viewport);
*/
std::vector<face2gl> sorted_clip_boundary(clip_boundary);
for(INMOST_DATA_ENUM_TYPE q = 0; q < sorted_clip_boundary.size() ; q++)
sorted_clip_boundary[q].compute_dist(campos);
face2gl::radix_sort_dist(sorted_clip_boundary);
svg_draw_faces(file,sorted_clip_boundary,modelview,projection,viewport);
//file << "<g stroke=\"black\">" << std::endl;
//svg_draw_edges(file,sorted_clip_boundary,modelview,projection,viewport);
//file << "</g>" << std::endl;
......
......@@ -22,6 +22,26 @@ namespace INMOST
/// @see Sparse::Solve
class Solver
{
public:
//Backward-compatibility
typedef std::string Type;
static const Type INNER_ILU2; ///< inner Solver based on BiCGStab(L) solver with second order ILU factorization as preconditioner.
static const Type INNER_DDPQILUC; ///< inner Solver based on BiCGStab(L) solver with second order Crout-ILU with inversed-based condition estimation and unsymmetric reordering for diagonal dominance as preconditioner.
static const Type INNER_MPTILUC; ///< inner Solver based on BiCGStab(L) solver with second order Crout-ILU with inversed-based condition estimation and maximum product transversal reordering as preconditioner.
static const Type INNER_MPTILU2; ///< inner Solver based on BiCGStab(L) solver with second order ILU and maximum product transversal reordering as preconditioner.
static const Type Trilinos_Aztec; ///< external Solver AztecOO from Trilinos package.
static const Type Trilinos_Belos; ///< external Solver Belos from Trilinos package, currently without preconditioner.
static const Type Trilinos_ML; ///< external Solver AztecOO with ML preconditioner.
static const Type Trilinos_Ifpack;///< external Solver AztecOO with Ifpack preconditioner.
static const Type PETSc; ///< external Solver PETSc, @see http://www.mcs.anl.gov/petsc/
static const Type ANI; ///< external Solver from ANI3D based on ILU2 (sequential Fortran version), @see http://ani3d.sourceforge.net/
static const Type FCBIILU2; ///< external FCBIILU2 Solver (BIILU2 parallel F2C version).
static const Type K3BIILU2; ///< inner K3BIILU2 Solver (BIILU2 parallel version).
static const Type SUPERLU; ///< external Solver SuperLU @see https://github.com/starseeker/SuperLU
void SetParameterEnum(std::string name, INMOST_DATA_ENUM_TYPE value);
void SetParameterReal(std::string name, INMOST_DATA_REAL_TYPE value);
std::string GetReason() {return ReturnReason();}
//Backward-compatibility
private:
static std::vector<SolverParameters> parameters;
static int *argc;
......@@ -196,7 +216,7 @@ namespace INMOST
/// Trilinos_ML: trilinos_ml_options.xml
/// Trilinos_Aztec: trilinos_aztec_options.xml
/// Trilinos_Belos: trilinos_belos_options.xml
static void Initialize(int *argc, char ***argv, const char *database);
static void Initialize(int *argc, char ***argv, const char *database = NULL);
/// Finalize the stage of parallel solution.
/// If MPI was initialized in Solver::Initialize, then it will be finalized.
......
......@@ -46,6 +46,21 @@
#endif
namespace INMOST {
//initialization of backward-compatibility constants
const Solver::Type Solver::INNER_ILU2 = "inner_ilu2";
const Solver::Type Solver::INNER_DDPQILUC = "inner_ddpqiluc2";
const Solver::Type Solver::INNER_MPTILUC = "inner_mptiluc";
const Solver::Type Solver::INNER_MPTILU2 = "inner_mptilu2";
const Solver::Type Solver::Trilinos_Aztec = "trilinos_aztec";
const Solver::Type Solver::Trilinos_Belos = "trilinos_belos";
const Solver::Type Solver::Trilinos_ML = "trilinos_ml";
const Solver::Type Solver::Trilinos_Ifpack = "trilinos_ifpack";
const Solver::Type Solver::PETSc = "petsc";
const Solver::Type Solver::ANI = "inner_ilu2";
const Solver::Type Solver::FCBIILU2 = "fcbiilu2";
const Solver::Type Solver::K3BIILU2 = "k3biilu2";
const Solver::Type Solver::SUPERLU = "superlu";
SolverInterface *SolverMaster::getSolver(std::string name) {
if (name == "inner_ilu2") return new SolverILU2();
......
......@@ -10,6 +10,9 @@ namespace INMOST {
bool Solver::is_initialized = false;
bool Solver::is_finalized = false;
std::vector<SolverParameters> Solver::parameters = std::vector<SolverParameters>();
void Solver::SetParameterEnum(std::string name, INMOST_DATA_ENUM_TYPE value) {SetParameter(name,to_string(value));}
void Solver::SetParameterReal(std::string name, INMOST_DATA_REAL_TYPE value) {SetParameter(name,to_string(value));}
Solver::Solver(std::string solverName, std::string prefix, INMOST_MPI_Comm _comm) {
std::string lowerName = string_to_lower(solverName);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment