Commit 3df5bfb4 authored by Kirill Terekhov's avatar Kirill Terekhov

updates

parent ac5f9eb4
......@@ -11,6 +11,13 @@ namespace INMOST
Entries.push_back(std::make_pair(name,&entry));
}
void Model::AddFirstEntry(std::string name, AbstractEntry & entry)
{
assert( !isInitialized() ); // do not add new data after initialization
assert( GetEntry(name) == NULL ); // do not overwrite entry with the same name
Entries.insert(Entries.begin(),std::make_pair(name,&entry));
}
void Model::AddMesh(std::string name, Mesh & m)
{
assert( !isInitialized() ); // do not add new data after initialization
......
......@@ -65,6 +65,11 @@ namespace INMOST
/// The intries should be added from Model::Initialize function,
/// either by model or by any of the submodels.
void AddEntry(std::string name, AbstractEntry & entry);
/// Add an entry of block unknowns to a model as a first entry.
/// The model stores a link to the entry and may modify it contents.
/// The intries should be added from Model::Initialize function,
/// either by model or by any of the submodels.
void AddFirstEntry(std::string name, AbstractEntry & entry);
/// Add a mesh to a model.
/// The model stores a link to the provided mesh, so it should not
/// be deallocated. The meshes are provided by the user from outside
......
......@@ -5,11 +5,11 @@
#include <sstream>
#include <deque>
#include <iomanip>
#define REPORT_ILU
//#define REPORT_ILU
//#undef REPORT_ILU
//#define REPORT_ILU_PROGRESS
#define REPORT_ILU_END
#define REPORT_ILU_SUMMARY
//#define REPORT_ILU_END
//#define REPORT_ILU_SUMMARY
//#undef REPORT_ILU_PROGRESS
#include "../../../Misc/utils.h"
//#define USE_OMP
......@@ -42,8 +42,8 @@ static bool allow_pivot = true;
//#define PREMATURE_DROPPING
//#define EQUALIZE_1NORM
//#define EQUALIZE_2NORM
#define EQUALIZE_IDOMINANCE
#define EQUALIZE_2NORM
//#define EQUALIZE_IDOMINANCE
#define PIVOT_THRESHOLD
#define PIVOT_THRESHOLD_VALUE 1.0e-12
......@@ -722,7 +722,7 @@ static bool allow_pivot = true;
for (INMOST_DATA_ENUM_TYPE it = A_Address[k].first; it < A_Address[k].last; ++it)
{
u = fabs(C_Entries[it] - V[k] - U[A_Entries[it].first]);
if( u < 1.0e-8 && Perm[A_Entries[it].first] == ENUMUNDEF && IPerm[k] == ENUMUNDEF )
if( u < 1.0e-30 && Perm[A_Entries[it].first] == ENUMUNDEF && IPerm[k] == ENUMUNDEF )
{
Perm[A_Entries[it].first] = k;
IPerm[k] = A_Entries[it].first;
......@@ -742,7 +742,7 @@ static bool allow_pivot = true;
for (INMOST_DATA_ENUM_TYPE it = A_Address[k].first; it < A_Address[k].last && IPerm[k] == ENUMUNDEF; ++it)
{
u = fabs(C_Entries[it] - V[k] - U[A_Entries[it].first]);
if( u <= 1.0e-8 )
if( u <= 1.0e-30 )
{
Li = Perm[A_Entries[it].first];
assert(Li != ENUMUNDEF);
......@@ -750,7 +750,7 @@ static bool allow_pivot = true;
for (INMOST_DATA_ENUM_TYPE Lit = A_Address[Li].first; Lit < A_Address[Li].last; ++Lit)
{
u = fabs(C_Entries[Lit]- V[Li] - U[A_Entries[Lit].first]);
if( u <= 1.0e-8 && Perm[A_Entries[Lit].first] == ENUMUNDEF )
if( u <= 1.0e-30 && Perm[A_Entries[Lit].first] == ENUMUNDEF )
{
Perm[A_Entries[it].first] = k;
IPerm[k] = A_Entries[it].first;
......
......@@ -7,11 +7,11 @@
#include <deque>
#include <iomanip>
#include "../../../Misc/utils.h"
#define REPORT_ILU
//#define REPORT_ILU
//#undef REPORT_ILU
//#define REPORT_ILU_PROGRESS
#define REPORT_ILU_END
#define REPORT_ILU_SUMMARY
//#define REPORT_ILU_END
//#define REPORT_ILU_SUMMARY
//#undef REPORT_ILU_PROGRESS
//#define USE_OMP
......@@ -2772,7 +2772,7 @@ swap_algorithm:
if (u*NuU /*NuL_old*/ > tau) // apply dropping rule
LU_Entries.push_back(Sparse::Row::make_entry(Ui, LineValuesU[Ui]));
#if defined(ILUC2)
else if (u*NuU*NuD /*NuL_old*/ > tau2)
else if (u*NuU /*NuL_old*/ > tau2)
LU2_Entries.push_back(Sparse::Row::make_entry(Ui, LineValuesU[Ui]));
#endif
Ui = LineIndecesU[Ui];
......@@ -2797,7 +2797,7 @@ swap_algorithm:
if (u*NuL /*NuU_old*/ > tau) //apply dropping
LU_Entries.push_back(Sparse::Row::make_entry(Li, LineValuesL[Li]));
#if defined(ILUC2)
else if (u*NuL*NuD /*NuU_old*/ > tau2)
else if (u*NuL /*NuU_old*/ > tau2)
LU2_Entries.push_back(Sparse::Row::make_entry(Li, LineValuesL[Li]));
#endif
Li = LineIndecesL[Li];
......
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