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

Use coordinates in the tangent spaces to evaluate gfe functions

... instead of coordinates in the embedding space.  The usual problem
is that when working in the embedding space, a projection onto the
trust-region makes the iterate leave the tangent space.

[[Imported from SVN: r7035]]
parent 014bef44
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,8 @@
template <class TargetSpace>
class AverageDistanceAssembler
{
static const int size = TargetSpace::EmbeddedTangentVector::size;
static const int size = TargetSpace::TangentVector::size;
static const int embeddedSize = TargetSpace::EmbeddedTangentVector::size;
public:
......@@ -38,6 +39,24 @@ public:
TargetSpace::derivativeOfDistanceSquaredWRTSecondArgument(coefficients_[i], x));
}
void assembleGradient(const TargetSpace& x,
typename TargetSpace::TangentVector& gradient) const
{
typename TargetSpace::EmbeddedTangentVector embeddedGradient;
assembleGradient(x,embeddedGradient);
Dune::FieldMatrix<double,size,embeddedSize> orthonormalFrame = x.orthonormalFrame();
orthonormalFrame.mv(embeddedGradient,gradient);
}
void assembleHessianApproximation(const TargetSpace& x,
Dune::FieldMatrix<double,embeddedSize,embeddedSize>& matrix) const
{
for (int i=0; i<embeddedSize; i++)
for (int j=0; j<embeddedSize; j++)
matrix[i][j] = (i==j);
}
void assembleHessianApproximation(const TargetSpace& x,
Dune::FieldMatrix<double,size,size>& matrix) const
{
......@@ -47,7 +66,7 @@ public:
}
void assembleHessian(const TargetSpace& x,
Dune::FieldMatrix<double,size,size>& matrix) const
Dune::FieldMatrix<double,embeddedSize,embeddedSize>& matrix) const
{
matrix = 0;
for (size_t i=0; i<coefficients_.size(); i++)
......
......@@ -13,7 +13,7 @@ class TargetSpaceRiemannianTRSolver
// : public IterativeSolver<std::vector<TargetSpace>,
// Dune::BitSetVector<TargetSpace::TangentVector::size> >
{
const static int blocksize = TargetSpace::EmbeddedTangentVector::size;
const static int blocksize = TargetSpace::TangentVector::size;
// Centralize the field type here
typedef double field_type;
......
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