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
Snippets
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
Chaofan Chen
ogs
Commits
b97a21dd
Commit
b97a21dd
authored
10 months ago
by
Christoph Lehmann
Committed by
Dmitri Naumov
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Try to fix accelerated linear PDE assembly
parent
726ce877
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MathLib/LinAlg/Eigen/EigenLinearSolver.cpp
+25
-1
25 additions, 1 deletion
MathLib/LinAlg/Eigen/EigenLinearSolver.cpp
NumLib/ODESolver/NonlinearSolver.cpp
+3
-9
3 additions, 9 deletions
NumLib/ODESolver/NonlinearSolver.cpp
with
28 additions
and
10 deletions
MathLib/LinAlg/Eigen/EigenLinearSolver.cpp
+
25
−
1
View file @
b97a21dd
...
...
@@ -63,8 +63,30 @@ public:
}
bool
compute
(
Matrix
&
A
,
EigenOption
&
opt
,
MathLib
::
LinearSolverBehaviour
const
linear_solver_behaviour
)
MathLib
::
LinearSolverBehaviour
linear_solver_behaviour
)
{
if
(
linear_solver_behaviour
==
MathLib
::
LinearSolverBehaviour
::
REUSE
)
{
// Checking if this is the first compute() call should work both for
// direct solvers (that factorize the matrix A) and for iterative
// solvers (that store a reference to A in the preconditioner).
if
(
is_first_compute_call_
)
{
// There is nothing there, yet, to be reused. Hence, we compute
// and store the result.
linear_solver_behaviour
=
MathLib
::
LinearSolverBehaviour
::
RECOMPUTE_AND_STORE
;
}
else
{
return
true
;
}
}
// TODO (CL) That might not work under all circumstances, e.g., if the
// linear solver fails subsequently. Time will tell.
is_first_compute_call_
=
false
;
#ifdef USE_EIGEN_UNSUPPORTED
if
(
opt
.
scaling
)
{
...
...
@@ -89,6 +111,8 @@ private:
#ifdef USE_EIGEN_UNSUPPORTED
std
::
unique_ptr
<
Eigen
::
IterScaling
<
EigenMatrix
::
RawMatrixType
>>
scaling_
;
#endif
bool
is_first_compute_call_
=
true
;
};
namespace
details
...
...
This diff is collapsed.
Click to expand it.
NumLib/ODESolver/NonlinearSolver.cpp
+
3
−
9
View file @
b97a21dd
...
...
@@ -34,18 +34,12 @@ bool solvePicard(GlobalLinearSolver& linear_solver, GlobalMatrix& A,
BaseLib
::
RunTime
time_linear_solver
;
time_linear_solver
.
start
();
if
(
linear_solver_behaviour
==
MathLib
::
LinearSolverBehaviour
::
RECOMPUTE
||
linear_solver_behaviour
==
MathLib
::
LinearSolverBehaviour
::
RECOMPUTE_AND_STORE
)
if
(
!
linear_solver
.
compute
(
A
,
linear_solver_behaviour
))
{
if
(
!
linear_solver
.
compute
(
A
,
linear_solver_behaviour
))
{
ERR
(
"Picard: The linear solver failed in the compute() step."
);
return
false
;
}
ERR
(
"Picard: The linear solver failed in the compute() step."
);
return
false
;
}
// REUSE the previously computed preconditioner or LU decomposition
bool
const
iteration_succeeded
=
linear_solver
.
solve
(
rhs
,
x
);
INFO
(
"[time] Linear solver took {:g} s."
,
time_linear_solver
.
elapsed
());
...
...
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