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
1eb936d7
Commit
1eb936d7
authored
13 years ago
by
Elias Pipping
Committed by
Elias Pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Get requiredResidual and local steps from parset
parent
1a741aea
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune/tectonic/myblockproblem.hh
+20
-12
20 additions, 12 deletions
dune/tectonic/myblockproblem.hh
src/one-body-sample.cc
+1
-1
1 addition, 1 deletion
src/one-body-sample.cc
src/one-body-sample.parset
+6
-0
6 additions, 0 deletions
src/one-body-sample.parset
with
27 additions
and
13 deletions
dune/tectonic/myblockproblem.hh
+
20
−
12
View file @
1eb936d7
...
@@ -27,18 +27,20 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
...
@@ -27,18 +27,20 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
/** \brief Solves one local system using a modified gradient method */
/** \brief Solves one local system using a modified gradient method */
class
IterateObject
;
class
IterateObject
;
MyBlockProblem
(
MyConvexProblemType
&
problem
)
:
problem
(
problem
)
{
MyBlockProblem
(
Dune
::
ParameterTree
&
parset
,
MyConvexProblemType
&
problem
)
bisection
=
:
parset
(
parset
),
problem
(
problem
)
{
B
isection
(
0.0
,
// acceptError: Stop if the search interval has
b
isection
=
Bisection
(
// become smaller than this number
0.0
,
// acceptError: Stop if the search interval has
1.0
,
// acceptFactor: ?
// become smaller than this number
1
e-12
,
//
requiredResidual
: ?
1
.0
,
//
acceptFactor
: ?
true
,
// fastQuadratic
parset
.
get
<
double
>
(
"bisection.requiredResidual"
),
true
,
// fastQuadratic
0
);
// safety: acceptance factor for inexact minimization
0
);
// safety: acceptance factor for inexact minimization
}
}
/** \brief Constructs and returns an iterate object */
/** \brief Constructs and returns an iterate object */
IterateObject
getIterateObject
()
{
return
IterateObject
(
bisection
,
problem
);
}
IterateObject
getIterateObject
()
{
return
IterateObject
(
parset
,
bisection
,
problem
);
}
private
:
private
:
// problem data
// problem data
...
@@ -46,6 +48,8 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
...
@@ -46,6 +48,8 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
// commonly used minimization stuff
// commonly used minimization stuff
Bisection
bisection
;
Bisection
bisection
;
Dune
::
ParameterTree
&
parset
;
};
};
/** \brief Solves one local system using a scalar Gauss-Seidel method */
/** \brief Solves one local system using a scalar Gauss-Seidel method */
...
@@ -58,8 +62,9 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
...
@@ -58,8 +62,9 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
* \param bisection The class used to do a scalar bisection
* \param bisection The class used to do a scalar bisection
* \param problem The problem including quadratic part and nonlinear part
* \param problem The problem including quadratic part and nonlinear part
*/
*/
IterateObject
(
Bisection
const
&
bisection
,
MyConvexProblemType
&
problem
)
IterateObject
(
Dune
::
ParameterTree
&
parset
,
Bisection
const
&
bisection
,
:
problem
(
problem
),
bisection
(
bisection
)
{}
MyConvexProblemType
&
problem
)
:
parset
(
parset
),
problem
(
problem
),
bisection
(
bisection
)
{}
public
:
public
:
/** \brief Set the current iterate */
/** \brief Set the current iterate */
...
@@ -119,11 +124,14 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
...
@@ -119,11 +124,14 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
ignore_component
);
ignore_component
);
LocalVectorType
correction
;
LocalVectorType
correction
;
Dune
::
minimise
(
localJ
,
ui
,
5
,
bisection
);
// FIXME: hardcoded value
Dune
::
minimise
(
localJ
,
ui
,
parset
.
get
<
size_t
>
(
"localsolver.steps"
),
bisection
);
}
}
}
}
private
:
private
:
Dune
::
ParameterTree
&
parset
;
// problem data
// problem data
MyConvexProblemType
&
problem
;
MyConvexProblemType
&
problem
;
...
...
This diff is collapsed.
Click to expand it.
src/one-body-sample.cc
+
1
−
1
View file @
1eb936d7
...
@@ -257,7 +257,7 @@ int main(int argc, char *argv[]) {
...
@@ -257,7 +257,7 @@ int main(int argc, char *argv[]) {
{
{
MyConvexProblemType
myConvexProblem
(
stiffnessMatrix
,
MyConvexProblemType
myConvexProblem
(
stiffnessMatrix
,
*
myGlobalNonlinearity
,
b1
,
u1
);
*
myGlobalNonlinearity
,
b1
,
u1
);
MyBlockProblemType
myBlockProblem
(
myConvexProblem
);
MyBlockProblemType
myBlockProblem
(
parset
,
myConvexProblem
);
nonlinearGSStep
.
setProblem
(
u1
,
myBlockProblem
);
nonlinearGSStep
.
setProblem
(
u1
,
myBlockProblem
);
LoopSolver
<
VectorType
>
solver
(
&
nonlinearGSStep
,
solver_maxIterations
,
LoopSolver
<
VectorType
>
solver
(
&
nonlinearGSStep
,
solver_maxIterations
,
...
...
This diff is collapsed.
Click to expand it.
src/one-body-sample.parset
+
6
−
0
View file @
1eb936d7
...
@@ -11,6 +11,12 @@ nu = 0.3
...
@@ -11,6 +11,12 @@ nu = 0.3
maxiterations = 100000
maxiterations = 100000
tolerance = 1e-6
tolerance = 1e-6
[localsolver]
steps = 5
[bisection]
requiredResidual = 1e-12
[boundary.friction]
[boundary.friction]
normalstress = 0.1
normalstress = 0.1
mu = 0.75
mu = 0.75
...
...
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