def setUp(self):
self.manifold_1 = Manifold(dim = 2, spacedim = 2)
- self.manifold_1.create_function("x^2;y^2", "sqrt(x);sqrt(y)")
+ self.manifold_1.create_function_string("x^2;y^2", "sqrt(x);sqrt(y)")
self.manifold_2 = Manifold(dim = 2, spacedim = 2)
self.manifold_2.create_function(lambda p: [p[0]**2., p[1]**2.],\
p_center = Point([0., 0., 0.])
self.triangulation.generate_hyper_cube()
self.triangulation.reset_manifold(number = 0)
- self.triangulation.set_manifold(number = 0, manifold = self.manifold_2)
+ self.triangulation.set_manifold(number = 0, manifold = self.manifold_1)
for cell in self.triangulation.active_cells():
cell.set_all_manifold_ids(0)
*
* The tolerance argument is used in debug mode to actually check that the
* two functions are one the inverse of the other.
+ *
+ * Note: the object constructed in this way stores pointers to the
+ * push_forward and pull_back functions. Therefore, one must guarantee that
+ * the function objects are destroyed only after the constructed manifold.
*/
FunctionManifold(
const Function<chartdim> & push_forward_function,
* std_cxx14::make_unique<MyPullBack>(...));
*/
FunctionManifold(
- std::unique_ptr<Function<chartdim>> push_forward_function,
- std::unique_ptr<Function<spacedim>> pull_back_function,
+ std::unique_ptr<Function<chartdim>> push_forward,
+ std::unique_ptr<Function<spacedim>> pull_back,
const Tensor<1, chartdim> & periodicity = Tensor<1, chartdim>(),
const double tolerance = 1e-10);
template <int dim, int spacedim, int chartdim>
FunctionManifold<dim, spacedim, chartdim>::FunctionManifold(
- std::unique_ptr<Function<chartdim>> push_forward_function,
- std::unique_ptr<Function<spacedim>> pull_back_function,
+ std::unique_ptr<Function<chartdim>> push_forward,
+ std::unique_ptr<Function<spacedim>> pull_back,
const Tensor<1, chartdim> & periodicity,
const double tolerance)
: ChartManifold<dim, spacedim, chartdim>(periodicity)
, const_map()
- , push_forward_function(push_forward_function.release())
- , pull_back_function(pull_back_function.release())
+ , push_forward_function(push_forward.release())
+ , pull_back_function(pull_back.release())
, tolerance(tolerance)
, owns_pointers(true)
, finite_difference_step(0)
}
else
{
- Assert(owns_pointers == false, ExcNotImplemented());
-
return std_cxx14::make_unique<FunctionManifold<dim, spacedim, chartdim>>(
*push_forward_function,
*pull_back_function,