Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Sander, Oliver
dune-gfe
Commits
66b3ebf1
Commit
66b3ebf1
authored
17 years ago
by
Oliver Sander
Committed by
sander@PCPOOL.MI.FU-BERLIN.DE
17 years ago
Browse files
Options
Downloads
Patches
Plain Diff
don't hardwire trust-region solver tolerance
[[Imported from SVN: r1510]]
parent
b1bbcb7a
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
src/rodsolver.cc
+3
-7
3 additions, 7 deletions
src/rodsolver.cc
src/rodsolver.hh
+4
-0
4 additions, 0 deletions
src/rodsolver.hh
with
7 additions
and
7 deletions
src/rodsolver.cc
+
3
−
7
View file @
66b3ebf1
...
@@ -49,6 +49,7 @@ template <class GridType>
...
@@ -49,6 +49,7 @@ template <class GridType>
void
RodSolver
<
GridType
>::
setup
(
const
GridType
&
grid
,
void
RodSolver
<
GridType
>::
setup
(
const
GridType
&
grid
,
const
RodAssembler
<
GridType
>*
rodAssembler
,
const
RodAssembler
<
GridType
>*
rodAssembler
,
const
SolutionType
&
x
,
const
SolutionType
&
x
,
double
tolerance
,
int
maxTrustRegionSteps
,
int
maxTrustRegionSteps
,
double
initialTrustRegionRadius
,
double
initialTrustRegionRadius
,
int
multigridIterations
,
int
multigridIterations
,
...
@@ -65,6 +66,7 @@ void RodSolver<GridType>::setup(const GridType& grid,
...
@@ -65,6 +66,7 @@ void RodSolver<GridType>::setup(const GridType& grid,
grid_
=
&
grid
;
grid_
=
&
grid
;
rodAssembler_
=
rodAssembler
;
rodAssembler_
=
rodAssembler
;
x_
=
x
;
x_
=
x
;
tolerance_
=
tolerance
;
maxTrustRegionSteps_
=
maxTrustRegionSteps
;
maxTrustRegionSteps_
=
maxTrustRegionSteps
;
initialTrustRegionRadius_
=
initialTrustRegionRadius
;
initialTrustRegionRadius_
=
initialTrustRegionRadius
;
multigridIterations_
=
multigridIterations
;
multigridIterations_
=
multigridIterations
;
...
@@ -322,7 +324,7 @@ void RodSolver<GridType>::solve()
...
@@ -322,7 +324,7 @@ void RodSolver<GridType>::solve()
printf
(
"infinity norm of the correction: %g
\n
"
,
corr
.
infinity_norm
());
printf
(
"infinity norm of the correction: %g
\n
"
,
corr
.
infinity_norm
());
if
(
corr
.
infinity_norm
()
<
1e-5
)
{
if
(
corr
.
infinity_norm
()
<
tolerance_
)
{
std
::
cout
<<
"CORRECTION IS SMALL ENOUGH"
<<
std
::
endl
;
std
::
cout
<<
"CORRECTION IS SMALL ENOUGH"
<<
std
::
endl
;
break
;
break
;
}
}
...
@@ -344,12 +346,6 @@ void RodSolver<GridType>::solve()
...
@@ -344,12 +346,6 @@ void RodSolver<GridType>::solve()
}
}
#if 0
std::cout << "newIterate: \n";
for (int j=0; j<newIterate.size(); j++)
std::cout << newIterate[j] << std::endl;
#endif
/** \todo Don't always recompute oldEnergy */
/** \todo Don't always recompute oldEnergy */
double
oldEnergy
=
rodAssembler_
->
computeEnergy
(
x_
);
double
oldEnergy
=
rodAssembler_
->
computeEnergy
(
x_
);
double
energy
=
rodAssembler_
->
computeEnergy
(
newIterate
);
double
energy
=
rodAssembler_
->
computeEnergy
(
newIterate
);
...
...
This diff is collapsed.
Click to expand it.
src/rodsolver.hh
+
4
−
0
View file @
66b3ebf1
...
@@ -35,6 +35,7 @@ public:
...
@@ -35,6 +35,7 @@ public:
void
setup
(
const
GridType
&
grid
,
void
setup
(
const
GridType
&
grid
,
const
RodAssembler
<
GridType
>*
rodAssembler
,
const
RodAssembler
<
GridType
>*
rodAssembler
,
const
SolutionType
&
x
,
const
SolutionType
&
x
,
double
tolerance
,
int
maxTrustRegionSteps
,
int
maxTrustRegionSteps
,
double
initialTrustRegionRadius
,
double
initialTrustRegionRadius
,
int
multigridIterations
,
int
multigridIterations
,
...
@@ -65,6 +66,9 @@ protected:
...
@@ -65,6 +66,9 @@ protected:
/** \brief The initial trust-region radius in the maximum-norm */
/** \brief The initial trust-region radius in the maximum-norm */
double
initialTrustRegionRadius_
;
double
initialTrustRegionRadius_
;
/** \brief Tolerance of the trust-region solver */
double
tolerance_
;
/** \brief Maximum number of trust-region steps */
/** \brief Maximum number of trust-region steps */
int
maxTrustRegionSteps_
;
int
maxTrustRegionSteps_
;
...
...
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