* guaranteed to lie in the periodicity box plus or minus
* tolerance*periodicity.norm().
*/
- FlatManifold (const Point<spacedim> &periodicity = Point<spacedim>(),
+ FlatManifold (const Tensor<1,spacedim> &periodicity = Tensor<1,spacedim>(),
const double tolerance=1e-10);
/**
/**
* Return the periodicity of this Manifold.
*/
- const Point<spacedim> &get_periodicity() const;
+ const Tensor<1,spacedim> &get_periodicity() const;
private:
/**
* A periodicity 0 along one direction means no periodicity. This is the
* default value for all directions.
*/
- const Point<spacedim> periodicity;
+ const Tensor<1,spacedim> periodicity;
- DeclException4(ExcPeriodicBox, int, Point<spacedim>, Point<spacedim>, double,
+ DeclException4(ExcPeriodicBox, int, Point<spacedim>, double, double,
<< "The component number " << arg1 << " of the point [ " << arg2
<< " ] is not in the interval [ " << -arg4
- << ", " << arg3[arg4] << "), bailing out.");
+ << ", " << arg3 << "), bailing out.");
/**
* Relative tolerance. This tolerance is used to compute distances in double
* of (2*pi-eps) and (eps) is not pi, but 2*pi (or zero), since, on the
* manifold, these two points are at distance 2*eps and not (2*pi-eps)
*/
- ChartManifold(const Point<chartdim> &periodicity = Point<chartdim>());
+ ChartManifold(const Tensor<1,chartdim> &periodicity = Tensor<1,chartdim>());
/**
* Destructor. Does nothing here, but needs to be declared to make it
/**
* Return the periodicity associated with the submanifold.
*/
- const Point<chartdim> &get_periodicity() const;
+ const Tensor<1,chartdim> &get_periodicity() const;
private:
/**
* Helper function which returns the periodicity associated with this
* coordinate system, according to dim, chartdim, and spacedim.
*/
- static Point<spacedim> get_periodicity();
+ static Tensor<1,spacedim> get_periodicity();
};
*/
FunctionManifold(const Function<chartdim> &push_forward_function,
const Function<spacedim> &pull_back_function,
- const Point<chartdim> periodicity=Point<chartdim>(),
+ const Tensor<1,chartdim> &periodicity=Tensor<1,chartdim>(),
const double tolerance=1e-10);
/**
*/
FunctionManifold(const std::string push_forward_expression,
const std::string pull_back_expression,
- const Point<chartdim> periodicity=Point<chartdim>(),
+ const Tensor<1,chartdim> &periodicity=Tensor<1,chartdim>(),
const typename FunctionParser<spacedim>::ConstMap = typename FunctionParser<spacedim>::ConstMap(),
const std::string chart_vars=FunctionParser<chartdim>::default_variable_names(),
const std::string space_vars=FunctionParser<spacedim>::default_variable_names(),
template <int dim, int spacedim>
-FlatManifold<dim,spacedim>::FlatManifold (const Point<spacedim> &periodicity,
+FlatManifold<dim,spacedim>::FlatManifold (const Tensor<1,spacedim> &periodicity,
const double tolerance)
:
periodicity(periodicity),
const std::vector<Point<spacedim> > &surrounding_points = quad.get_points();
const std::vector<double> &weights = quad.get_weights();
- Point<spacedim> minP = periodicity;
+ Tensor<1,spacedim> minP = periodicity;
for (unsigned int d=0; d<spacedim; ++d)
if (periodicity[d] > 0)
for (unsigned int i=0; i<surrounding_points.size(); ++i)
{
minP[d] = std::min(minP[d], surrounding_points[i][d]);
- Assert( (surrounding_points[i][d] < periodicity[d]+tolerance*periodicity[d]) ||
- (surrounding_points[i][d] >= -tolerance*periodicity[d]),
- ExcPeriodicBox(d, surrounding_points[i], periodicity, tolerance*periodicity[d]));
+ Assert( (surrounding_points[i][d] < periodicity[d]+tolerance*periodicity.norm()) ||
+ (surrounding_points[i][d] >= -tolerance*periodicity.norm()),
+ ExcPeriodicBox(d, surrounding_points[i], periodicity[i], tolerance*periodicity.norm()));
}
// compute the weighted average point, possibly taking into account periodicity
template <int dim, int spacedim>
-const Point<spacedim> &
+const Tensor<1,spacedim> &
FlatManifold<dim, spacedim>::get_periodicity() const
{
return periodicity;
template <int dim, int spacedim, int chartdim>
-ChartManifold<dim,spacedim,chartdim>::ChartManifold (const Point<chartdim> &periodicity)
+ChartManifold<dim,spacedim,chartdim>::ChartManifold (const Tensor<1,chartdim> &periodicity)
:
sub_manifold(periodicity)
{}
+
template <int dim, int spacedim, int chartdim>
Point<spacedim>
ChartManifold<dim,spacedim,chartdim>::
}
+
template <int dim, int spacedim, int chartdim>
Tensor<1,spacedim>
ChartManifold<dim,spacedim,chartdim>::
return result;
}
+
+
template <int dim, int spacedim, int chartdim>
-const Point<chartdim> &
-ChartManifold<dim,spacedim,chartdim>::
-get_periodicity() const
+const Tensor<1, chartdim> &
+ChartManifold<dim, spacedim, chartdim>::get_periodicity() const
{
return sub_manifold.get_periodicity();
}
template <int dim, int spacedim>
-Point<spacedim>
+Tensor<1,spacedim>
SphericalManifold<dim,spacedim>::get_periodicity()
{
- Point<spacedim> periodicity;
+ Tensor<1,spacedim> periodicity;
periodicity[spacedim-1] = 2*numbers::PI; // theta and phi period.
return periodicity;
}
FunctionManifold<dim,spacedim,chartdim>::FunctionManifold
(const Function<chartdim> &push_forward_function,
const Function<spacedim> &pull_back_function,
- const Point<chartdim> periodicity,
+ const Tensor<1,chartdim> &periodicity,
const double tolerance):
ChartManifold<dim,spacedim,chartdim>(periodicity),
push_forward_function(&push_forward_function),
FunctionManifold<dim,spacedim,chartdim>::FunctionManifold
(const std::string push_forward_expression,
const std::string pull_back_expression,
- const Point<chartdim> periodicity,
+ const Tensor<1,chartdim> &periodicity,
const typename FunctionParser<spacedim>::ConstMap const_map,
const std::string chart_vars,
const std::string space_vars,
class MyFlatManifold : public ChartManifold<dim,spacedim,spacedim>
{
public:
- MyFlatManifold (const Point<spacedim> &periodicity)
+ MyFlatManifold (const Tensor<1,spacedim> &periodicity)
:
ChartManifold<dim,spacedim,spacedim> (periodicity)
{}
deallog << "Testing dim=" << dim
<< ", spacedim="<< spacedim << std::endl;
- Point<spacedim> periodicity;
+ Tensor<1,spacedim> periodicity;
periodicity[0] = 5.0;
MyFlatManifold<dim,spacedim> manifold(periodicity);
class MyFlatManifold : public ChartManifold<dim,spacedim,spacedim+1>
{
public:
- MyFlatManifold (const Point<spacedim+1> &periodicity)
+ MyFlatManifold (const Tensor<1,spacedim+1> &periodicity)
:
ChartManifold<dim,spacedim,spacedim+1> (periodicity)
{}
deallog << "Testing dim=" << dim
<< ", spacedim="<< spacedim << std::endl;
- Point<spacedim+1> periodicity;
+ Tensor<1,spacedim+1> periodicity;
periodicity[0] = 5.0;
MyFlatManifold<dim,spacedim> manifold(periodicity);
class MyFlatManifold : public ChartManifold<dim,spacedim,spacedim>
{
public:
- MyFlatManifold (const Point<spacedim> &periodicity)
+ MyFlatManifold (const Tensor<1,spacedim> &periodicity)
:
ChartManifold<dim,spacedim,spacedim>(periodicity)
{}
<< ", spacedim="<< spacedim << std::endl;
// make the domain periodic in the first direction with periodicity 1.1
- Point<spacedim> periodicity;
+ Tensor<1,spacedim> periodicity;
periodicity[0] = 1.1;
MyFlatManifold<dim,spacedim> manifold(periodicity);
class MyFlatManifold : public ChartManifold<dim,spacedim,spacedim+1>
{
public:
- MyFlatManifold (const Point<spacedim+1> &periodicity)
+ MyFlatManifold (const Tensor<1,spacedim+1> &periodicity)
:
ChartManifold<dim,spacedim,spacedim+1>(periodicity)
{}
<< ", spacedim="<< spacedim << std::endl;
// make the domain periodic in the first direction with periodicity 1.1
- Point<spacedim+1> periodicity;
+ Tensor<1,spacedim+1> periodicity;
periodicity[0] = 1.1;
MyFlatManifold<dim,spacedim> manifold(periodicity);
#include <deal.II/grid/manifold.h>
-Point<3> periodicity (/*r=*/0,
- /*phi=*/2*numbers::PI,
- /*z=*/0);
+Tensor<1,3> periodicity(static_cast<Tensor<1,3> >(Point<3>(0,2*numbers::PI,0)));
class MyCylinderManifold : public ChartManifold<2,3,3>
{
deallog << "Testing dim=" << dim
<< ", spacedim="<< spacedim << std::endl;
- Point<spacedim> periodicity;
+ Tensor<1,spacedim> periodicity;
periodicity[0] = 5.0;
FlatManifold<dim,spacedim> manifold(periodicity);
<< ", spacedim="<< spacedim << std::endl;
// make the domain periodic in the first direction with periodicity 1.1
- Point<spacedim> periodicity;
+ Tensor<1,spacedim> periodicity;
periodicity[0] = 1.1;
FlatManifold<dim,spacedim> manifold(periodicity);