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
c18edd26
Commit
c18edd26
authored
15 years ago
by
Oliver Sander
Committed by
sander@PCPOOL.MI.FU-BERLIN.DE
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
make the convergence measuring code compile
[[Imported from SVN: r4031]]
parent
7618fbe0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
harmonicmaps.cc
+12
-15
12 additions, 15 deletions
harmonicmaps.cc
with
12 additions
and
15 deletions
harmonicmaps.cc
+
12
−
15
View file @
c18edd26
...
...
@@ -9,7 +9,7 @@
#include
<dune-solvers/solvers/iterativesolver.hh>
#include
<dune-solvers/norms/energynorm.hh>
#include
"src/
rod
difference.hh"
#include
"src/
geodesic
difference.hh"
#include
"src/rodwriter.hh"
#include
"src/rotation.hh"
#include
"src/geodesicfeassembler.hh"
...
...
@@ -133,7 +133,6 @@ int main (int argc, char *argv[]) try
writeRod(x, resultPath + "rod3d.result");
#endif
#if 0
// //////////////////////////////////////////////////////////
// Recompute and compare against exact solution
// //////////////////////////////////////////////////////////
...
...
@@ -145,11 +144,11 @@ int main (int argc, char *argv[]) try
// for use of the energy norm it creates.
// //////////////////////////////////////////////////////////
BCRSMatrix<FieldMatrix<double,
6, 6
> > hessian;
MatrixIndexSet indices(exactSolution.size(), exactSolution.size());
rodA
ssembler.getNeighborsPerVertex(indices);
indices.exportIdx(hessian);
rodA
ssembler.assembleMatrix
FD
(exactSolution, hessian);
BCRSMatrix
<
FieldMatrix
<
double
,
blocksize
,
blocksize
>
>
hessian
;
//
MatrixIndexSet indices(exactSolution.size(), exactSolution.size());
//
a
ssembler.getNeighborsPerVertex(indices);
//
indices.exportIdx(hessian);
a
ssembler
.
assembleMatrix
(
exactSolution
,
hessian
);
double
error
=
std
::
numeric_limits
<
double
>::
max
();
...
...
@@ -160,9 +159,9 @@ int main (int argc, char *argv[]) try
std
::
ofstream
statisticsFile
((
resultPath
+
"trStatistics"
).
c_str
());
// Compute error of the initial iterate
typedef BlockVector<FieldVector<double,
6
> >
Rod
DifferenceType;
Rod
DifferenceType
rod
Difference = compute
Rod
Difference(exactSolution, initialIterate);
double oldError = std::sqrt(
compute
EnergyNorm
Squared(rod
Difference, hessian));
typedef
BlockVector
<
FieldVector
<
double
,
blocksize
>
>
DifferenceType
;
DifferenceType
geodesic
Difference
=
compute
Geodesic
Difference
(
exactSolution
,
initialIterate
);
double
oldError
=
std
::
sqrt
(
EnergyNorm
<
BCRSMatrix
<
FieldMatrix
<
double
,
blocksize
,
blocksize
>
>
,
BlockVector
<
FieldVector
<
double
,
blocksize
>
>
>::
normSquared
(
geodesic
Difference
,
hessian
));
int
i
;
for
(
i
=
0
;
i
<
maxTrustRegionSteps
;
i
++
)
{
...
...
@@ -177,8 +176,7 @@ int main (int argc, char *argv[]) try
if
(
!
fp
)
DUNE_THROW
(
IOError
,
"Couldn't open intermediate solution '"
<<
iSolFilename
<<
"'"
);
for
(
int
j
=
0
;
j
<
intermediateSolution
.
size
();
j
++
)
{
fread(&intermediateSolution[j].r, sizeof(double), 3, fp);
fread(&intermediateSolution[j].q, sizeof(double), 4, fp);
fread
(
&
intermediateSolution
[
j
],
sizeof
(
double
),
4
,
fp
);
}
fclose
(
fp
);
...
...
@@ -187,9 +185,9 @@ int main (int argc, char *argv[]) try
// Compute error
// /////////////////////////////////////////////////////
rod
Difference = compute
Rod
Difference(exactSolution, intermediateSolution);
geodesic
Difference
=
compute
Geodesic
Difference
(
exactSolution
,
intermediateSolution
);
error = std::sqrt(
compute
EnergyNorm
Squared(rod
Difference, hessian));
error
=
std
::
sqrt
(
EnergyNorm
<
BCRSMatrix
<
FieldMatrix
<
double
,
blocksize
,
blocksize
>
>
,
BlockVector
<
FieldVector
<
double
,
blocksize
>
>
>::
normSquared
(
geodesic
Difference
,
hessian
));
double
convRate
=
error
/
oldError
;
...
...
@@ -205,7 +203,6 @@ int main (int argc, char *argv[]) try
oldError
=
error
;
}
#endif
// //////////////////////////////
}
catch
(
Exception
e
)
{
...
...
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