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
82c6b7a7
Commit
82c6b7a7
authored
16 years ago
by
Oliver Sander
Committed by
sander@PCPOOL.MI.FU-BERLIN.DE
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
The LoopSolver class has been split off IterativeSolver
[[Imported from SVN: r3413]]
parent
24b1b7a2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
dirneucoupling.cc
+3
-3
3 additions, 3 deletions
dirneucoupling.cc
src/rodsolver.cc
+20
-48
20 additions, 48 deletions
src/rodsolver.cc
src/rodsolver.hh
+4
-9
4 additions, 9 deletions
src/rodsolver.hh
staticrod.cc
+11
-10
11 additions, 10 deletions
staticrod.cc
staticrod2.cc
+7
-6
7 additions, 6 deletions
staticrod2.cc
with
45 additions
and
76 deletions
dirneucoupling.cc
+
3
−
3
View file @
82c6b7a7
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
#include
<dune/common/configparser.hh>
#include
<dune/common/configparser.hh>
#include
<dune/ag-common/multigridstep.hh>
#include
<dune/ag-common/multigridstep.hh>
#include
<dune/ag-common/
iterative
solver.hh>
#include
<dune/ag-common/
solvers/loop
solver.hh>
#include
<dune/ag-common/projectedblockgsstep.hh>
#include
<dune/ag-common/projectedblockgsstep.hh>
#ifdef HAVE_IPOPT
#ifdef HAVE_IPOPT
#include
<dune/ag-common/quadraticipopt.hh>
#include
<dune/ag-common/quadraticipopt.hh>
...
@@ -331,7 +331,7 @@ int main (int argc, char *argv[]) try
...
@@ -331,7 +331,7 @@ int main (int argc, char *argv[]) try
EnergyNorm
<
MatrixType
,
VectorType
>
energyNorm
(
multigridStep
);
EnergyNorm
<
MatrixType
,
VectorType
>
energyNorm
(
multigridStep
);
Iterative
Solver
<
VectorType
>
solver
(
&
multigridStep
,
Loop
Solver
<
VectorType
>
solver
(
&
multigridStep
,
// IPOpt doesn't like to be started in the solution
// IPOpt doesn't like to be started in the solution
(
numLevels
!=
1
)
?
multigridIterations
:
1
,
(
numLevels
!=
1
)
?
multigridIterations
:
1
,
mgTolerance
,
mgTolerance
,
...
@@ -347,7 +347,7 @@ int main (int argc, char *argv[]) try
...
@@ -347,7 +347,7 @@ int main (int argc, char *argv[]) try
multigridStep
.
mgTransfer_
.
resize
(
toplevel
);
multigridStep
.
mgTransfer_
.
resize
(
toplevel
);
for
(
int
i
=
0
;
i
<
multigridStep
.
mgTransfer_
.
size
();
i
++
){
for
(
int
i
=
0
;
i
<
multigridStep
.
mgTransfer_
.
size
();
i
++
){
TruncatedMGTransfer
<
VectorType
>*
newTransferOp
=
new
TruncatedMGTransfer
<
VectorType
>
;
Truncated
Compressed
MGTransfer
<
VectorType
>*
newTransferOp
=
new
Truncated
Compressed
MGTransfer
<
VectorType
>
;
newTransferOp
->
setup
(
grid
,
i
,
i
+
1
);
newTransferOp
->
setup
(
grid
,
i
,
i
+
1
);
multigridStep
.
mgTransfer_
[
i
]
=
newTransferOp
;
multigridStep
.
mgTransfer_
[
i
]
=
newTransferOp
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/rodsolver.cc
+
20
−
48
View file @
82c6b7a7
...
@@ -17,34 +17,13 @@
...
@@ -17,34 +17,13 @@
#include
"configuration.hh"
#include
"configuration.hh"
#include
"quaternion.hh"
#include
"quaternion.hh"
#include
"maxnormtrustregion.hh"
// for debugging
// for debugging
#include
"../test/fdcheck.hh"
#include
"../test/fdcheck.hh"
// Number of degrees of freedom:
// Number of degrees of freedom:
// 7 (x, y, z, q_1, q_2, q_3, q_4) for a spatial rod
// 7 (x, y, z, q_1, q_2, q_3, q_4) for a spatial rod
//const int blocksize = 6;
template
<
class
GridType
>
void
RodSolver
<
GridType
>::
setTrustRegionObstacles
(
double
trustRegionRadius
,
std
::
vector
<
BoxConstraint
<
field_type
,
blocksize
>
>&
trustRegionObstacles
)
{
for
(
int
j
=
0
;
j
<
trustRegionObstacles
.
size
();
j
++
)
{
for
(
int
k
=
0
;
k
<
blocksize
;
k
++
)
{
trustRegionObstacles
[
j
].
lower
(
k
)
=
-
trustRegionRadius
;
trustRegionObstacles
[
j
].
upper
(
k
)
=
trustRegionRadius
;
}
}
//std::cout << trustRegionObstacles << std::endl;
// exit(0);
}
template
<
class
GridType
>
template
<
class
GridType
>
void
RodSolver
<
GridType
>::
setup
(
const
GridType
&
grid
,
void
RodSolver
<
GridType
>::
setup
(
const
GridType
&
grid
,
...
@@ -91,12 +70,11 @@ void RodSolver<GridType>::setup(const GridType& grid,
...
@@ -91,12 +70,11 @@ void RodSolver<GridType>::setup(const GridType& grid,
EnergyNorm
<
MatrixType
,
CorrectionType
>*
baseEnergyNorm
=
new
EnergyNorm
<
MatrixType
,
CorrectionType
>
(
*
baseSolverStep
);
EnergyNorm
<
MatrixType
,
CorrectionType
>*
baseEnergyNorm
=
new
EnergyNorm
<
MatrixType
,
CorrectionType
>
(
*
baseSolverStep
);
IterativeSolver
<
CorrectionType
>*
baseSolver
LoopSolver
<
CorrectionType
>*
baseSolver
=
new
LoopSolver
<
CorrectionType
>
(
baseSolverStep
,
=
new
IterativeSolver
<
CorrectionType
>
(
baseSolverStep
,
baseIt_
,
baseIt_
,
baseTolerance_
,
baseTolerance_
,
baseEnergyNorm
,
baseEnergyNorm
,
Solver
::
QUIET
);
Solver
::
QUIET
);
// Make pre and postsmoothers
// Make pre and postsmoothers
TrustRegionGSStep
<
MatrixType
,
CorrectionType
>*
presmoother
=
new
TrustRegionGSStep
<
MatrixType
,
CorrectionType
>
;
TrustRegionGSStep
<
MatrixType
,
CorrectionType
>*
presmoother
=
new
TrustRegionGSStep
<
MatrixType
,
CorrectionType
>
;
...
@@ -111,7 +89,6 @@ void RodSolver<GridType>::setup(const GridType& grid,
...
@@ -111,7 +89,6 @@ void RodSolver<GridType>::setup(const GridType& grid,
mmgStep
->
postsmoother_
=
postsmoother
;
mmgStep
->
postsmoother_
=
postsmoother
;
mmgStep
->
obstacleRestrictor_
=
new
MandelObstacleRestrictor
<
CorrectionType
>
();
mmgStep
->
obstacleRestrictor_
=
new
MandelObstacleRestrictor
<
CorrectionType
>
();
mmgStep
->
hasObstacle_
=
&
hasObstacle_
;
mmgStep
->
hasObstacle_
=
&
hasObstacle_
;
mmgStep
->
obstacles_
=
&
trustRegionObstacles_
;
mmgStep
->
verbosity_
=
Solver
::
QUIET
;
mmgStep
->
verbosity_
=
Solver
::
QUIET
;
// //////////////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////
...
@@ -129,7 +106,7 @@ void RodSolver<GridType>::setup(const GridType& grid,
...
@@ -129,7 +106,7 @@ void RodSolver<GridType>::setup(const GridType& grid,
h1SemiNorm_
=
new
H1SemiNorm
<
CorrectionType
>
(
**
A
);
h1SemiNorm_
=
new
H1SemiNorm
<
CorrectionType
>
(
**
A
);
mmgSolver_
=
new
Iterative
Solver
<
CorrectionType
>
(
mmgStep
,
mmgSolver_
=
new
Loop
Solver
<
CorrectionType
>
(
mmgStep
,
multigridIterations_
,
multigridIterations_
,
qpTolerance_
,
qpTolerance_
,
h1SemiNorm_
,
h1SemiNorm_
,
...
@@ -159,11 +136,6 @@ void RodSolver<GridType>::setup(const GridType& grid,
...
@@ -159,11 +136,6 @@ void RodSolver<GridType>::setup(const GridType& grid,
for
(
int
i
=
0
;
i
<
hasObstacle_
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
hasObstacle_
.
size
();
i
++
)
hasObstacle_
[
i
].
resize
(
grid_
->
size
(
i
,
1
),
true
);
hasObstacle_
[
i
].
resize
(
grid_
->
size
(
i
,
1
),
true
);
trustRegionObstacles_
.
resize
(
numLevels
);
for
(
int
i
=
0
;
i
<
numLevels
;
i
++
)
trustRegionObstacles_
[
i
].
resize
(
grid_
->
size
(
i
,
1
));
// ////////////////////////////////////
// ////////////////////////////////////
// Create the transfer operators
// Create the transfer operators
// ////////////////////////////////////
// ////////////////////////////////////
...
@@ -183,10 +155,10 @@ void RodSolver<GridType>::setup(const GridType& grid,
...
@@ -183,10 +155,10 @@ void RodSolver<GridType>::setup(const GridType& grid,
template
<
class
GridType
>
template
<
class
GridType
>
void
RodSolver
<
GridType
>::
solve
()
void
RodSolver
<
GridType
>::
solve
()
{
{
using
namespace
Dune
;
MaxNormTrustRegion
<
blocksize
>
trustRegion
(
x_
.
size
(),
initialTrustRegionRadius_
);
double
trustRegionRadius
=
initialTrustRegionRadius_
;
std
::
vector
<
std
::
vector
<
BoxConstraint
<
field_type
,
blocksize
>
>
>
trustRegionObstacles
(
dynamic_cast
<
MultigridStep
<
MatrixType
,
CorrectionType
>*>
(
mmgSolver_
->
iterationStep_
)
->
numLevels_
);
// /////////////////////////////////////////////////////
// /////////////////////////////////////////////////////
// Set up the log file, if requested
// Set up the log file, if requested
// /////////////////////////////////////////////////////
// /////////////////////////////////////////////////////
...
@@ -195,7 +167,7 @@ void RodSolver<GridType>::solve()
...
@@ -195,7 +167,7 @@ void RodSolver<GridType>::solve()
fp
=
fopen
(
"statistics"
,
"w"
);
fp
=
fopen
(
"statistics"
,
"w"
);
if
(
!
fp
)
if
(
!
fp
)
DUNE_THROW
(
IOError
,
"Couldn't open statistics file for writing!"
);
DUNE_THROW
(
Dune
::
IOError
,
"Couldn't open statistics file for writing!"
);
}
}
...
@@ -207,7 +179,7 @@ void RodSolver<GridType>::solve()
...
@@ -207,7 +179,7 @@ void RodSolver<GridType>::solve()
if
(
this
->
verbosity_
==
FULL
)
{
if
(
this
->
verbosity_
==
FULL
)
{
std
::
cout
<<
"----------------------------------------------------"
<<
std
::
endl
;
std
::
cout
<<
"----------------------------------------------------"
<<
std
::
endl
;
std
::
cout
<<
" Trust-Region Step Number: "
<<
i
std
::
cout
<<
" Trust-Region Step Number: "
<<
i
<<
", radius: "
<<
trustRegion
R
adius
<<
", radius: "
<<
trustRegion
.
r
adius
()
<<
", energy: "
<<
rodAssembler_
->
computeEnergy
(
x_
)
<<
std
::
endl
;
<<
", energy: "
<<
rodAssembler_
->
computeEnergy
(
x_
)
<<
std
::
endl
;
std
::
cout
<<
"----------------------------------------------------"
<<
std
::
endl
;
std
::
cout
<<
"----------------------------------------------------"
<<
std
::
endl
;
}
}
...
@@ -225,11 +197,11 @@ void RodSolver<GridType>::solve()
...
@@ -225,11 +197,11 @@ void RodSolver<GridType>::solve()
rhs
*=
-
1
;
rhs
*=
-
1
;
// Create trust-region obstacle on maxlevel
setTrustRegionObstacles
(
trustRegionRadius
,
trustRegionObstacles_
[
grid_
->
maxLevel
()]);
dynamic_cast
<
MultigridStep
<
MatrixType
,
CorrectionType
>*>
(
mmgSolver_
->
iterationStep_
)
->
setProblem
(
*
hessianMatrix_
,
corr
,
rhs
,
grid_
->
maxLevel
()
+
1
);
dynamic_cast
<
MultigridStep
<
MatrixType
,
CorrectionType
>*>
(
mmgSolver_
->
iterationStep_
)
->
setProblem
(
*
hessianMatrix_
,
corr
,
rhs
,
grid_
->
maxLevel
()
+
1
);
trustRegionObstacles
.
back
()
=
trustRegion
.
obstacles
();
dynamic_cast
<
MonotoneMGStep
<
MatrixType
,
CorrectionType
>*>
(
mmgSolver_
->
iterationStep_
)
->
obstacles_
=
&
trustRegionObstacles
;
mmgSolver_
->
preprocess
();
mmgSolver_
->
preprocess
();
...
@@ -248,7 +220,7 @@ void RodSolver<GridType>::solve()
...
@@ -248,7 +220,7 @@ void RodSolver<GridType>::solve()
if
(
instrumented_
)
{
if
(
instrumented_
)
{
fprintf
(
fp
,
"Trust-region step: %d, trust-region radius: %g
\n
"
,
fprintf
(
fp
,
"Trust-region step: %d, trust-region radius: %g
\n
"
,
i
,
trustRegion
R
adius
);
i
,
trustRegion
.
r
adius
()
);
// ///////////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////////
// Compute and measure progress against the exact solution
// Compute and measure progress against the exact solution
...
@@ -276,7 +248,7 @@ void RodSolver<GridType>::solve()
...
@@ -276,7 +248,7 @@ void RodSolver<GridType>::solve()
FILE
*
fpInt
=
fopen
(
iSolFilename
,
"rb"
);
FILE
*
fpInt
=
fopen
(
iSolFilename
,
"rb"
);
if
(
!
fpInt
)
if
(
!
fpInt
)
DUNE_THROW
(
IOError
,
"Couldn't open intermediate solution"
);
DUNE_THROW
(
Dune
::
IOError
,
"Couldn't open intermediate solution"
);
for
(
int
k
=
0
;
k
<
intermediateSol
.
size
();
k
++
)
for
(
int
k
=
0
;
k
<
intermediateSol
.
size
();
k
++
)
for
(
int
l
=
0
;
l
<
blocksize
;
l
++
)
for
(
int
l
=
0
;
l
<
blocksize
;
l
++
)
fread
(
&
intermediateSol
[
k
][
l
],
sizeof
(
double
),
1
,
fpInt
);
fread
(
&
intermediateSol
[
k
][
l
],
sizeof
(
double
),
1
,
fpInt
);
...
@@ -396,7 +368,7 @@ void RodSolver<GridType>::solve()
...
@@ -396,7 +368,7 @@ void RodSolver<GridType>::solve()
// very successful iteration
// very successful iteration
x_
=
newIterate
;
x_
=
newIterate
;
trustRegion
Radius
*=
2
;
trustRegion
.
scale
(
2
)
;
}
else
if
(
(
oldEnergy
-
energy
)
/
modelDecrease
>
0.01
}
else
if
(
(
oldEnergy
-
energy
)
/
modelDecrease
>
0.01
||
std
::
abs
(
oldEnergy
-
energy
)
<
1e-12
)
{
||
std
::
abs
(
oldEnergy
-
energy
)
<
1e-12
)
{
...
@@ -405,7 +377,7 @@ void RodSolver<GridType>::solve()
...
@@ -405,7 +377,7 @@ void RodSolver<GridType>::solve()
}
else
{
}
else
{
// unsuccessful iteration
// unsuccessful iteration
trustRegion
Radius
/=
2
;
trustRegion
.
scale
(
0.5
)
;
if
(
this
->
verbosity_
==
FULL
)
if
(
this
->
verbosity_
==
FULL
)
std
::
cout
<<
"Unsuccessful iteration!"
<<
std
::
endl
;
std
::
cout
<<
"Unsuccessful iteration!"
<<
std
::
endl
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/rodsolver.hh
+
4
−
9
View file @
82c6b7a7
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
#include
<dune/ag-common/boxconstraint.hh>
#include
<dune/ag-common/boxconstraint.hh>
#include
<dune/ag-common/norms/h1seminorm.hh>
#include
<dune/ag-common/norms/h1seminorm.hh>
#include
<dune/ag-common/
iterative
solver.hh>
#include
<dune/ag-common/
solvers/loop
solver.hh>
#include
"rodassembler.hh"
#include
"rodassembler.hh"
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
/** \brief Riemannian trust-region solver for 3d Cosserat rod problems */
/** \brief Riemannian trust-region solver for 3d Cosserat rod problems */
template
<
class
GridType
>
template
<
class
GridType
>
class
RodSolver
:
public
Solver
class
RodSolver
:
public
IterativeSolver
<
std
::
vector
<
Configuration
>
,
Dune
::
BitSetVector
<
6
>
>
{
{
const
static
int
blocksize
=
6
;
const
static
int
blocksize
=
6
;
...
@@ -30,12 +30,10 @@ class RodSolver : public Solver
...
@@ -30,12 +30,10 @@ class RodSolver : public Solver
typedef
Dune
::
BlockVector
<
Dune
::
FieldVector
<
field_type
,
blocksize
>
>
CorrectionType
;
typedef
Dune
::
BlockVector
<
Dune
::
FieldVector
<
field_type
,
blocksize
>
>
CorrectionType
;
typedef
std
::
vector
<
Configuration
>
SolutionType
;
typedef
std
::
vector
<
Configuration
>
SolutionType
;
static
void
setTrustRegionObstacles
(
double
trustRegionRadius
,
std
::
vector
<
BoxConstraint
<
field_type
,
blocksize
>
>&
trustRegionObstacles
);
public:
public:
RodSolver
()
RodSolver
()
:
Solver
(
0
,
NumProc
::
FULL
),
:
IterativeSolver
<
std
::
vector
<
Configuration
>
,
Dune
::
BitSetVector
<
6
>
>
(
0
,
10
0
,
NumProc
::
FULL
),
hessianMatrix_
(
NULL
),
h1SemiNorm_
(
NULL
)
hessianMatrix_
(
NULL
),
h1SemiNorm_
(
NULL
)
{}
{}
...
@@ -104,10 +102,7 @@ protected:
...
@@ -104,10 +102,7 @@ protected:
const
RodAssembler
<
GridType
>*
rodAssembler_
;
const
RodAssembler
<
GridType
>*
rodAssembler_
;
/** \brief The multigrid solver */
/** \brief The multigrid solver */
IterativeSolver
<
CorrectionType
>*
mmgSolver_
;
LoopSolver
<
CorrectionType
>*
mmgSolver_
;
/** \brief The hierarchy of trust-region obstacles */
std
::
vector
<
std
::
vector
<
BoxConstraint
<
field_type
,
blocksize
>
>
>
trustRegionObstacles_
;
/** \brief Dummy fields containing 'true' everywhere. The multigrid step
/** \brief Dummy fields containing 'true' everywhere. The multigrid step
expects them :-( */
expects them :-( */
...
...
This diff is collapsed.
Click to expand it.
staticrod.cc
+
11
−
10
View file @
82c6b7a7
...
@@ -10,10 +10,11 @@
...
@@ -10,10 +10,11 @@
#include
<dune/ag-common/boundarypatch.hh>
#include
<dune/ag-common/boundarypatch.hh>
#include
<dune/ag-common/projectedblockgsstep.hh>
#include
<dune/ag-common/projectedblockgsstep.hh>
#include
<dune/ag-common/solvers/mmgstep.hh>
#include
<dune/ag-common/solvers/mmgstep.hh>
#include
<dune/ag-common/
iterative
solver.hh>
#include
<dune/ag-common/
solvers/loop
solver.hh>
#include
<dune/ag-common/geomestimator.hh>
#include
<dune/ag-common/geomestimator.hh>
#include
<dune/ag-common/norms/energynorm.hh>
#include
<dune/ag-common/norms/energynorm.hh>
#include
<dune/ag-common/contactobsrestrict.hh>
#include
<dune/ag-common/mandelobsrestrictor.hh>
#include
<dune/ag-common/transferoperators/truncatedcompressedmgtransfer.hh>
#include
"src/rodwriter.hh"
#include
"src/rodwriter.hh"
#include
"src/planarrodassembler.hh"
#include
"src/planarrodassembler.hh"
...
@@ -177,7 +178,7 @@ int main (int argc, char *argv[]) try
...
@@ -177,7 +178,7 @@ int main (int argc, char *argv[]) try
EnergyNorm
<
MatrixType
,
VectorType
>
baseEnergyNorm
(
baseSolverStep
);
EnergyNorm
<
MatrixType
,
VectorType
>
baseEnergyNorm
(
baseSolverStep
);
Iterative
Solver
<
VectorType
>
baseSolver
(
&
baseSolverStep
,
Loop
Solver
<
VectorType
>
baseSolver
(
&
baseSolverStep
,
baseIt
,
baseIt
,
baseTolerance
,
baseTolerance
,
&
baseEnergyNorm
,
&
baseEnergyNorm
,
...
@@ -196,23 +197,23 @@ int main (int argc, char *argv[]) try
...
@@ -196,23 +197,23 @@ int main (int argc, char *argv[]) try
multigridStep
.
postsmoother_
=
&
postsmoother
;
multigridStep
.
postsmoother_
=
&
postsmoother
;
multigridStep
.
hasObstacle_
=
&
hasObstacle
;
multigridStep
.
hasObstacle_
=
&
hasObstacle
;
multigridStep
.
obstacles_
=
&
trustRegionObstacles
;
multigridStep
.
obstacles_
=
&
trustRegionObstacles
;
multigridStep
.
obstacleRestrictor_
=
new
ContactObs
Restrict
ion
<
VectorType
>
;
multigridStep
.
obstacleRestrictor_
=
new
MandelObstacle
Restrict
or
<
VectorType
>
;
// Create the transfer operators
// Create the transfer operators
multigridStep
.
mgTransfer_
.
resize
(
maxlevel
);
multigridStep
.
mgTransfer_
.
resize
(
maxlevel
);
for
(
int
i
=
0
;
i
<
multigridStep
.
mgTransfer_
.
size
();
i
++
){
for
(
int
i
=
0
;
i
<
multigridStep
.
mgTransfer_
.
size
();
i
++
){
TruncatedMGTransfer
<
VectorType
>*
newTransferOp
=
new
TruncatedMGTransfer
<
VectorType
>
;
Truncated
Compressed
MGTransfer
<
VectorType
>*
newTransferOp
=
new
Truncated
Compressed
MGTransfer
<
VectorType
>
;
newTransferOp
->
setup
(
rod
,
i
,
i
+
1
);
newTransferOp
->
setup
(
rod
,
i
,
i
+
1
);
multigridStep
.
mgTransfer_
[
i
]
=
newTransferOp
;
multigridStep
.
mgTransfer_
[
i
]
=
newTransferOp
;
}
}
EnergyNorm
<
MatrixType
,
VectorType
>
energyNorm
(
multigridStep
);
EnergyNorm
<
MatrixType
,
VectorType
>
energyNorm
(
multigridStep
);
Iterative
Solver
<
VectorType
>
solver
(
&
multigridStep
,
Loop
Solver
<
VectorType
>
solver
(
&
multigridStep
,
numIt
,
numIt
,
tolerance
,
tolerance
,
&
energyNorm
,
&
energyNorm
,
Solver
::
QUIET
);
Solver
::
QUIET
);
// ///////////////////////////////////////////////////
// ///////////////////////////////////////////////////
// Do a homotopy of the material parameters
// Do a homotopy of the material parameters
...
...
This diff is collapsed.
Click to expand it.
staticrod2.cc
+
7
−
6
View file @
82c6b7a7
...
@@ -12,10 +12,11 @@
...
@@ -12,10 +12,11 @@
#include
<dune/ag-common/boundarypatch.hh>
#include
<dune/ag-common/boundarypatch.hh>
#include
<dune/ag-common/projectedblockgsstep.hh>
#include
<dune/ag-common/projectedblockgsstep.hh>
#include
<dune/ag-common/solvers/mmgstep.hh>
#include
<dune/ag-common/solvers/mmgstep.hh>
#include
<dune/ag-common/
iterative
solver.hh>
#include
<dune/ag-common/
solvers/loop
solver.hh>
#include
<dune/ag-common/geomestimator.hh>
#include
<dune/ag-common/geomestimator.hh>
#include
<dune/ag-common/norms/energynorm.hh>
#include
<dune/ag-common/norms/energynorm.hh>
#include
<dune/ag-common/contactobsrestrict.hh>
#include
<dune/ag-common/mandelobsrestrictor.hh>
#include
<dune/ag-common/transferoperators/truncatedcompressedmgtransfer.hh>
#include
"src/rodwriter.hh"
#include
"src/rodwriter.hh"
#include
"src/planarrodassembler.hh"
#include
"src/planarrodassembler.hh"
...
@@ -111,7 +112,7 @@ int main (int argc, char *argv[]) try
...
@@ -111,7 +112,7 @@ int main (int argc, char *argv[]) try
EnergyNorm
<
MatrixType
,
VectorType
>
baseEnergyNorm
(
baseSolverStep
);
EnergyNorm
<
MatrixType
,
VectorType
>
baseEnergyNorm
(
baseSolverStep
);
Iterative
Solver
<
VectorType
>
baseSolver
(
&
baseSolverStep
,
Loop
Solver
<
VectorType
>
baseSolver
(
&
baseSolverStep
,
baseIt
,
baseIt
,
baseTolerance
,
baseTolerance
,
&
baseEnergyNorm
,
&
baseEnergyNorm
,
...
@@ -131,12 +132,12 @@ int main (int argc, char *argv[]) try
...
@@ -131,12 +132,12 @@ int main (int argc, char *argv[]) try
multigridStep
.
hasObstacle_
=
&
hasObstacle
;
multigridStep
.
hasObstacle_
=
&
hasObstacle
;
multigridStep
.
obstacles_
=
&
trustRegionObstacles
;
multigridStep
.
obstacles_
=
&
trustRegionObstacles
;
multigridStep
.
verbosity_
=
Solver
::
QUIET
;
multigridStep
.
verbosity_
=
Solver
::
QUIET
;
multigridStep
.
obstacleRestrictor_
=
new
ContactObs
Restrict
ion
<
VectorType
>
;
multigridStep
.
obstacleRestrictor_
=
new
MandelObstacle
Restrict
or
<
VectorType
>
;
EnergyNorm
<
MatrixType
,
VectorType
>
energyNorm
(
multigridStep
);
EnergyNorm
<
MatrixType
,
VectorType
>
energyNorm
(
multigridStep
);
Iterative
Solver
<
VectorType
>
solver
(
&
multigridStep
,
Loop
Solver
<
VectorType
>
solver
(
&
multigridStep
,
numIt
,
numIt
,
tolerance
,
tolerance
,
&
energyNorm
,
&
energyNorm
,
...
@@ -231,7 +232,7 @@ int main (int argc, char *argv[]) try
...
@@ -231,7 +232,7 @@ int main (int argc, char *argv[]) try
multigridStep
.
mgTransfer_
.
resize
(
toplevel
);
multigridStep
.
mgTransfer_
.
resize
(
toplevel
);
for
(
int
i
=
0
;
i
<
multigridStep
.
mgTransfer_
.
size
();
i
++
){
for
(
int
i
=
0
;
i
<
multigridStep
.
mgTransfer_
.
size
();
i
++
){
TruncatedMGTransfer
<
VectorType
>*
newTransferOp
=
new
TruncatedMGTransfer
<
VectorType
>
;
Truncated
Compressed
MGTransfer
<
VectorType
>*
newTransferOp
=
new
Truncated
Compressed
MGTransfer
<
VectorType
>
;
newTransferOp
->
setup
(
grid
,
i
,
i
+
1
);
newTransferOp
->
setup
(
grid
,
i
,
i
+
1
);
multigridStep
.
mgTransfer_
[
i
]
=
newTransferOp
;
multigridStep
.
mgTransfer_
[
i
]
=
newTransferOp
;
}
}
...
...
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