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
66383a0f
Commit
66383a0f
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
bugfix: compute matrix occupation pattern on demand
[[Imported from SVN: r4063]]
parent
9f899f20
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/geodesicfeassembler.hh
+12
-5
12 additions, 5 deletions
src/geodesicfeassembler.hh
src/riemanniantrsolver.cc
+6
-12
6 additions, 12 deletions
src/riemanniantrsolver.cc
with
18 additions
and
17 deletions
src/geodesicfeassembler.hh
+
12
−
5
View file @
66383a0f
...
...
@@ -43,7 +43,8 @@ public:
/** \brief Assemble the tangent stiffness matrix
*/
virtual
void
assembleMatrix
(
const
std
::
vector
<
TargetSpace
>&
sol
,
Dune
::
BCRSMatrix
<
MatrixBlock
>&
matrix
)
const
;
Dune
::
BCRSMatrix
<
MatrixBlock
>&
matrix
,
bool
computeOccupationPattern
=
true
)
const
;
/** \brief Assemble the gradient */
virtual
void
assembleGradient
(
const
std
::
vector
<
TargetSpace
>&
sol
,
...
...
@@ -94,13 +95,19 @@ getNeighborsPerVertex(Dune::MatrixIndexSet& nb) const
template
<
class
GridView
,
class
TargetSpace
>
void
GeodesicFEAssembler
<
GridView
,
TargetSpace
>::
assembleMatrix
(
const
std
::
vector
<
TargetSpace
>&
sol
,
Dune
::
BCRSMatrix
<
MatrixBlock
>&
matrix
)
const
Dune
::
BCRSMatrix
<
MatrixBlock
>&
matrix
,
bool
computeOccupationPattern
)
const
{
const
typename
GridView
::
IndexSet
&
indexSet
=
gridView_
.
indexSet
();
Dune
::
MatrixIndexSet
neighborsPerVertex
;
getNeighborsPerVertex
(
neighborsPerVertex
);
if
(
computeOccupationPattern
)
{
Dune
::
MatrixIndexSet
neighborsPerVertex
;
getNeighborsPerVertex
(
neighborsPerVertex
);
neighborsPerVertex
.
exportIdx
(
matrix
);
}
matrix
=
0
;
ElementIterator
it
=
gridView_
.
template
begin
<
0
>();
...
...
This diff is collapsed.
Click to expand it.
src/riemanniantrsolver.cc
+
6
−
12
View file @
66383a0f
...
...
@@ -183,7 +183,10 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve()
corr
=
0
;
assembler_
->
assembleGradient
(
x_
,
rhs
);
assembler_
->
assembleMatrix
(
x_
,
*
hessianMatrix_
);
assembler_
->
assembleMatrix
(
x_
,
*
hessianMatrix_
,
i
==
0
// assemble occupation pattern only for the first call
);
//gradientFDCheck(x_, rhs, *rodAssembler_);
//hessianFDCheck(x_, *hessianMatrix_, *rodAssembler_);
...
...
@@ -278,17 +281,8 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve()
}
if
(
this
->
verbosity_
==
NumProc
::
FULL
)
{
double
translationMax
=
0
;
double
rotationMax
=
0
;
for
(
size_t
j
=
0
;
j
<
corr
.
size
();
j
++
)
{
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
translationMax
=
std
::
max
(
translationMax
,
corr
[
j
][
k
]);
rotationMax
=
std
::
max
(
rotationMax
,
corr
[
j
][
k
+
3
]);
}
}
printf
(
"infinity norm of the correction: %g %g
\n
"
,
translationMax
,
rotationMax
);
}
if
(
this
->
verbosity_
==
NumProc
::
FULL
)
std
::
cout
<<
"Infinity norm of the correction: "
<<
corr
.
infinity_norm
()
<<
std
::
endl
;
if
(
corr
.
infinity_norm
()
<
this
->
tolerance_
)
{
if
(
this
->
verbosity_
==
NumProc
::
FULL
)
...
...
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