template <int dim, int spacedim>
-class MyFlatManifold : public ChartManifold<dim,spacedim,spacedim+1>
+class MyFlatManifold : public ChartManifold<dim,spacedim,spacedim>
{
public:
virtual
- Point<spacedim+1>
+ Point<spacedim>
pull_back(const Point<spacedim> &space_point) const
{
- Point<spacedim+1> p;
+ Point<spacedim> p;
for (unsigned int d=0; d<spacedim; ++d)
p[d] = space_point[d];
return p;
virtual
Point<spacedim>
- push_forward(const Point<spacedim+1> &chart_point) const
+ push_forward(const Point<spacedim> &chart_point) const
{
Point<spacedim> p;
for (unsigned int d=0; d<spacedim; ++d)
}
virtual
- DerivativeForm<1,spacedim+1,spacedim>
- push_forward_gradient(const Point<spacedim+1> &chart_point) const
+ DerivativeForm<1,spacedim,spacedim>
+ push_forward_gradient(const Point<spacedim> &chart_point) const
{
- DerivativeForm<1,spacedim+1,spacedim> x;
+ DerivativeForm<1,spacedim,spacedim> x;
for (unsigned int d=0; d<spacedim; ++d)
x[d][d] = 1;
return x;
// Test direction vector of flat manifold with periodicity, where the
// flat manifold is implemented as a ChartManifold with identity
// pull-back and push-forward
-//
-// make the chart higher dimensional
#include "../tests.h"
#include <fstream>
template <int dim, int spacedim>
-class MyFlatManifold : public ChartManifold<dim,spacedim,spacedim+1>
+class MyFlatManifold : public ChartManifold<dim,spacedim,spacedim>
{
public:
- MyFlatManifold (const Tensor<1,spacedim+1> &periodicity)
+ MyFlatManifold (const Tensor<1,spacedim> &periodicity)
:
- ChartManifold<dim,spacedim,spacedim+1>(periodicity)
+ ChartManifold<dim,spacedim,spacedim>(periodicity)
{}
virtual
- Point<spacedim+1>
+ Point<spacedim>
pull_back(const Point<spacedim> &space_point) const
{
- Point<spacedim+1> p;
+ Point<spacedim> p;
for (unsigned int d=0; d<spacedim; ++d)
p[d] = space_point[d];
return p;
virtual
Point<spacedim>
- push_forward(const Point<spacedim+1> &chart_point) const
+ push_forward(const Point<spacedim> &chart_point) const
{
Point<spacedim> p;
for (unsigned int d=0; d<spacedim; ++d)
}
virtual
- DerivativeForm<1,spacedim+1,spacedim>
- push_forward_gradient(const Point<spacedim+1> &chart_point) const
+ DerivativeForm<1,spacedim,spacedim>
+ push_forward_gradient(const Point<spacedim> &chart_point) const
{
- DerivativeForm<1,spacedim+1,spacedim> x;
+ DerivativeForm<1,spacedim,spacedim> x;
for (unsigned int d=0; d<spacedim; ++d)
x[d][d] = 1;
return x;
<< ", spacedim="<< spacedim << std::endl;
// make the domain periodic in the first direction with periodicity 1.1
- Tensor<1,spacedim+1> periodicity;
+ Tensor<1,spacedim> periodicity;
periodicity[0] = 1.1;
MyFlatManifold<dim,spacedim> manifold(periodicity);