Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-solvers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Model registry
Operate
Environments
Monitor
Incidents
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
agnumpde
dune-solvers
Commits
c55e90fa
Commit
c55e90fa
authored
10 years ago
by
Carsten Gräser
Browse files
Options
Downloads
Patches
Plain Diff
Add convenience method for absulute norm criterion
parent
a6a514ee
No related branches found
No related tags found
1 merge request
!4
Feature/flexible loopsolver monitoring
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/solvers/solvers/criterion.hh
+48
-0
48 additions, 0 deletions
dune/solvers/solvers/criterion.hh
with
48 additions
and
0 deletions
dune/solvers/solvers/criterion.hh
+
48
−
0
View file @
c55e90fa
...
@@ -207,6 +207,54 @@ namespace Dune {
...
@@ -207,6 +207,54 @@ namespace Dune {
" iter"
);
" iter"
);
}
}
/**
* \brief Create a Criterion for checking the correction norm
*
* \param iterationStep The IterationStep to be monitored
* \param norm Norm to be evaluated for the correction
* \param tolerance Tolerance necessary to satisfy the criterion
* \param correctionNorms A container to store the computed correction norms
*/
template
<
class
IterationStepType
,
class
NormType
,
class
CorrectionNormContainer
>
Criterion
correctionNormCriterion
(
const
IterationStepType
&
iterationStep
,
const
NormType
&
norm
,
double
tolerance
,
CorrectionNormContainer
&
correctionNorms
)
{
auto
lastIterate
=
std
::
make_shared
<
typename
IterationStepType
::
Vector
>
(
*
iterationStep
.
getIterate
());
return
Criterion
(
[
&
,
lastIterate
,
tolerance
]
()
mutable
{
double
normOfCorrection
=
norm
.
diff
(
*
lastIterate
,
*
iterationStep
.
getIterate
());
correctionNorms
.
push_back
(
normOfCorrection
);
*
lastIterate
=
*
iterationStep
.
getIterate
();
return
std
::
make_tuple
(
normOfCorrection
<
tolerance
,
Dune
::
formatString
(
" % 14.7e"
,
normOfCorrection
));
},
" abs correction"
);
}
/**
* \brief Create a Criterion for checking the correction norm
*
* \param iterationStep The IterationStep to be monitored
* \param norm Norm to be evaluated for the correction
* \param tolerance Tolerance necessary to satisfy the criterion
*/
template
<
class
IterationStepType
,
class
NormType
>
Criterion
correctionNormCriterion
(
const
IterationStepType
&
iterationStep
,
const
NormType
&
norm
,
double
tolerance
)
{
auto
lastIterate
=
std
::
make_shared
<
typename
IterationStepType
::
Vector
>
(
*
iterationStep
.
getIterate
());
return
Criterion
(
[
&
,
lastIterate
,
tolerance
]
()
mutable
{
double
normOfCorrection
=
norm
.
diff
(
*
lastIterate
,
*
iterationStep
.
getIterate
());
*
lastIterate
=
*
iterationStep
.
getIterate
();
return
std
::
make_tuple
(
normOfCorrection
<
tolerance
,
Dune
::
formatString
(
" % 14.7e"
,
normOfCorrection
));
},
" abs correction"
);
}
}
// end namespace Solvers
}
// end namespace Solvers
...
...
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