Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
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
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
podlesny
dune-tectonic
Commits
cc4001ad
Commit
cc4001ad
authored
4 years ago
by
podlesny
Browse files
Options
Downloads
Patches
Plain Diff
use makelinearsolver now instead of constructing locally
parent
026e7efd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/tectonic/time-stepping/step.hh
+2
-66
2 additions, 66 deletions
dune/tectonic/time-stepping/step.hh
with
2 additions
and
66 deletions
dune/tectonic/time-stepping/step.hh
+
2
−
66
View file @
cc4001ad
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
#include
<dune/solvers/iterationsteps/cgstep.hh>
#include
<dune/solvers/iterationsteps/cgstep.hh>
#include
<dune/solvers/solvers/loopsolver.hh>
#include
<dune/solvers/solvers/loopsolver.hh>
#include
"../spatial-solving/
preconditio
ners
/multilevelpatchprecondition
er.hh"
#include
"../spatial-solving/
makeli
ne
a
rs
olv
er.hh"
#include
<dune/tectonic/utils/reductionfactors.hh>
#include
<dune/tectonic/utils/reductionfactors.hh>
...
@@ -130,71 +130,7 @@ class Step : protected StepBase<Factory, ContactNetwork, Updaters, ErrorNorms> {
...
@@ -130,71 +130,7 @@ class Step : protected StepBase<Factory, ContactNetwork, Updaters, ErrorNorms> {
using
Vector
=
typename
Factory
::
Vector
;
using
Vector
=
typename
Factory
::
Vector
;
using
Matrix
=
typename
Factory
::
Matrix
;
using
Matrix
=
typename
Factory
::
Matrix
;
/* old, pre multi threading, was unused
auto
linearSolver
=
makeLinearSolver
<
ContactNetwork
,
Vector
>
(
this
->
parset_
,
this
->
contactNetwork_
);
using Norm = EnergyNorm<Matrix, Vector>;
using Preconditioner = MultilevelPatchPreconditioner<ContactNetwork, Matrix, Vector>;
using LinearSolver = typename Dune::Solvers::LoopSolver<Vector>;
const auto& preconditionerParset = parset_.sub("solver.tnnmg.linear.preconditioner");
Dune::BitSetVector<1> activeLevels(contactNetwork_.nLevels(), true);
Preconditioner preconditioner(preconditionerParset, contactNetwork_, activeLevels);
preconditioner.setPatchDepth(preconditionerParset.template get<size_t>("patchDepth"));
preconditioner.build();
auto cgStep = std::make_shared<Dune::Solvers::CGStep<Matrix, Vector>>();
cgStep->setPreconditioner(preconditioner);
Norm norm(*cgStep);
return std::make_shared<LinearSolver>(cgStep, parset_.template get<int>("solver.tnnmg.main.multi"), parset_.template get<double>("solver.tnnmg.linear.tolerance"), norm, Solver::QUIET);
*/
// patch preconditioner only needs to be computed once per advance()
// make linear solver for linear correction in TNNMGStep
using
Norm
=
EnergyNorm
<
Matrix
,
Vector
>
;
using
Preconditioner
=
MultilevelPatchPreconditioner
<
ContactNetwork
,
Matrix
,
Vector
>
;
using
LinearSolver
=
typename
Dune
::
Solvers
::
LoopSolver
<
Vector
>
;
/*const auto& preconditionerParset = parset_.sub("solver.tnnmg.preconditioner");
Dune::BitSetVector<1> activeLevels(contactNetwork_.nLevels(), true);
Preconditioner preconditioner(preconditionerParset, contactNetwork_, activeLevels);
preconditioner.setPatchDepth(preconditionerParset.template get<size_t>("patchDepth"));
preconditioner.build();
auto cgStep = std::make_shared<Dune::Solvers::CGStep<Matrix, Vector>>();
cgStep->setPreconditioner(preconditioner);
Norm norm(*cgStep);
auto linearSolver = std::make_shared<LinearSolver>(cgStep, parset_.template get<int>("solver.tnnmg.main.multi"), parset_.template get<double>("solver.tnnmg.preconditioner.basesolver.tolerance"), norm, Solver::QUIET);
*/
// set multigrid solver
auto
smoother
=
TruncatedBlockGSStep
<
Matrix
,
Vector
>
();
// transfer operators need to be recomputed on change due to setDeformation()
using
TransferOperator
=
NBodyContactTransfer
<
ContactNetwork
,
Vector
>
;
using
TransferOperators
=
std
::
vector
<
std
::
shared_ptr
<
TransferOperator
>>
;
TransferOperators
transfer
(
this
->
contactNetwork_
.
nLevels
()
-
1
);
for
(
size_t
i
=
0
;
i
<
transfer
.
size
();
i
++
)
{
transfer
[
i
]
=
std
::
make_shared
<
TransferOperator
>
();
transfer
[
i
]
->
setup
(
this
->
contactNetwork_
,
i
,
i
+
1
);
}
// Remove any recompute filed so that initially the full transferoperator is assembled
for
(
size_t
i
=
0
;
i
<
transfer
.
size
();
i
++
)
std
::
dynamic_pointer_cast
<
TruncatedMGTransfer
<
Vector
>
>
(
transfer
[
i
])
->
setRecomputeBitField
(
nullptr
);
auto
linearMultigridStep
=
std
::
make_shared
<
Dune
::
Solvers
::
MultigridStep
<
Matrix
,
Vector
>
>
();
linearMultigridStep
->
setMGType
(
1
,
3
,
3
);
linearMultigridStep
->
setSmoother
(
smoother
);
linearMultigridStep
->
setTransferOperators
(
transfer
);
Norm
norm
(
*
linearMultigridStep
);
auto
linearSolver
=
std
::
make_shared
<
LinearSolver
>
(
linearMultigridStep
,
this
->
parset_
.
template
get
<
int
>(
"solver.tnnmg.main.multi"
),
this
->
parset_
.
template
get
<
double
>(
"solver.tnnmg.preconditioner.basesolver.tolerance"
),
norm
,
Solver
::
QUIET
);
Vector
x
;
Vector
x
;
x
.
resize
(
nBodyAssembler_
.
totalHasObstacle_
.
size
());
x
.
resize
(
nBodyAssembler_
.
totalHasObstacle_
.
size
());
...
...
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