24 const unsigned int component_in_dim_plus_1,
25 const double coordinate_value)
30 output[component_in_dim_plus_1] = coordinate_value;
31 for (
int d = 0; d < dim; ++d)
33 const unsigned int component_to_write_to =
34 ::internal::coordinate_to_one_dim_higher<dim>(
35 component_in_dim_plus_1, d);
36 output[component_to_write_to] = point[d];
50 const unsigned int direction,
51 const double coordinate_value)
53 , restricted_direction(direction)
54 , coordinate_value(coordinate_value)
64 const unsigned int component)
const
71 return function->value(full_point, component);
79 const unsigned int component)
const
87 function->gradient(full_point, component);
93 for (
unsigned int d = 0; d < dim; ++d)
95 const unsigned int index_to_write_from =
96 internal::coordinate_to_one_dim_higher<dim>(restricted_direction, d);
97 grad[d] = full_gradient[index_to_write_from];
107 const unsigned int component)
const
111 restricted_direction,
115 function->hessian(full_point, component);
121 for (
unsigned int i = 0; i < dim; ++i)
123 const unsigned int i_to_write_from =
124 internal::coordinate_to_one_dim_higher<dim>(restricted_direction, i);
125 for (
unsigned int j = 0; j < dim; ++j)
127 const unsigned int j_to_write_from =
128 internal::coordinate_to_one_dim_higher<dim>(restricted_direction,
130 hess[i][j] = full_hessian[i_to_write_from][j_to_write_from];
140 const unsigned int open_direction,
142 : function(&function)
143 , open_direction(open_direction)
154 const unsigned int component)
const
158 return function->value(full_point, component);
166 const unsigned int component)
const
171 function->gradient(full_point, component);
176 grad[0] = full_gradient[open_direction];
185 const unsigned int component)
const
190 function->hessian(full_point, component);
195 hess[0][0] = full_hessian[open_direction][open_direction];
202#include "function_restriction.inst"
double value(const Point< dim > &point, const unsigned int component) const override
Tensor< 1, dim > gradient(const Point< dim > &point, const unsigned int component) const override
const unsigned int restricted_direction
SymmetricTensor< 2, dim > hessian(const Point< dim > &point, const unsigned int component) const override
CoordinateRestriction(const Function< dim+1 > &function, const unsigned int direction, const double coordinate_value)
PointRestriction(const Function< dim+1 > &function, const unsigned int open_direction, const Point< dim > &point)
const unsigned int open_direction
double value(const Point< 1 > &point, const unsigned int component) const override
Tensor< 1, 1 > gradient(const Point< 1 > &point, const unsigned int component) const override
SymmetricTensor< 2, 1 > hessian(const Point< 1 > &point, const unsigned int component) const override
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define AssertIndexRange(index, range)
Point< dim+1 > create_higher_dim_point(const Point< dim > &point, const unsigned int component_in_dim_plus_1, const double coordinate_value)