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

adapt to the new template parameters of the Rotation/RigidBodyMotion classes

[[Imported from SVN: r8206]]
parent bb5c4885
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <dune/gfe/rodassembler.hh> #include <dune/gfe/rodassembler.hh>
#include <dune/gfe/riemanniantrsolver.hh> #include <dune/gfe/riemanniantrsolver.hh>
typedef RigidBodyMotion<3> TargetSpace; typedef RigidBodyMotion<double,3> TargetSpace;
const int blocksize = TargetSpace::TangentVector::dimension; const int blocksize = TargetSpace::TangentVector::dimension;
...@@ -28,7 +28,7 @@ using std::string; ...@@ -28,7 +28,7 @@ using std::string;
int main (int argc, char *argv[]) try int main (int argc, char *argv[]) try
{ {
typedef std::vector<RigidBodyMotion<3> > SolutionType; typedef std::vector<RigidBodyMotion<double,3> > SolutionType;
// parse data file // parse data file
ParameterTree parameterSet; ParameterTree parameterSet;
...@@ -78,7 +78,7 @@ int main (int argc, char *argv[]) try ...@@ -78,7 +78,7 @@ int main (int argc, char *argv[]) try
x[i].r[0] = 0; x[i].r[0] = 0;
x[i].r[1] = 0; x[i].r[1] = 0;
x[i].r[2] = double(i)/(x.size()-1); x[i].r[2] = double(i)/(x.size()-1);
x[i].q = Rotation<3,double>::identity(); x[i].q = Rotation<double,3>::identity();
} }
// ///////////////////////////////////////// // /////////////////////////////////////////
...@@ -94,7 +94,7 @@ int main (int argc, char *argv[]) try ...@@ -94,7 +94,7 @@ int main (int argc, char *argv[]) try
axis[2] = parameterSet.get<double>("dirichletAxisZ"); axis[2] = parameterSet.get<double>("dirichletAxisZ");
double angle = parameterSet.get<double>("dirichletAngle"); double angle = parameterSet.get<double>("dirichletAngle");
x.back().q = Rotation<3,double>(axis, M_PI*angle/180); x.back().q = Rotation<double,3>(axis, M_PI*angle/180);
// backup for error measurement later // backup for error measurement later
SolutionType initialIterate = x; SolutionType initialIterate = x;
...@@ -124,7 +124,7 @@ int main (int argc, char *argv[]) try ...@@ -124,7 +124,7 @@ int main (int argc, char *argv[]) try
RodAssembler<GridType::LeafGridView,3> rodAssembler(grid.leafView(), &localStiffness); RodAssembler<GridType::LeafGridView,3> rodAssembler(grid.leafView(), &localStiffness);
RiemannianTrustRegionSolver<GridType,RigidBodyMotion<3> > rodSolver; RiemannianTrustRegionSolver<GridType,RigidBodyMotion<double,3> > rodSolver;
#if 1 #if 1
rodSolver.setup(grid, rodSolver.setup(grid,
&rodAssembler, &rodAssembler,
......
...@@ -71,7 +71,7 @@ int main (int argc, char *argv[]) try ...@@ -71,7 +71,7 @@ int main (int argc, char *argv[]) try
// Some types that I need // Some types that I need
typedef BCRSMatrix<FieldMatrix<double, blocksize, blocksize> > MatrixType; typedef BCRSMatrix<FieldMatrix<double, blocksize, blocksize> > MatrixType;
typedef BlockVector<FieldVector<double, blocksize> > CorrectionType; typedef BlockVector<FieldVector<double, blocksize> > CorrectionType;
typedef std::vector<RigidBodyMotion<2> > SolutionType; typedef std::vector<RigidBodyMotion<double,2> > SolutionType;
// parse data file // parse data file
ParameterTree parameterSet; ParameterTree parameterSet;
...@@ -155,7 +155,7 @@ int main (int argc, char *argv[]) try ...@@ -155,7 +155,7 @@ int main (int argc, char *argv[]) try
for (int i=0; i<x.size(); i++) { for (int i=0; i<x.size(); i++) {
x[i].r[0] = 0; x[i].r[0] = 0;
x[i].r[1] = i;//double(i)/(x.size()-1); x[i].r[1] = i;//double(i)/(x.size()-1);
x[i].q = Rotation<2,double>::identity(); x[i].q = Rotation<double,2>::identity();
} }
x.back().r[1] += 1; x.back().r[1] += 1;
...@@ -293,7 +293,7 @@ int main (int argc, char *argv[]) try ...@@ -293,7 +293,7 @@ int main (int argc, char *argv[]) try
SolutionType newIterate = x; SolutionType newIterate = x;
for (int j=0; j<newIterate.size(); j++) for (int j=0; j<newIterate.size(); j++)
newIterate[j] = RigidBodyMotion<2>::exp(newIterate[j], corr[j]); newIterate[j] = RigidBodyMotion<double,2>::exp(newIterate[j], corr[j]);
/** \todo Don't always recompute oldEnergy */ /** \todo Don't always recompute oldEnergy */
double oldEnergy = rodAssembler.computeEnergy(x); double oldEnergy = rodAssembler.computeEnergy(x);
...@@ -304,7 +304,7 @@ int main (int argc, char *argv[]) try ...@@ -304,7 +304,7 @@ int main (int argc, char *argv[]) try
// Add correction to the current solution // Add correction to the current solution
for (int j=0; j<x.size(); j++) for (int j=0; j<x.size(); j++)
x[j] = RigidBodyMotion<2>::exp(x[j], corr[j]); x[j] = RigidBodyMotion<double,2>::exp(x[j], corr[j]);
// Subtract correction from the current obstacle // Subtract correction from the current obstacle
for (int k=0; k<corr.size(); k++) for (int k=0; k<corr.size(); k++)
......
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