73 const unsigned int comp)
const
81 for (
unsigned int i = 0; i < dim; ++i)
84 grad[i] = (this->value(p, comp) - this->value(q1, comp)) / h;
91 for (
unsigned int i = 0; i < dim; ++i)
96 (this->value(q1, comp) - this->value(q2, comp)) / (2 * h);
103 for (
unsigned int i = 0; i < dim; ++i)
109 grad[i] = (-this->value(q1, comp) + 8 * this->value(q2, comp) -
110 8 * this->value(q3, comp) + this->value(q4, comp)) /
128 Assert(gradients.size() == this->n_components,
137 const double h_inv = 1. / h;
138 for (
unsigned int i = 0; i < dim; ++i)
141 this->vector_value(p, v);
142 this->vector_value(q1,
v1);
144 for (
unsigned int comp = 0; comp < this->n_components; ++comp)
145 gradients[comp][i] = (v(comp) -
v1(comp)) * h_inv;
154 const double h_inv_2 = 1. / (2 * h);
155 for (
unsigned int i = 0; i < dim; ++i)
159 this->vector_value(q1,
v1);
160 this->vector_value(q2, v2);
162 for (
unsigned int comp = 0; comp < this->n_components; ++comp)
163 gradients[comp][i] = (
v1(comp) - v2(comp)) * h_inv_2;
172 v3(this->n_components), v4(this->n_components);
173 const double h_inv_12 = 1. / (12 * h);
174 for (
unsigned int i = 0; i < dim; ++i)
180 this->vector_value(q1,
v1);
181 this->vector_value(q2, v2);
182 this->vector_value(q3, v3);
183 this->vector_value(q4, v4);
185 for (
unsigned int comp = 0; comp < this->n_components; ++comp)
187 (-
v1(comp) + 8 * v2(comp) - 8 * v3(comp) + v4(comp)) *
204 const unsigned int comp)
const
206 Assert(gradients.size() == points.size(),
214 for (
unsigned int p = 0; p < points.size(); ++p)
215 for (
unsigned int i = 0; i < dim; ++i)
217 q1 = points[p] - ht[i];
219 (this->value(points[p], comp) - this->value(q1, comp)) / h;
227 for (
unsigned int p = 0; p < points.size(); ++p)
228 for (
unsigned int i = 0; i < dim; ++i)
230 q1 = points[p] + ht[i];
231 q2 = points[p] - ht[i];
233 (this->value(q1, comp) - this->value(q2, comp)) / (2 * h);
241 for (
unsigned int p = 0; p < points.size(); ++p)
242 for (
unsigned int i = 0; i < dim; ++i)
244 q2 = points[p] + ht[i];
246 q3 = points[p] - ht[i];
249 (-this->value(q1, comp) + 8 * this->value(q2, comp) -
250 8 * this->value(q3, comp) + this->value(q4, comp)) /
269 Assert(gradients.size() == points.size(),
271 for (
unsigned int p = 0; p < points.size(); ++p)
272 Assert(gradients[p].
size() == this->n_components,
280 for (
unsigned int p = 0; p < points.size(); ++p)
281 for (
unsigned int i = 0; i < dim; ++i)
283 q1 = points[p] - ht[i];
284 for (
unsigned int comp = 0; comp < this->n_components; ++comp)
285 gradients[p][comp][i] =
286 (this->value(points[p], comp) - this->value(q1, comp)) / h;
294 for (
unsigned int p = 0; p < points.size(); ++p)
295 for (
unsigned int i = 0; i < dim; ++i)
297 q1 = points[p] + ht[i];
298 q2 = points[p] - ht[i];
299 for (
unsigned int comp = 0; comp < this->n_components; ++comp)
300 gradients[p][comp][i] =
301 (this->value(q1, comp) - this->value(q2, comp)) / (2 * h);
309 for (
unsigned int p = 0; p < points.size(); ++p)
310 for (
unsigned int i = 0; i < dim; ++i)
312 q2 = points[p] + ht[i];
314 q3 = points[p] - ht[i];
316 for (
unsigned int comp = 0; comp < this->n_components; ++comp)
317 gradients[p][comp][i] =
318 (-this->value(q1, comp) + 8 * this->value(q2, comp) -
319 8 * this->value(q3, comp) + this->value(q4, comp)) /