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
45039213
Commit
45039213
authored
13 years ago
by
Oliver Sander
Committed by
sander@FU-BERLIN.DE
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add support for third-order Lagrange spaces
[[Imported from SVN: r8234]]
parent
021419ac
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/gfe/riemanniantrsolver.cc
+15
-19
15 additions, 19 deletions
dune/gfe/riemanniantrsolver.cc
dune/gfe/riemanniantrsolver.hh
+12
-10
12 additions, 10 deletions
dune/gfe/riemanniantrsolver.hh
with
27 additions
and
29 deletions
dune/gfe/riemanniantrsolver.cc
+
15
−
19
View file @
45039213
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
#include
<dune/solvers/iterationsteps/trustregiongsstep.hh>
#include
<dune/solvers/iterationsteps/trustregiongsstep.hh>
#include
<dune/solvers/iterationsteps/mmgstep.hh>
#include
<dune/solvers/iterationsteps/mmgstep.hh>
#include
<dune/solvers/transferoperators/truncatedcompressedmgtransfer.hh>
#include
<dune/solvers/transferoperators/truncatedcompressedmgtransfer.hh>
#ifdef
HIGHER
_ORDER
#if
def
ined THIRD_ORDER || defined SECOND
_ORDER
#include
<dune/
solvers/transferoperators
/p
2
top1mgtransfer.hh>
#include
<dune/
gfe
/p
k
top1mgtransfer.hh>
#endif
#endif
#include
<dune/solvers/transferoperators/mandelobsrestrictor.hh>
#include
<dune/solvers/transferoperators/mandelobsrestrictor.hh>
#include
<dune/solvers/solvers/iterativesolver.hh>
#include
<dune/solvers/solvers/iterativesolver.hh>
...
@@ -26,11 +26,7 @@
...
@@ -26,11 +26,7 @@
template
<
class
GridType
,
class
TargetSpace
>
template
<
class
GridType
,
class
TargetSpace
>
void
RiemannianTrustRegionSolver
<
GridType
,
TargetSpace
>::
void
RiemannianTrustRegionSolver
<
GridType
,
TargetSpace
>::
setup
(
const
GridType
&
grid
,
setup
(
const
GridType
&
grid
,
#ifdef HIGHER_ORDER
const
GeodesicFEAssembler
<
BasisType
,
TargetSpace
>*
assembler
,
const
GeodesicFEAssembler
<
P2NodalBasis
<
typename
GridType
::
LeafGridView
,
double
>
,
TargetSpace
>*
assembler
,
#else
const
GeodesicFEAssembler
<
P1NodalBasis
<
typename
GridType
::
LeafGridView
,
double
>
,
TargetSpace
>*
assembler
,
#endif
const
SolutionType
&
x
,
const
SolutionType
&
x
,
const
Dune
::
BitSetVector
<
blocksize
>&
dirichletNodes
,
const
Dune
::
BitSetVector
<
blocksize
>&
dirichletNodes
,
double
tolerance
,
double
tolerance
,
...
@@ -98,11 +94,11 @@ setup(const GridType& grid,
...
@@ -98,11 +94,11 @@ setup(const GridType& grid,
// //////////////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////
// Assemble a Laplace matrix to create a norm that's equivalent to the H1-norm
// Assemble a Laplace matrix to create a norm that's equivalent to the H1-norm
// //////////////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////
typedef
P1NodalBasis
<
typename
GridType
::
LeafGridView
,
double
>
FE
Basis
;
typedef
P1NodalBasis
<
typename
GridType
::
LeafGridView
,
double
>
P1
Basis
;
FE
Basis
b
asis
(
grid
.
leafView
());
P1
Basis
p1B
asis
(
grid
.
leafView
());
OperatorAssembler
<
FE
Basis
,
FE
Basis
>
operatorAssembler
(
b
asis
,
b
asis
);
OperatorAssembler
<
P1
Basis
,
P1
Basis
>
operatorAssembler
(
p1B
asis
,
p1B
asis
);
LaplaceAssembler
<
GridType
,
typename
FE
Basis
::
LocalFiniteElement
,
typename
FE
Basis
::
LocalFiniteElement
>
laplaceStiffness
;
LaplaceAssembler
<
GridType
,
typename
P1
Basis
::
LocalFiniteElement
,
typename
P1
Basis
::
LocalFiniteElement
>
laplaceStiffness
;
typedef
Dune
::
BCRSMatrix
<
Dune
::
FieldMatrix
<
double
,
1
,
1
>
>
ScalarMatrixType
;
typedef
Dune
::
BCRSMatrix
<
Dune
::
FieldMatrix
<
double
,
1
,
1
>
>
ScalarMatrixType
;
ScalarMatrixType
*
A
=
new
ScalarMatrixType
;
ScalarMatrixType
*
A
=
new
ScalarMatrixType
;
...
@@ -138,11 +134,9 @@ setup(const GridType& grid,
...
@@ -138,11 +134,9 @@ setup(const GridType& grid,
// //////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////
hasObstacle_
.
resize
(
numLevels
);
hasObstacle_
.
resize
(
numLevels
);
#ifdef HIGHER_ORDER
#if defined THIRD_ORDER || defined SECOND_ORDER
P2NodalBasis
<
typename
GridType
::
LeafGridView
,
double
>
p2Basis
(
grid_
->
leafView
());
BasisType
basis
(
grid_
->
leafView
());
P1NodalBasis
<
typename
GridType
::
LeafGridView
,
double
>
p1Basis
(
grid_
->
leafView
());
hasObstacle_
.
back
().
resize
(
basis
.
size
(),
true
);
hasObstacle_
.
back
().
resize
(
p2Basis
.
size
(),
true
);
for
(
int
i
=
0
;
i
<
hasObstacle_
.
size
()
-
1
;
i
++
)
for
(
int
i
=
0
;
i
<
hasObstacle_
.
size
()
-
1
;
i
++
)
hasObstacle_
[
i
].
resize
(
grid_
->
size
(
i
+
1
,
gridDim
),
true
);
hasObstacle_
[
i
].
resize
(
grid_
->
size
(
i
+
1
,
gridDim
),
true
);
...
@@ -159,10 +153,12 @@ setup(const GridType& grid,
...
@@ -159,10 +153,12 @@ setup(const GridType& grid,
mmgStep
->
mgTransfer_
.
resize
(
numLevels
-
1
);
mmgStep
->
mgTransfer_
.
resize
(
numLevels
-
1
);
#ifdef
HIGHER
_ORDER
#if
def
ined THIRD_ORDER || defined SECOND
_ORDER
if
(
numLevels
>
1
)
{
if
(
numLevels
>
1
)
{
P2toP1MGTransfer
<
CorrectionType
>*
topTransferOp
=
new
P2toP1MGTransfer
<
CorrectionType
>
;
P1NodalBasis
<
typename
GridType
::
LeafGridView
,
double
>
p1Basis
(
grid_
->
leafView
());
topTransferOp
->
setup
(
p2Basis
,
p1Basis
);
PKtoP1MGTransfer
<
CorrectionType
>*
topTransferOp
=
new
PKtoP1MGTransfer
<
CorrectionType
>
;
topTransferOp
->
setup
(
basis
,
p1Basis
);
mmgStep
->
mgTransfer_
.
back
()
=
topTransferOp
;
mmgStep
->
mgTransfer_
.
back
()
=
topTransferOp
;
for
(
int
i
=
0
;
i
<
mmgStep
->
mgTransfer_
.
size
()
-
1
;
i
++
){
for
(
int
i
=
0
;
i
<
mmgStep
->
mgTransfer_
.
size
()
-
1
;
i
++
){
...
...
This diff is collapsed.
Click to expand it.
dune/gfe/riemanniantrsolver.hh
+
12
−
10
View file @
45039213
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
#include
<dune/solvers/solvers/loopsolver.hh>
#include
<dune/solvers/solvers/loopsolver.hh>
#include
<dune/fufem/functionspacebases/p1nodalbasis.hh>
#include
<dune/fufem/functionspacebases/p1nodalbasis.hh>
#include
<dune/fufem/functionspacebases/p2nodalbasis.hh>
#include
<dune/fufem/functionspacebases/p3nodalbasis.hh>
#include
"geodesicfeassembler.hh"
#include
"geodesicfeassembler.hh"
...
@@ -35,6 +37,14 @@ class RiemannianTrustRegionSolver
...
@@ -35,6 +37,14 @@ class RiemannianTrustRegionSolver
typedef
Dune
::
BlockVector
<
Dune
::
FieldVector
<
field_type
,
blocksize
>
>
CorrectionType
;
typedef
Dune
::
BlockVector
<
Dune
::
FieldVector
<
field_type
,
blocksize
>
>
CorrectionType
;
typedef
std
::
vector
<
TargetSpace
>
SolutionType
;
typedef
std
::
vector
<
TargetSpace
>
SolutionType
;
#ifdef THIRD_ORDER
typedef
P3NodalBasis
<
typename
GridType
::
LeafGridView
,
double
>
BasisType
;
#elif defined SECOND_ORDER
typedef
P2NodalBasis
<
typename
GridType
::
LeafGridView
,
double
>
BasisType
;
#else
typedef
P1NodalBasis
<
typename
GridType
::
LeafGridView
,
double
>
BasisType
;
#endif
public:
public:
RiemannianTrustRegionSolver
()
RiemannianTrustRegionSolver
()
...
@@ -44,11 +54,7 @@ public:
...
@@ -44,11 +54,7 @@ public:
/** \brief Set up the solver using a monotone multigrid method as the inner solver */
/** \brief Set up the solver using a monotone multigrid method as the inner solver */
void
setup
(
const
GridType
&
grid
,
void
setup
(
const
GridType
&
grid
,
#ifdef HIGHER_ORDER
const
GeodesicFEAssembler
<
BasisType
,
TargetSpace
>*
assembler
,
const
GeodesicFEAssembler
<
P2NodalBasis
<
typename
GridType
::
LeafGridView
,
double
>
,
TargetSpace
>*
assembler
,
#else
const
GeodesicFEAssembler
<
P1NodalBasis
<
typename
GridType
::
LeafGridView
,
double
>
,
TargetSpace
>*
assembler
,
#endif
const
SolutionType
&
x
,
const
SolutionType
&
x
,
const
Dune
::
BitSetVector
<
blocksize
>&
dirichletNodes
,
const
Dune
::
BitSetVector
<
blocksize
>&
dirichletNodes
,
double
tolerance
,
double
tolerance
,
...
@@ -103,11 +109,7 @@ protected:
...
@@ -103,11 +109,7 @@ protected:
std
::
auto_ptr
<
MatrixType
>
hessianMatrix_
;
std
::
auto_ptr
<
MatrixType
>
hessianMatrix_
;
/** \brief The assembler for the material law */
/** \brief The assembler for the material law */
#ifdef HIGHER_ORDER
const
GeodesicFEAssembler
<
BasisType
,
TargetSpace
>*
assembler_
;
const
GeodesicFEAssembler
<
P2NodalBasis
<
typename
GridType
::
LeafGridView
,
double
>
,
TargetSpace
>*
assembler_
;
#else
const
GeodesicFEAssembler
<
P1NodalBasis
<
typename
GridType
::
LeafGridView
,
double
>
,
TargetSpace
>*
assembler_
;
#endif
/** \brief The solver for the quadratic inner problems */
/** \brief The solver for the quadratic inner problems */
std
::
shared_ptr
<
Solver
>
innerSolver_
;
std
::
shared_ptr
<
Solver
>
innerSolver_
;
...
...
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