34 kv[0]->CalcShape(shape,
ijk[0], ip.
x);
37 for (
int i = 0; i <=
order; i++)
39 sum += (shape(i) *=
weights(i));
51 kv[0]->CalcDShape(grad,
ijk[0], ip.
x);
53 real_t sum = 0.0, dsum = 0.0;
54 for (
int i = 0; i <=
order; i++)
57 dsum += ( grad(i) *=
weights(i));
71 kv[0]->CalcDShape(grad,
ijk[0], ip.
x);
72 kv[0]->CalcD2Shape(hess,
ijk[0], ip.
x);
74 real_t sum = 0.0, dsum = 0.0, d2sum = 0.0;
75 for (
int i = 0; i <=
order; i++)
78 dsum += ( grad(i) *=
weights(i));
79 d2sum += ( hess(i) *=
weights(i));
83 add(sum, hess, -2*dsum*sum*sum, grad, hess);
84 add(1.0, hess, (-d2sum + 2*dsum*dsum*sum)*sum*sum,
shape_x, hess);
113 for (
int o = 0, j = 0; j <=
orders[1]; j++)
116 for (
int i = 0; i <=
orders[0]; i++, o++)
136 sum = dsum[0] = dsum[1] = 0.0;
137 for (
int o = 0, j = 0; j <=
orders[1]; j++)
140 for (
int i = 0; i <=
orders[0]; i++, o++)
153 for (
int o = 0; o <
dof; o++)
155 dshape(o,0) = dshape(o,0)*sum -
u(o)*dsum[0];
156 dshape(o,1) = dshape(o,1)*sum -
u(o)*dsum[1];
163 real_t sum, dsum[2], d2sum[3];
174 sum = dsum[0] = dsum[1] = 0.0;
175 d2sum[0] = d2sum[1] = d2sum[2] = 0.0;
176 for (
int o = 0, j = 0; j <=
orders[1]; j++)
179 for (
int i = 0; i <=
orders[0]; i++, o++)
184 dsum[0] += (
du(o,0) = dsx*sy*
weights(o) );
185 dsum[1] += (
du(o,1) = sx*dsy*
weights(o) );
187 d2sum[0] += ( hessian(o,0) = d2sx*sy*
weights(o) );
188 d2sum[1] += ( hessian(o,1) = dsx*dsy*
weights(o) );
189 d2sum[2] += ( hessian(o,2) = sx*d2sy*
weights(o) );
201 for (
int o = 0; o <
dof; o++)
203 hessian(o,0) = hessian(o,0)*sum
204 - 2*
du(o,0)*sum*dsum[0]
205 +
u[o]*sum*(2*dsum[0]*dsum[0] - d2sum[0]);
207 hessian(o,1) = hessian(o,1)*sum
208 -
du(o,0)*sum*dsum[1]
209 -
du(o,1)*sum*dsum[0]
210 +
u[o]*sum*(2*dsum[0]*dsum[1] - d2sum[1]);
212 hessian(o,2) = hessian(o,2)*sum
213 - 2*
du(o,1)*sum*dsum[1]
214 +
u[o]*sum*(2*dsum[1]*dsum[1] - d2sum[2]);
251 for (
int o = 0, k = 0; k <=
orders[2]; k++)
254 for (
int j = 0; j <=
orders[1]; j++)
257 for (
int i = 0; i <=
orders[0]; i++, o++)
280 sum = dsum[0] = dsum[1] = dsum[2] = 0.0;
281 for (
int o = 0, k = 0; k <=
orders[2]; k++)
284 for (
int j = 0; j <=
orders[1]; j++)
289 for (
int i = 0; i <=
orders[0]; i++, o++)
305 for (
int o = 0; o <
dof; o++)
307 dshape(o,0) = dshape(o,0)*sum -
u(o)*dsum[0];
308 dshape(o,1) = dshape(o,1)*sum -
u(o)*dsum[1];
309 dshape(o,2) = dshape(o,2)*sum -
u(o)*dsum[2];
316 real_t sum, dsum[3], d2sum[6];
330 sum = dsum[0] = dsum[1] = dsum[2] = 0.0;
331 d2sum[0] = d2sum[1] = d2sum[2] = d2sum[3] = d2sum[4] = d2sum[5] = 0.0;
333 for (
int o = 0, k = 0; k <=
orders[2]; k++)
336 for (
int j = 0; j <=
orders[1]; j++)
339 for (
int i = 0; i <=
orders[0]; i++, o++)
342 sum += (
u(o) = sx*sy*sz*
weights(o) );
344 dsum[0] += (
du(o,0) = dsx*sy*sz*
weights(o) );
345 dsum[1] += (
du(o,1) = sx*dsy*sz*
weights(o) );
346 dsum[2] += (
du(o,2) = sx*sy*dsz*
weights(o) );
348 d2sum[0] += ( hessian(o,0) = d2sx*sy*sz*
weights(o) );
349 d2sum[1] += ( hessian(o,1) = dsx*dsy*sz*
weights(o) );
350 d2sum[2] += ( hessian(o,2) = dsx*sy*dsz*
weights(o) );
352 d2sum[3] += ( hessian(o,3) = sx*dsy*dsz*
weights(o) );
354 d2sum[4] += ( hessian(o,4) = sx*sy*d2sz*
weights(o) );
355 d2sum[5] += ( hessian(o,5) = sx*d2sy*sz*
weights(o) );
373 for (
int o = 0; o <
dof; o++)
375 hessian(o,0) = hessian(o,0)*sum
376 - 2*
du(o,0)*sum*dsum[0]
377 +
u[o]*sum*(2*dsum[0]*dsum[0] - d2sum[0]);
379 hessian(o,1) = hessian(o,1)*sum
380 -
du(o,0)*sum*dsum[1]
381 -
du(o,1)*sum*dsum[0]
382 +
u[o]*sum*(2*dsum[0]*dsum[1] - d2sum[1]);
384 hessian(o,2) = hessian(o,2)*sum
385 -
du(o,0)*sum*dsum[2]
386 -
du(o,2)*sum*dsum[0]
387 +
u[o]*sum*(2*dsum[0]*dsum[2] - d2sum[2]);
389 hessian(o,3) = hessian(o,3)*sum
390 -
du(o,1)*sum*dsum[2]
391 -
du(o,2)*sum*dsum[1]
392 +
u[o]*sum*(2*dsum[1]*dsum[2] - d2sum[3]);
394 hessian(o,4) = hessian(o,4)*sum
395 - 2*
du(o,2)*sum*dsum[2]
396 +
u[o]*sum*(2*dsum[2]*dsum[2] - d2sum[4]);
398 hessian(o,5) = hessian(o,5)*sum
399 - 2*
du(o,1)*sum*dsum[1]
400 +
u[o]*sum*(2*dsum[1]*dsum[1] - d2sum[5]);
Data type dense matrix using column-major storage.
real_t * Data() const
Returns the matrix data array.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
int dof
Number of degrees of freedom.
int orders[Geometry::MaxDim]
Anisotropic orders.
int order
Order/degree of the shape functions.
Class for integration point with weight.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Array< const KnotVector * > kv
void SetSize(int s)
Resize the vector to size s.
void add(const Vector &v1, const Vector &v2, Vector &v)