94 const unsigned int component)
const
98 "FunctionDerivative was not initialized for constant direction"));
103 return (f.value(p + incr[0], component) -
104 f.value(p - incr[0], component)) /
107 return (f.value(p, component) - f.value(p - incr[0], component)) / h;
109 return (-f.value(p + 2 * incr[0], component) +
110 8 * f.value(p + incr[0], component) -
111 8 * f.value(p - incr[0], component) +
112 f.value(p - 2 * incr[0], component)) /
129 "FunctionDerivative was not initialized for constant direction"));
139 f.vector_value(p - incr[0], aux);
140 result.
sadd(1. / (2 * h), -1. / (2 * h), aux);
144 f.vector_value(p - incr[0], aux);
145 result.
sadd(1. / h, -1. / h, aux);
149 f.vector_value(p + 2 * incr[0], aux);
150 result.
add(-1., aux);
151 f.vector_value(p - incr[0], aux);
152 result.
add(-8., aux);
153 f.vector_value(p + incr[0], aux);
167 std::vector<double> &values,
168 const unsigned int component)
const
170 const unsigned int n = points.size();
171 const bool variable_direction = (incr.size() == 1) ?
false :
true;
172 if (variable_direction)
173 Assert(incr.size() == points.size(),
177 std::vector<double> aux(n);
179 std::vector<Point<dim>> paux(n);
186 for (
unsigned int i = 0; i < n; ++i)
187 paux[i] = points[i] + incr[(variable_direction) ? i : 0U];
189 for (
unsigned int i = 0; i < n; ++i)
190 paux[i] = points[i] - incr[(variable_direction) ? i : 0U];
191 f.value_list(paux, aux, component);
192 for (
unsigned int i = 0; i < n; ++i)
193 values[i] = (values[i] - aux[i]) / (2 * h);
197 for (
unsigned int i = 0; i < n; ++i)
198 paux[i] = points[i] - incr[(variable_direction) ? i : 0U];
199 f.value_list(paux, aux, component);
200 for (
unsigned int i = 0; i < n; ++i)
201 values[i] = (values[i] - aux[i]) / h;
204 for (
unsigned int i = 0; i < n; ++i)
205 paux[i] = points[i] - 2 * incr[(variable_direction) ? i : 0U];
207 for (
unsigned int i = 0; i < n; ++i)
208 paux[i] = points[i] + 2 * incr[(variable_direction) ? i : 0U];
209 f.value_list(paux, aux, component);
210 for (
unsigned int i = 0; i < n; ++i)
212 for (
unsigned int i = 0; i < n; ++i)
213 paux[i] = points[i] + incr[(variable_direction) ? i : 0U];
214 f.value_list(paux, aux, component);
215 for (
unsigned int i = 0; i < n; ++i)
216 values[i] += 8. * aux[i];
217 for (
unsigned int i = 0; i < n; ++i)
218 paux[i] = points[i] - incr[(variable_direction) ? i : 0U];
219 f.value_list(paux, aux, component);
220 for (
unsigned int i = 0; i < n; ++i)
221 values[i] = (values[i] - 8. * aux[i]) / (12 * h);