Skip to content
Snippets Groups Projects
Commit c18edd26 authored by Oliver Sander's avatar Oliver Sander Committed by sander@PCPOOL.MI.FU-BERLIN.DE
Browse files

make the convergence measuring code compile

[[Imported from SVN: r4031]]
parent 7618fbe0
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <dune-solvers/solvers/iterativesolver.hh> #include <dune-solvers/solvers/iterativesolver.hh>
#include <dune-solvers/norms/energynorm.hh> #include <dune-solvers/norms/energynorm.hh>
#include "src/roddifference.hh" #include "src/geodesicdifference.hh"
#include "src/rodwriter.hh" #include "src/rodwriter.hh"
#include "src/rotation.hh" #include "src/rotation.hh"
#include "src/geodesicfeassembler.hh" #include "src/geodesicfeassembler.hh"
...@@ -133,7 +133,6 @@ int main (int argc, char *argv[]) try ...@@ -133,7 +133,6 @@ int main (int argc, char *argv[]) try
writeRod(x, resultPath + "rod3d.result"); writeRod(x, resultPath + "rod3d.result");
#endif #endif
#if 0
// ////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////
// Recompute and compare against exact solution // Recompute and compare against exact solution
// ////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////
...@@ -145,11 +144,11 @@ int main (int argc, char *argv[]) try ...@@ -145,11 +144,11 @@ int main (int argc, char *argv[]) try
// for use of the energy norm it creates. // for use of the energy norm it creates.
// ////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////
BCRSMatrix<FieldMatrix<double, 6, 6> > hessian; BCRSMatrix<FieldMatrix<double, blocksize, blocksize> > hessian;
MatrixIndexSet indices(exactSolution.size(), exactSolution.size()); // MatrixIndexSet indices(exactSolution.size(), exactSolution.size());
rodAssembler.getNeighborsPerVertex(indices); // assembler.getNeighborsPerVertex(indices);
indices.exportIdx(hessian); // indices.exportIdx(hessian);
rodAssembler.assembleMatrixFD(exactSolution, hessian); assembler.assembleMatrix(exactSolution, hessian);
double error = std::numeric_limits<double>::max(); double error = std::numeric_limits<double>::max();
...@@ -160,9 +159,9 @@ int main (int argc, char *argv[]) try ...@@ -160,9 +159,9 @@ int main (int argc, char *argv[]) try
std::ofstream statisticsFile((resultPath + "trStatistics").c_str()); std::ofstream statisticsFile((resultPath + "trStatistics").c_str());
// Compute error of the initial iterate // Compute error of the initial iterate
typedef BlockVector<FieldVector<double,6> > RodDifferenceType; typedef BlockVector<FieldVector<double,blocksize> > DifferenceType;
RodDifferenceType rodDifference = computeRodDifference(exactSolution, initialIterate); DifferenceType geodesicDifference = computeGeodesicDifference(exactSolution, initialIterate);
double oldError = std::sqrt(computeEnergyNormSquared(rodDifference, hessian)); double oldError = std::sqrt(EnergyNorm<BCRSMatrix<FieldMatrix<double, blocksize, blocksize> >, BlockVector<FieldVector<double,blocksize> > >::normSquared(geodesicDifference, hessian));
int i; int i;
for (i=0; i<maxTrustRegionSteps; i++) { for (i=0; i<maxTrustRegionSteps; i++) {
...@@ -177,8 +176,7 @@ int main (int argc, char *argv[]) try ...@@ -177,8 +176,7 @@ int main (int argc, char *argv[]) try
if (!fp) if (!fp)
DUNE_THROW(IOError, "Couldn't open intermediate solution '" << iSolFilename << "'"); DUNE_THROW(IOError, "Couldn't open intermediate solution '" << iSolFilename << "'");
for (int j=0; j<intermediateSolution.size(); j++) { for (int j=0; j<intermediateSolution.size(); j++) {
fread(&intermediateSolution[j].r, sizeof(double), 3, fp); fread(&intermediateSolution[j], sizeof(double), 4, fp);
fread(&intermediateSolution[j].q, sizeof(double), 4, fp);
} }
fclose(fp); fclose(fp);
...@@ -187,9 +185,9 @@ int main (int argc, char *argv[]) try ...@@ -187,9 +185,9 @@ int main (int argc, char *argv[]) try
// Compute error // Compute error
// ///////////////////////////////////////////////////// // /////////////////////////////////////////////////////
rodDifference = computeRodDifference(exactSolution, intermediateSolution); geodesicDifference = computeGeodesicDifference(exactSolution, intermediateSolution);
error = std::sqrt(computeEnergyNormSquared(rodDifference, hessian)); error = std::sqrt(EnergyNorm<BCRSMatrix<FieldMatrix<double, blocksize, blocksize> >, BlockVector<FieldVector<double,blocksize> > >::normSquared(geodesicDifference, hessian));
double convRate = error / oldError; double convRate = error / oldError;
...@@ -205,7 +203,6 @@ int main (int argc, char *argv[]) try ...@@ -205,7 +203,6 @@ int main (int argc, char *argv[]) try
oldError = error; oldError = error;
} }
#endif
// ////////////////////////////// // //////////////////////////////
} catch (Exception e) { } catch (Exception e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment