Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yuhao Liu
ogs
Commits
186f2ceb
Commit
186f2ceb
authored
8 years ago
by
Norihiro Watanabe
Browse files
Options
Downloads
Patches
Plain Diff
[Math/Eigen] better error messages when GMRES and scaling are not available
parent
444a2846
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MathLib/LinAlg/Eigen/EigenLinearSolver.cpp
+12
-6
12 additions, 6 deletions
MathLib/LinAlg/Eigen/EigenLinearSolver.cpp
with
12 additions
and
6 deletions
MathLib/LinAlg/Eigen/EigenLinearSolver.cpp
+
12
−
6
View file @
186f2ceb
...
...
@@ -154,11 +154,15 @@ std::unique_ptr<EigenLinearSolverBase> createIterativeSolver(
case
EigenOption
::
SolverType
::
CG
:
{
return
createIterativeSolver
<
EigenCGSolver
>
(
precon_type
);
}
#ifdef USE_EIGEN_UNSUPPORTED
case
EigenOption
::
SolverType
::
GMRES
:
{
#ifdef USE_EIGEN_UNSUPPORTED
return
createIterativeSolver
<
Eigen
::
GMRES
>
(
precon_type
);
}
#else
OGS_FATAL
(
"The code is not compiled with the Eigen unsupported modules. "
"Linear solver type GMRES is not available."
);
#endif
}
default
:
OGS_FATAL
(
"Invalid Eigen iterative linear solver type. Aborting."
);
}
...
...
@@ -186,9 +190,7 @@ EigenLinearSolver::EigenLinearSolver(
}
case
EigenOption
::
SolverType
::
BiCGSTAB
:
case
EigenOption
::
SolverType
::
CG
:
#ifdef USE_EIGEN_UNSUPPORTED
case
EigenOption
::
SolverType
::
GMRES
:
#endif
_solver
=
details
::
createIterativeSolver
(
_option
.
solver_type
,
_option
.
precon_type
);
return
;
...
...
@@ -238,13 +240,17 @@ void EigenLinearSolver::setOption(BaseLib::ConfigTree const& option)
ptSolver
->
getConfigParameterOptional
<
int
>
(
"max_iteration_step"
))
{
_option
.
max_iterations
=
*
max_iteration_step
;
}
#ifdef USE_EIGEN_UNSUPPORTED
if
(
auto
scaling
=
//! \ogs_file_param{linear_solver__eigen__scaling}
ptSolver
->
getConfigParameterOptional
<
bool
>
(
"scaling"
))
{
#ifdef USE_EIGEN_UNSUPPORTED
_option
.
scaling
=
*
scaling
;
}
#else
OGS_FATAL
(
"The code is not compiled with the Eigen unsupported modules. "
"scaling is not available."
);
#endif
}
}
bool
EigenLinearSolver
::
solve
(
EigenMatrix
&
A
,
EigenVector
&
b
,
EigenVector
&
x
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment