Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kirill Terekhov
INMOST
Commits
6e83b247
Commit
6e83b247
authored
Feb 04, 2015
by
Kirill Terekhov
Browse files
Merge branch 'master' of
https://github.com/INMOST-DEV/INMOST
parents
ccbf4446
e36f1340
Changes
2
Hide whitespace changes
Inline
Side-by-side
inmost_mesh.h
View file @
6e83b247
...
...
@@ -760,10 +760,11 @@ namespace INMOST
void
Disconnect
(
const
HandleType
*
adjacent
,
INMOST_DATA_ENUM_TYPE
num
)
const
;
/// Connects lower adjacencies to current element,
/// geometric data and cell nodes are updated automatically. \n
/// \todo
/// TODO:
///
1. asserts in this function should be replaced by Topography checks; \n
///
2. this function should be used for creation of elements instead of current implementation. \n
///
3. should correctly account for order of edges (may be implemented through CheckEdgeOrder, FixEdgeOrder)
/// 1. asserts in this function should be replaced by Topography checks; \n
/// 2. this function should be used for creation of elements instead of current implementation. \n
///
3. should correctly account for order of edges (may be implemented through CheckEdgeOrder, FixEdgeOrder)
void
Connect
(
const
HandleType
*
adjacent
,
INMOST_DATA_ENUM_TYPE
num
)
const
;
/// Update geometric data for element, calls RecomputeGeometricData from Mesh.
void
UpdateGeometricData
()
const
;
...
...
@@ -1098,6 +1099,7 @@ namespace INMOST
void
Unite
(
const
ElementArray
<
EType
>
&
elems
)
const
{
Unite
(
elems
.
data
(),
static_cast
<
enumerator
>
(
elems
.
size
()));}
/// Compute and store difference with raw handles.
/// \todo
/// TODO
/// If other and current sets are sorted in same way, may perform narrowing traversal by retriving
/// mutual lower_bound/higher_bound O(log(n)) operations for detecting common subsets in sorted sets.
...
...
@@ -1139,6 +1141,7 @@ namespace INMOST
/// You are encouraged to do so even if you are not going to use this information -
/// some internal algorithms may benefit from it.
///
/// \todo
/// !TODO 52 - check radix sort on big endian computer
/// @param comp one of the comparators from description
/// @see Mesh::SetComparatorTag
...
...
@@ -2221,8 +2224,9 @@ namespace INMOST
///
/// @param ghost array of handles
/// @param num number of handles
/// \todo
/// TODO
/// 1
)
Currently request for deletion of elements of lower level then cell will be simply ignored, ensure
/// 1
.
Currently request for deletion of elements of lower level then cell will be simply ignored, ensure
/// in future that algorithm will properly rise deletion data from lower to upper adjacencies
/// to delete all the upper adjacencies that depend on deleted lower adjacencies
void
RemoveGhostElements
(
const
HandleType
*
ghost
,
enumerator
num
);
...
...
@@ -2235,8 +2239,9 @@ namespace INMOST
/// in parallel algorithms should be performed using global identificators instead
/// of centroids which is faster.
///
/// \todo
/// TODO
/// 1
)
invoking function before loading mesh will not renew global identificators after load
/// 1
.
invoking function before loading mesh will not renew global identificators after load
/// but would not unset have_global_id either. There are probably too many places when
/// global ids may become invalid but no flag will be set. It may be benefitial to set
/// such flags along with updating geometrical data which seems to be maintained fairly well
...
...
@@ -2248,6 +2253,7 @@ namespace INMOST
/// this would not do any difference on homogeneous architecture, but it may help you save a lot of
/// time and nerves in heterogeneous parallel environment.
///
/// \todo
/// TODO: see TODO in Mesh::ReduceData
///
/// Blocking, Collective point-2-point
...
...
@@ -2328,6 +2334,7 @@ namespace INMOST
/// time and nerves in heterogeneous parallel environment.
///
/// Exchanging tags of DATA_REFERNCE is not implemented, TODO 14.
/// \todo
/// TODO:
/// 1. Exchanging DATA_REFERENCE tags not implemented, this is due to the absence of any conclusion
/// - on how it should behave:
...
...
@@ -2425,9 +2432,10 @@ namespace INMOST
///
/// Given that all the data was up to date among processors all the data at the end of the algorithm will be also up to data
///
/// \todo
/// TODO
/// 1
)
test halo exchange algorithm (if used then change collective point-2-point to collective)
/// 2
)
see TODO 2 in Mesh::Redistribute
/// 1
.
test halo exchange algorithm (if used then change collective point-2-point to collective)
/// 2
.
see TODO 2 in Mesh::Redistribute
///
/// Collective point-2-point.
///
...
...
@@ -2474,7 +2482,9 @@ namespace INMOST
/// If you have output from Zoltan or ParMetis for cells of the mesh
/// then just write this output to RedistributeTag and call Mesh::Redistribute.
///
/// TODO: 1)introduce "TEMPORARY_KEEP_GHOSTED" tag that will store processors on which copy of element
/// \todo
/// TODO:
/// 1. introduce "TEMPORARY_KEEP_GHOSTED" tag that will store processors on which copy of element
/// should be kept, internally just merge it with "TEMPORARY_NEW_PROCESSORS" tag
/// this will allow user to control ghosting of certain elements and not to invoke ExchangeMarked
/// every time after Redistribute.
...
...
@@ -2482,7 +2492,7 @@ namespace INMOST
/// clearing and ExchangeMarked performs initial action based on SendtoTag, it is due to
/// check that SendtoTag is properly merged with "TEMPORARY_NEW_PROCESSORS" before call to ExchangeMarked
/// and received elements are not deleted by accident.
///
2)
let user provide any integer tag as input without involving RedistributeTag
///
2.
let user provide any integer tag as input without involving RedistributeTag
///
/// Collective point-2-point.
///
...
...
@@ -2744,6 +2754,7 @@ namespace INMOST
/// - "VTK_GRID_DIMS" - set "2" for two-dimensional vtk grids, "3" for three-dimensional vtk grids
/// - "VERBOSITY" - set "2" for progress messages, "1" for reports, "0" for silence
///
/// \todo
/// TODO:
/// introduce "SET_TAGS_LOAD", "SET_TAGS_SAVE" to explicitly provide set of tags to write
/// or "SKIP_TAGS_LOAD", "SKIP_TAGS_SAVE" tags to skip
...
...
@@ -2822,11 +2833,12 @@ namespace INMOST
void
SwapModification
();
// swap hidden and new elements, so that old mesh is recovered
void
BeginModification
();
//allow elements to be hidden
/// After this function any link to deleted element will be replaced by InvalidHandle().
/// \todo
/// TODO:
/// 1
)
maybe instead of forming set of deleted elements and subtracting set from other sets it is better
/// 1
.
maybe instead of forming set of deleted elements and subtracting set from other sets it is better
/// to remove each modified element
/// (done, check and compare)
/// 2
)
parent/child elements in set would not be replaced or reconnected, this may lead to wrong behavior
/// 2
.
parent/child elements in set would not be replaced or reconnected, this may lead to wrong behavior
/// (done, check and compare)
void
ApplyModification
();
//modify DATA_REFERENCE tags so that links to hidden elements are converted to NULL and removed from sets
/// This function is not yet implemented. It should correctly resolve parallel state of
...
...
@@ -2848,11 +2860,13 @@ namespace INMOST
/// If you perform topological checks on your own, you'd probably better turn off checks before calling CreateXXX
/// functions. Note that check for duplicates within mesh is performed by Mesh::FindSharedAdjacency.
///
/// \todo
/// TODO: list checks performed inside in description
TopologyCheck
BeginTopologyCheck
(
ElementType
etype
,
const
HandleType
*
adj
,
enumerator
num
);
/// This function performs some topologycal checks after creation of element.
/// Function is used internally by CreateEdge, CreateFace, CreateCell functions.
///
/// \todo
/// TODO: list checks performed inside in description.
TopologyCheck
EndTopologyCheck
(
HandleType
e
);
//check created element
/// This will return tag by which you can retrieve error mark to any element on which topogy check failed.
...
...
@@ -2977,6 +2991,7 @@ namespace INMOST
};
void
SortHandles
(
HandleType
*
h
,
enumerator
num
);
/// \todo
/// TODO 53 check that putting global ids to array will be faster
void
SortByGlobalID
(
HandleType
*
h
,
enumerator
num
);
};
...
...
inmost_solver.h
View file @
6e83b247
...
...
@@ -28,6 +28,7 @@ namespace INMOST
/// Solver class is used to set the coefficient Matrix, the right-hand side Vector
/// and the initial guess Vector, construct the preconditioner and Solve
/// the linear system.
///
/// Formally, Solver class is independent of INMOST::Mesh class.
/// @see Solver::Matrix
/// @see Solver::Vector
...
...
@@ -464,54 +465,56 @@ namespace INMOST
Solver
&
operator
=
(
Solver
const
&
other
);
//prohibit assignment
public:
/// Set the solver parameter of the integer type.
/// You can find defaults for parameters in the top of the file inmost_solver.h
/// You can find defaults for parameters in the top of the file inmost_solver.h.
///
/// Parameters:
/// "maximum_iterations"
- total number of iterations
/// "schwartz_overlap"
- number of overlapping levels for additive schwartz method
///
-
"maximum_iterations" - total number of iterations
///
-
"schwartz_overlap" - number of overlapping levels for additive schwartz method
,
/// works for:
/// INNER_ILU2, INNER_MLILUC
/// Trilinos_Aztec, Trilinos_Belos, Trilinos_ML, Trilinos_Ifpack
/// PETSc
/// "gmres_substeps"
- number of gmres steps performed after each bicgstab step
///
-
"gmres_substeps" - number of gmres steps performed after each bicgstab step
,
/// works for:
/// INNER_ILU2, INNER_MLILUC
/// "reorder_nonzeros"
- place sparser rows at the beggining of matrix during reordering
///
-
"reorder_nonzeros" - place sparser rows at the beggining of matrix during reordering
,
/// works for:
/// INNER_MLILUC
/// "rescale_iterations"
- number of iterations for two-side matrix rescaling
///
-
"rescale_iterations" - number of iterations for two-side matrix rescaling
,
/// works for:
/// INNER_ILU2, INNER_MLILUC
/// "condition_estimation" - exploit condition estimation of inversed factors to adapt
/// drop and reuse tolerances
///
-
"condition_estimation" - exploit condition estimation of inversed factors to adapt
/// drop and reuse tolerances
,
/// works for:
/// INNER_MLILUC
/// "adapt_ddpq_tolerance" - adapt ddpq tolerance depending from the complexity
// of calculation of Schur complement
///
-
"adapt_ddpq_tolerance" - adapt ddpq tolerance depending from the complexity
// of calculation of Schur complement
,
/// works for:
/// INNER_MLILUC
void
SetParameterEnum
(
std
::
string
name
,
INMOST_DATA_ENUM_TYPE
value
);
/// Set the solver parameter of the real type.
/// You can find defaults for parameters in the top of the file inmost_solver.h
/// You can find defaults for parameters in the top of the file inmost_solver.h.
///
/// Parameters:
/// "absolute_tolerance"
- iterative method will stop on i-th iteration
///
-
"absolute_tolerance" - iterative method will stop on i-th iteration
/// if ||A x(i)-b|| < absolute_tolerance
/// "relative_tolerance"
- iterative method will stop on i-th iteration
///
-
"relative_tolerance" - iterative method will stop on i-th iteration
/// if ||A x(i)-b||/||A x(0) - b||
/// "divergence_tolerance" - iterative method will fail if
///
-
"divergence_tolerance" - iterative method will fail if
/// ||A x(i) - b|| > divergence_tolerance
/// "drop_tolerance"
- tolerance for dropping values during incomplete factorization
///
-
"drop_tolerance" - tolerance for dropping values during incomplete factorization
,
/// works for:
/// INNER_ILU2, INNER_MLILUC
/// Trilinos_Aztec, Trilinos_Ifpack
/// PETSc
/// "reuse_tolerance"
- tolerance for reusing values during incomplete factorization
///
-
"reuse_tolerance" - tolerance for reusing values during incomplete factorization
,
/// these values are used only during calculation of L and U factors
/// and/or Schur complement and discarded once factorization is done
/// value should be less then "drop_tolerance"
/// typical value is drop_tolerance^2
/// and/or Schur complement and discarded once factorization is done
,
/// value should be less then "drop_tolerance"
,
/// typical value is drop_tolerance^2
,
/// works for:
/// INNER_ILU2, INNER_MLILUC
/// "ddpq_tolerance"
- by this tolerance most diagonnaly-dominant elements will be selected
///
-
"ddpq_tolerance" - by this tolerance most diagonnaly-dominant elements will be selected
/// to form the next level of factorization, the closer the tolerance
/// is to one the smaller will be the level. Actual rule is:
/// A(i,j)/(sum(A(i,:))+sum(A(:,j))-A(i,j)) > ddpq_tolerance *
...
...
@@ -519,7 +522,7 @@ namespace INMOST
/// where on imax, jmax maximum is reached.
/// works for:
/// INNER_MLILUC
/// "fill_level"
- level of fill for ILU-type preconditioners
///
-
"fill_level" - level of fill for ILU-type preconditioners
,
/// works for:
/// INNER_ILU2 (if LFILL is defined in solver_ilu2.hpp)
/// Trilinos, Trilinos_Ifpack
...
...
@@ -541,18 +544,23 @@ namespace INMOST
/// @param OldPreconditioner If this parameter is set to true,
/// then the previous preconditioner will be used,
/// otherwise the new preconditioner will be constructed.
///
/// Preconditioner will be constructed on call to this function
/// for INNER_*, PETSc and ANI packages
/// for Trilinos preconditioner will be constructed each time Solver::Solve is called
/// Any changes to preconditioner parameters should happen before that point
/// - for INNER_*, PETSc and ANI packages
/// - for Trilinos preconditioner will be constructed each time Solver::Solve is called
///
/// Any changes to preconditioner parameters should happen before that point.
/// If you increase gmres_substep after this point, inner methods most likely will fail
void
SetMatrix
(
Matrix
&
A
,
bool
OldPreconditioner
=
false
);
/// Solver the linear system: A*x = b.
/// Prior to this call you should call SetMatrix
///
/// @param RHS The right-hand side Vector b.
/// @param SOL The initial guess to the solution on input and the solution Vector x on return.
///
/// It is assumed that the coefficient matrix A have been set
/// and the preconditioner have been already constructed.
///
/// @see Solver::SetMatrix
bool
Solve
(
Vector
&
RHS
,
Vector
&
SOL
);
/// Get the reason of convergence or divergence of the last solution.
...
...
@@ -573,6 +581,7 @@ namespace INMOST
~
Solver
();
/// Initialize the stage of parallel solution.
/// If MPI is not initialized yet, then it will be initialized.
///
/// database file is used to pass parameters to PETSc and Trilinos packages.
/// if database file for is provided any changes through SetParameterEnum,
/// SetParameterReal would not be effective for PETSc and Trilinos packages.
...
...
@@ -581,15 +590,18 @@ namespace INMOST
/// @param argc The number of arguments transmitted to the function main.
/// @param argv The pointer to arguments transmitted to the function main.
/// @param database Usually the name of the file with the Solver parameters.
///
/// The shortest call to this function with the default solver parameters is the following: Initialize(NULL,NULL,"");
/// @see Solver::Finalize
/// @see Solver::isInitialized
///
/// Example of contents of the database file:
/// PETSc: petsc_options.txt
/// Trilinos_Ifpack: trilinos_ifpack_options.xml
/// Trilinos_ML: trilinos_ml_options.xml
/// Trilinos_Aztec: trilinos_aztec_options.xml
/// Trilinos_Belos: trilinos_belos_options.xml
///
/// PETSc: petsc_options.txt
/// Trilinos_Ifpack: trilinos_ifpack_options.xml
/// 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
=
""
);
/// Finalize the stage of parallel solution.
/// If MPI was initialized in Solver::Initialize, then it will be finalized.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment