25 mfem_error (
"BilinearFormIntegrator::AssemblePA(fes)\n" 26 " is not implemented for this class.");
32 mfem_error (
"BilinearFormIntegrator::AssemblePA(fes, fes)\n" 33 " is not implemented for this class.");
38 mfem_error (
"BilinearFormIntegrator::AssemblePAInteriorFaces(...)\n" 39 " is not implemented for this class.");
44 mfem_error (
"BilinearFormIntegrator::AssemblePABoundaryFaces(...)\n" 45 " is not implemented for this class.");
48 void BilinearFormIntegrator::AssembleDiagonalPA(
Vector &)
50 mfem_error (
"BilinearFormIntegrator::AssembleDiagonalPA(...)\n" 51 " is not implemented for this class.");
58 mfem_error (
"BilinearFormIntegrator::AssembleEA(...)\n" 59 " is not implemented for this class.");
68 mfem_error (
"BilinearFormIntegrator::AssembleEAInteriorFaces(...)\n" 69 " is not implemented for this class.");
77 mfem_error (
"BilinearFormIntegrator::AssembleEABoundaryFaces(...)\n" 78 " is not implemented for this class.");
81 void BilinearFormIntegrator::AssembleDiagonalPA_ADAt(
const Vector &,
Vector &)
83 MFEM_ABORT(
"BilinearFormIntegrator::AssembleDiagonalPA_ADAt(...)\n" 84 " is not implemented for this class.");
87 void BilinearFormIntegrator::AddMultPA(
const Vector &,
Vector &)
const 89 mfem_error (
"BilinearFormIntegrator::MultAssembled(...)\n" 90 " is not implemented for this class.");
93 void BilinearFormIntegrator::AddMultTransposePA(
const Vector &,
Vector &)
const 95 mfem_error (
"BilinearFormIntegrator::AddMultTransposePA(...)\n" 96 " is not implemented for this class.");
101 mfem_error (
"BilinearFormIntegrator::AssembleMF(...)\n" 102 " is not implemented for this class.");
107 mfem_error (
"BilinearFormIntegrator::AddMultMF(...)\n" 108 " is not implemented for this class.");
111 void BilinearFormIntegrator::AddMultTransposeMF(
const Vector &,
Vector &)
const 113 mfem_error (
"BilinearFormIntegrator::AddMultTransposeMF(...)\n" 114 " is not implemented for this class.");
117 void BilinearFormIntegrator::AssembleDiagonalMF(
Vector &)
119 mfem_error (
"BilinearFormIntegrator::AssembleDiagonalMF(...)\n" 120 " is not implemented for this class.");
123 void BilinearFormIntegrator::AssembleElementMatrix (
127 mfem_error (
"BilinearFormIntegrator::AssembleElementMatrix(...)\n" 128 " is not implemented for this class.");
131 void BilinearFormIntegrator::AssembleElementMatrix2 (
135 mfem_error (
"BilinearFormIntegrator::AssembleElementMatrix2(...)\n" 136 " is not implemented for this class.");
139 void BilinearFormIntegrator::AssembleFaceMatrix (
143 mfem_error (
"BilinearFormIntegrator::AssembleFaceMatrix(...)\n" 144 " is not implemented for this class.");
147 void BilinearFormIntegrator::AssembleFaceMatrix(
152 MFEM_ABORT(
"AssembleFaceMatrix (mixed form) is not implemented for this" 153 " Integrator class.");
156 void BilinearFormIntegrator::AssembleElementVector(
162 AssembleElementMatrix(el, Tr, elmat);
164 elmat.
Mult(elfun, elvect);
167 void BilinearFormIntegrator::AssembleFaceVector(
173 AssembleFaceMatrix(el1, el2, Tr, elmat);
175 elmat.
Mult(elfun, elvect);
184 void TransposeIntegrator::AssembleElementMatrix (
187 bfi -> AssembleElementMatrix (el,
Trans, bfi_elmat);
192 void TransposeIntegrator::AssembleElementMatrix2 (
196 bfi -> AssembleElementMatrix2 (test_fe, trial_fe,
Trans, bfi_elmat);
201 void TransposeIntegrator::AssembleFaceMatrix (
205 bfi -> AssembleFaceMatrix (el1, el2,
Trans, bfi_elmat);
216 void LumpedIntegrator::AssembleElementMatrix (
219 bfi -> AssembleElementMatrix (el,
Trans, elmat);
226 integrator->SetIntRule(ir);
229 void InverseIntegrator::AssembleElementMatrix(
232 integrator->AssembleElementMatrix(el,
Trans, elmat);
239 for (
int i = 0; i < integrators.Size(); i++)
241 integrators[i]->SetIntRule(ir);
245 void SumIntegrator::AssembleElementMatrix(
248 MFEM_ASSERT(integrators.Size() > 0,
"empty SumIntegrator.");
250 integrators[0]->AssembleElementMatrix(el,
Trans, elmat);
251 for (
int i = 1; i < integrators.Size(); i++)
253 integrators[i]->AssembleElementMatrix(el,
Trans, elem_mat);
258 void SumIntegrator::AssembleElementMatrix2(
262 MFEM_ASSERT(integrators.Size() > 0,
"empty SumIntegrator.");
264 integrators[0]->AssembleElementMatrix2(el1, el2,
Trans, elmat);
265 for (
int i = 1; i < integrators.Size(); i++)
267 integrators[i]->AssembleElementMatrix2(el1, el2,
Trans, elem_mat);
272 void SumIntegrator::AssembleFaceMatrix(
276 MFEM_ASSERT(integrators.Size() > 0,
"empty SumIntegrator.");
278 integrators[0]->AssembleFaceMatrix(el1, el2,
Trans, elmat);
279 for (
int i = 1; i < integrators.Size(); i++)
281 integrators[i]->AssembleFaceMatrix(el1, el2,
Trans, elem_mat);
286 void SumIntegrator::AssembleFaceMatrix(
291 MFEM_ASSERT(integrators.Size() > 0,
"empty SumIntegrator.");
293 integrators[0]->AssembleFaceMatrix(tr_fe, te_fe1, te_fe2,
Trans, elmat);
294 for (
int i = 1; i < integrators.Size(); i++)
296 integrators[i]->AssembleFaceMatrix(tr_fe, te_fe1, te_fe2,
Trans, elem_mat);
303 for (
int i = 0; i < integrators.Size(); i++)
305 integrators[i]->AssemblePA(fes);
309 void SumIntegrator::AssembleDiagonalPA(
Vector &diag)
311 for (
int i = 0; i < integrators.Size(); i++)
313 integrators[i]->AssembleDiagonalPA(diag);
319 for (
int i = 0; i < integrators.Size(); i++)
321 integrators[i]->AssemblePAInteriorFaces(fes);
327 for (
int i = 0; i < integrators.Size(); i++)
329 integrators[i]->AssemblePABoundaryFaces(fes);
335 for (
int i = 0; i < integrators.Size(); i++)
337 integrators[i]->AddMultPA(x, y);
341 void SumIntegrator::AddMultTransposePA(
const Vector &x,
Vector &y)
const 343 for (
int i = 0; i < integrators.Size(); i++)
345 integrators[i]->AddMultTransposePA(x, y);
351 for (
int i = 0; i < integrators.Size(); i++)
353 integrators[i]->AssembleMF(fes);
359 for (
int i = 0; i < integrators.Size(); i++)
361 integrators[i]->AddMultTransposeMF(x, y);
365 void SumIntegrator::AddMultTransposeMF(
const Vector &x,
Vector &y)
const 367 for (
int i = 0; i < integrators.Size(); i++)
369 integrators[i]->AddMultMF(x, y);
373 void SumIntegrator::AssembleDiagonalMF(
Vector &diag)
375 for (
int i = 0; i < integrators.Size(); i++)
377 integrators[i]->AssembleDiagonalMF(diag);
384 for (
int i = 0; i < integrators.Size(); i++)
386 integrators[i]->AssembleEA(fes, emat,
add);
395 for (
int i = 0; i < integrators.Size(); i++)
397 integrators[i]->AssembleEAInteriorFaces(fes,ea_data_int,ea_data_ext,
add);
405 for (
int i = 0; i < integrators.Size(); i++)
407 integrators[i]->AssembleEABoundaryFaces(fes, ea_data_bdr,
add);
411 SumIntegrator::~SumIntegrator()
415 for (
int i = 0; i < integrators.Size(); i++)
417 delete integrators[i];
422 void MixedScalarIntegrator::AssembleElementMatrix2(
426 MFEM_ASSERT(this->VerifyFiniteElementTypes(trial_fe, test_fe),
427 this->FiniteElementTypeFailureMessage());
429 int trial_nd = trial_fe.
GetDof(), test_nd = test_fe.
GetDof(), i;
430 bool same_shapes = same_calc_shape && (&trial_fe == &test_fe);
432 #ifdef MFEM_THREAD_SAFE 433 Vector test_shape(test_nd);
447 elmat.
SetSize(test_nd, trial_nd);
452 int ir_order = this->GetIntegrationOrder(trial_fe, test_fe,
Trans);
453 ir = &
IntRules.
Get(trial_fe.GetGeomType(), ir_order);
460 Trans.SetIntPoint(&ip);
462 this->CalcTestShape(test_fe,
Trans, test_shape);
463 this->CalcTrialShape(trial_fe,
Trans, trial_shape);
469 w *= Q->Eval(
Trans, ip);
473 #ifndef MFEM_THREAD_SAFE 481 void MixedVectorIntegrator::AssembleElementMatrix2(
485 MFEM_ASSERT(this->VerifyFiniteElementTypes(trial_fe, test_fe),
486 this->FiniteElementTypeFailureMessage());
488 space_dim =
Trans.GetSpaceDim();
489 int trial_nd = trial_fe.
GetDof(), test_nd = test_fe.
GetDof(), i;
490 int test_vdim = GetTestVDim(test_fe);
491 int trial_vdim = GetTrialVDim(trial_fe);
492 bool same_shapes = same_calc_shape && (&trial_fe == &test_fe);
496 MFEM_VERIFY(MQ->GetHeight() == test_vdim,
497 "Dimension mismatch in height of matrix coefficient.");
498 MFEM_VERIFY(MQ->GetWidth() == trial_vdim,
499 "Dimension mismatch in width of matrix coefficient.");
503 MFEM_VERIFY(trial_vdim == test_vdim,
504 "Diagonal matrix coefficient requires matching " 505 "test and trial vector dimensions.");
506 MFEM_VERIFY(DQ->GetVDim() == trial_vdim,
507 "Dimension mismatch in diagonal matrix coefficient.");
511 MFEM_VERIFY(VQ->GetVDim() == 3,
"Vector coefficient must have " 512 "dimension equal to three.");
515 #ifdef MFEM_THREAD_SAFE 516 Vector V(VQ ? VQ->GetVDim() : 0);
517 Vector D(DQ ? DQ->GetVDim() : 0);
518 DenseMatrix M(MQ ? MQ->GetHeight() : 0, MQ ? MQ->GetWidth() : 0);
523 V.SetSize(VQ ? VQ->GetVDim() : 0);
524 D.SetSize(DQ ? DQ->GetVDim() : 0);
525 M.SetSize(MQ ? MQ->GetHeight() : 0, MQ ? MQ->GetWidth() : 0);
526 test_shape.SetSize(test_nd, test_vdim);
527 shape_tmp.
SetSize(test_nd, trial_vdim);
531 trial_shape.
Reset(test_shape.Data(), trial_nd, trial_vdim);
535 trial_shape.
SetSize(trial_nd, trial_vdim);
538 elmat.
SetSize(test_nd, trial_nd);
543 int ir_order = this->GetIntegrationOrder(trial_fe, test_fe,
Trans);
544 ir = &
IntRules.
Get(trial_fe.GetGeomType(), ir_order);
551 Trans.SetIntPoint(&ip);
553 this->CalcTestShape(test_fe,
Trans, test_shape);
556 this->CalcTrialShape(trial_fe,
Trans, trial_shape);
563 MQ->Eval(M,
Trans, ip);
565 Mult(test_shape, M, shape_tmp);
570 DQ->Eval(D,
Trans, ip);
576 VQ->Eval(V,
Trans, ip);
579 for (
int j=0; j<test_nd; j++)
585 if (test_vdim == 3 && trial_vdim == 3)
587 shape_tmp(j,0) = test_shape(j,1) * V(2) -
588 test_shape(j,2) * V(1);
589 shape_tmp(j,1) = test_shape(j,2) * V(0) -
590 test_shape(j,0) * V(2);
591 shape_tmp(j,2) = test_shape(j,0) * V(1) -
592 test_shape(j,1) * V(0);
594 else if (test_vdim == 3 && trial_vdim == 2)
596 shape_tmp(j,0) = test_shape(j,1) * V(2) -
597 test_shape(j,2) * V(1);
598 shape_tmp(j,1) = test_shape(j,2) * V(0) -
599 test_shape(j,0) * V(2);
601 else if (test_vdim == 3 && trial_vdim == 1)
603 shape_tmp(j,0) = test_shape(j,1) * V(2) -
604 test_shape(j,2) * V(1);
606 else if (test_vdim == 2 && trial_vdim == 3)
608 shape_tmp(j,0) = test_shape(j,1) * V(2);
609 shape_tmp(j,1) = -test_shape(j,0) * V(2);
610 shape_tmp(j,2) = test_shape(j,0) * V(1) -
611 test_shape(j,1) * V(0);
613 else if (test_vdim == 2 && trial_vdim == 2)
615 shape_tmp(j,0) = test_shape(j,1) * V(2);
616 shape_tmp(j,1) = -test_shape(j,0) * V(2);
618 else if (test_vdim == 1 && trial_vdim == 3)
620 shape_tmp(j,0) = 0.0;
621 shape_tmp(j,1) = -test_shape(j,0) * V(2);
622 shape_tmp(j,2) = test_shape(j,0) * V(1);
624 else if (test_vdim == 1 && trial_vdim == 1)
626 shape_tmp(j,0) = 0.0;
635 w *= Q -> Eval (
Trans, ip);
647 #ifndef MFEM_THREAD_SAFE 655 void MixedScalarVectorIntegrator::AssembleElementMatrix2(
659 MFEM_ASSERT(this->VerifyFiniteElementTypes(trial_fe, test_fe),
660 this->FiniteElementTypeFailureMessage());
662 MFEM_VERIFY(VQ,
"MixedScalarVectorIntegrator: " 663 "VectorCoefficient must be set");
668 space_dim =
Trans.GetSpaceDim();
669 int trial_nd = trial_fe.
GetDof(), test_nd = test_fe.
GetDof(), i;
670 int sca_nd = sca_fe->
GetDof();
671 int vec_nd = vec_fe->
GetDof();
672 int vdim = GetVDim(*vec_fe);
675 MFEM_VERIFY(VQ->GetVDim() == vdim,
"MixedScalarVectorIntegrator: " 676 "Dimensions of VectorCoefficient and Vector-valued basis " 677 "functions must match");
679 #ifdef MFEM_THREAD_SAFE 683 Vector vshape_tmp(vec_nd);
694 elmat.
SetSize(test_nd, trial_nd);
699 int ir_order = this->GetIntegrationOrder(trial_fe, test_fe,
Trans);
707 Trans.SetIntPoint(&ip);
709 this->CalcShape(*sca_fe,
Trans, shape);
710 this->CalcVShape(*vec_fe,
Trans, vshape);
714 VQ->Eval(V,
Trans, ip);
717 if ( vdim == 2 && cross_2d )
724 vshape.
Mult(V,vshape_tmp);
730 void GradientIntegrator::AssembleElementMatrix2(
735 int trial_dof = trial_fe.
GetDof();
736 int test_dof = test_fe.
GetDof();
741 gshape.SetSize(trial_dof,
dim);
743 shape.SetSize(test_dof);
750 elmat_comp.
SetSize(test_dof, trial_dof);
759 Trans.SetIntPoint(&ip);
762 Mult(dshape, Jadj, gshape);
767 c *= Q->Eval(
Trans, ip);
771 for (
int d = 0; d <
dim; ++d)
773 gshape.GetColumnReference(d, d_col);
774 MultVWt(shape, d_col, elmat_comp);
775 for (
int jj = 0; jj < trial_dof; ++jj)
777 for (
int ii = 0; ii < test_dof; ++ii)
779 elmat(d * test_dof + ii, jj) += elmat_comp(ii, jj);
796 void DiffusionIntegrator::AssembleElementMatrix
802 int spaceDim =
Trans.GetSpaceDim();
803 bool square = (
dim == spaceDim);
808 MFEM_VERIFY(VQ->GetVDim() == spaceDim,
809 "Unexpected dimension for VectorCoefficient");
813 MFEM_VERIFY(MQ->GetWidth() == spaceDim,
814 "Unexpected width for MatrixCoefficient");
815 MFEM_VERIFY(MQ->GetHeight() == spaceDim,
816 "Unexpected height for MatrixCoefficient");
819 #ifdef MFEM_THREAD_SAFE 823 Vector D(VQ ? VQ->GetVDim() : 0);
826 dshapedxt.
SetSize(nd, spaceDim);
827 dshapedxt_m.
SetSize(nd, MQ ? spaceDim : 0);
829 D.SetSize(VQ ? VQ->GetVDim() : 0);
841 Trans.SetIntPoint(&ip);
843 w = ip.
weight / (square ? w : w*w*w);
846 Mult(dshape,
Trans.AdjugateJacobian(), dshapedxt);
849 MQ->Eval(M,
Trans, ip);
851 Mult(dshapedxt, M, dshapedxt_m);
856 VQ->Eval(D,
Trans, ip);
864 w *= Q->Eval(
Trans, ip);
871 void DiffusionIntegrator::AssembleElementMatrix2(
875 int tr_nd = trial_fe.
GetDof();
876 int te_nd = test_fe.
GetDof();
878 int spaceDim =
Trans.GetSpaceDim();
879 bool square = (
dim == spaceDim);
884 MFEM_VERIFY(VQ->GetVDim() == spaceDim,
885 "Unexpected dimension for VectorCoefficient");
889 MFEM_VERIFY(MQ->GetWidth() == spaceDim,
890 "Unexpected width for MatrixCoefficient");
891 MFEM_VERIFY(MQ->GetHeight() == spaceDim,
892 "Unexpected height for MatrixCoefficient");
895 #ifdef MFEM_THREAD_SAFE 901 Vector D(VQ ? VQ->GetVDim() : 0);
904 dshapedxt.
SetSize(tr_nd, spaceDim);
905 te_dshape.SetSize(te_nd,
dim);
906 te_dshapedxt.
SetSize(te_nd, spaceDim);
908 dshapedxt_m.
SetSize(te_nd, MQ ? spaceDim : 0);
910 D.SetSize(VQ ? VQ->GetVDim() : 0);
923 Trans.SetIntPoint(&ip);
926 w = ip.
weight / (square ? w : w*w*w);
927 Mult(dshape, invdfdx, dshapedxt);
928 Mult(te_dshape, invdfdx, te_dshapedxt);
932 MQ->Eval(M,
Trans, ip);
934 Mult(te_dshapedxt, M, dshapedxt_m);
939 VQ->Eval(D,
Trans, ip);
947 w *= Q->Eval(
Trans, ip);
955 void DiffusionIntegrator::AssembleElementVector(
966 MFEM_VERIFY(VQ->GetVDim() == spaceDim,
967 "Unexpected dimension for VectorCoefficient");
971 MFEM_VERIFY(MQ->GetWidth() == spaceDim,
972 "Unexpected width for MatrixCoefficient");
973 MFEM_VERIFY(MQ->GetHeight() == spaceDim,
974 "Unexpected height for MatrixCoefficient");
977 #ifdef MFEM_THREAD_SAFE 979 Vector D(VQ ? VQ->GetVDim() : 0);
982 invdfdx.SetSize(
dim, spaceDim);
984 D.SetSize(VQ ? VQ->GetVDim() : 0);
987 vecdxt.SetSize((VQ || MQ) ? spaceDim : 0);
988 pointflux.SetSize(spaceDim);
1006 dshape.MultTranspose(elfun, vec);
1007 invdfdx.MultTranspose(vec, pointflux);
1010 w *= Q->Eval(Tr, ip);
1015 dshape.MultTranspose(elfun, vec);
1016 invdfdx.MultTranspose(vec, vecdxt);
1019 MQ->Eval(M, Tr, ip);
1020 M.
Mult(vecdxt, pointflux);
1024 VQ->Eval(D, Tr, ip);
1025 for (
int j=0; j<spaceDim; ++j)
1027 pointflux[j] = D[j] * vecdxt[j];
1032 invdfdx.Mult(pointflux, vec);
1033 dshape.AddMult(vec, elvect);
1037 void DiffusionIntegrator::ComputeElementFlux
1042 int nd, spaceDim, fnd;
1046 spaceDim =
Trans.GetSpaceDim();
1050 MFEM_VERIFY(VQ->GetVDim() == spaceDim,
1051 "Unexpected dimension for VectorCoefficient");
1055 MFEM_VERIFY(MQ->GetWidth() == spaceDim,
1056 "Unexpected width for MatrixCoefficient");
1057 MFEM_VERIFY(MQ->GetHeight() == spaceDim,
1058 "Unexpected height for MatrixCoefficient");
1061 #ifdef MFEM_THREAD_SAFE 1064 Vector D(VQ ? VQ->GetVDim() : 0);
1069 D.SetSize(VQ ? VQ->GetVDim() : 0);
1072 vecdxt.SetSize(spaceDim);
1073 pointflux.SetSize(MQ || VQ ? spaceDim : 0);
1080 flux.
SetSize( fnd * spaceDim );
1082 for (
int i = 0; i < fnd; i++)
1086 dshape.MultTranspose(
u, vec);
1088 Trans.SetIntPoint (&ip);
1098 vecdxt *= Q->Eval(
Trans,ip);
1100 for (
int j = 0; j < spaceDim; j++)
1102 flux(fnd*j+i) = vecdxt(j);
1109 MQ->Eval(M,
Trans, ip);
1110 M.
Mult(vecdxt, pointflux);
1114 VQ->Eval(D,
Trans, ip);
1115 for (
int j=0; j<spaceDim; ++j)
1117 pointflux[j] = D[j] * vecdxt[j];
1120 for (
int j = 0; j < spaceDim; j++)
1122 flux(fnd*j+i) = pointflux(j);
1128 for (
int j = 0; j < spaceDim; j++)
1130 flux(fnd*j+i) = vecdxt(j);
1136 double DiffusionIntegrator::ComputeFluxEnergy
1140 int nd = fluxelem.
GetDof();
1142 int spaceDim =
Trans.GetSpaceDim();
1144 #ifdef MFEM_THREAD_SAFE 1146 Vector D(VQ ? VQ->GetVDim() : 0);
1148 D.
SetSize(VQ ? VQ->GetVDim() : 0);
1152 pointflux.SetSize(spaceDim);
1153 if (d_energy) { vec.SetSize(spaceDim); }
1154 if (MQ) { M.
SetSize(spaceDim); }
1156 int order = 2 * fluxelem.
GetOrder();
1159 double energy = 0.0;
1160 if (d_energy) { *d_energy = 0.0; }
1168 for (
int k = 0; k < spaceDim; k++)
1170 for (
int j = 0; j < nd; j++)
1172 pointflux(k) += flux(k*nd+j)*shape(j);
1176 Trans.SetIntPoint(&ip);
1181 MQ->Eval(M,
Trans, ip);
1186 VQ->Eval(D,
Trans, ip);
1188 energy += w * (D * pointflux);
1192 double e = (pointflux * pointflux);
1193 if (Q) { e *= Q->Eval(
Trans, ip); }
1200 Trans.Jacobian().MultTranspose(pointflux, vec);
1201 for (
int k = 0; k <
dim; k++)
1203 (*d_energy)[k] += w * vec[k] * vec[k];
1216 if (trial_fe.
Space() == FunctionSpace::Pk)
1226 if (trial_fe.
Space() == FunctionSpace::rQk)
1234 void MassIntegrator::AssembleElementMatrix
1242 #ifdef MFEM_THREAD_SAFE 1254 Trans.SetIntPoint (&ip);
1261 w *= Q -> Eval(
Trans, ip);
1268 void MassIntegrator::AssembleElementMatrix2(
1272 int tr_nd = trial_fe.
GetDof();
1273 int te_nd = test_fe.
GetDof();
1276 #ifdef MFEM_THREAD_SAFE 1293 Trans.SetIntPoint (&ip);
1297 w *= Q -> Eval(
Trans, ip);
1312 if (trial_fe.
Space() == FunctionSpace::rQk)
1320 void BoundaryMassIntegrator::AssembleFaceMatrix(
1324 MFEM_ASSERT(
Trans.Elem2No < 0,
1325 "support for interior faces is not implemented");
1330 #ifdef MFEM_THREAD_SAFE 1350 Trans.SetAllIntPoints(&ip);
1359 w *= Q -> Eval(
Trans, ip);
1366 void ConvectionIntegrator::AssembleElementMatrix(
1372 #ifdef MFEM_THREAD_SAFE 1374 Vector shape, vec2, BdFidxT;
1392 Q->Eval(Q_ir,
Trans, *ir);
1401 Trans.SetIntPoint(&ip);
1406 adjJ.
Mult(vec1, vec2);
1407 dshape.
Mult(vec2, BdFidxT);
1414 void GroupConvectionIntegrator::AssembleElementMatrix(
1421 dshape.SetSize(nd,
dim);
1424 grad.SetSize(nd,
dim);
1442 Trans.SetIntPoint(&ip);
1445 Mult(dshape, adjJ, grad);
1450 for (
int k = 0; k < nd; k++)
1452 double wsk = w*shape(k);
1453 for (
int l = 0; l < nd; l++)
1456 for (
int s = 0;
s <
dim;
s++)
1458 a += Q_nodal(
s,k)*grad(l,
s);
1460 elmat(k,l) += wsk*
a;
1481 void VectorMassIntegrator::AssembleElementMatrix
1486 int spaceDim =
Trans.GetSpaceDim();
1491 vdim = (vdim == -1) ? spaceDim : vdim;
1495 partelmat.SetSize(nd);
1502 mcoeff.SetSize(vdim);
1510 if (el.
Space() == FunctionSpace::rQk)
1526 Trans.SetIntPoint (&ip);
1533 VQ->Eval(vec,
Trans, ip);
1534 for (
int k = 0; k < vdim; k++)
1536 elmat.
AddMatrix(norm*vec(k), partelmat, nd*k, nd*k);
1541 MQ->Eval(mcoeff,
Trans, ip);
1542 for (
int i = 0; i < vdim; i++)
1543 for (
int j = 0; j < vdim; j++)
1545 elmat.
AddMatrix(norm*mcoeff(i,j), partelmat, nd*i, nd*j);
1552 norm *= Q->Eval(
Trans, ip);
1555 for (
int k = 0; k < vdim; k++)
1563 void VectorMassIntegrator::AssembleElementMatrix2(
1567 int tr_nd = trial_fe.
GetDof();
1568 int te_nd = test_fe.
GetDof();
1573 vdim = (vdim == -1) ?
Trans.GetSpaceDim() : vdim;
1575 elmat.
SetSize(te_nd*vdim, tr_nd*vdim);
1576 shape.SetSize(tr_nd);
1577 te_shape.SetSize(te_nd);
1578 partelmat.SetSize(te_nd, tr_nd);
1585 mcoeff.SetSize(vdim);
1592 Trans.OrderW() + Q_order);
1594 if (trial_fe.
Space() == FunctionSpace::rQk)
1611 Trans.SetIntPoint(&ip);
1614 MultVWt(te_shape, shape, partelmat);
1618 VQ->Eval(vec,
Trans, ip);
1619 for (
int k = 0; k < vdim; k++)
1621 elmat.
AddMatrix(norm*vec(k), partelmat, te_nd*k, tr_nd*k);
1626 MQ->Eval(mcoeff,
Trans, ip);
1627 for (
int i = 0; i < vdim; i++)
1628 for (
int j = 0; j < vdim; j++)
1630 elmat.
AddMatrix(norm*mcoeff(i,j), partelmat, te_nd*i, tr_nd*j);
1637 norm *= Q->Eval(
Trans, ip);
1640 for (
int k = 0; k < vdim; k++)
1642 elmat.
AddMatrix(partelmat, te_nd*k, tr_nd*k);
1648 void VectorFEDivergenceIntegrator::AssembleElementMatrix2(
1652 int trial_nd = trial_fe.
GetDof(), test_nd = test_fe.
GetDof(), i;
1654 #ifdef MFEM_THREAD_SAFE 1655 Vector divshape(trial_nd), shape(test_nd);
1657 divshape.SetSize(trial_nd);
1661 elmat.
SetSize(test_nd, trial_nd);
1675 Trans.SetIntPoint(&ip);
1680 Trans.SetIntPoint(&ip);
1681 w *= Q->Eval(
Trans, ip);
1688 void VectorFEWeakDivergenceIntegrator::AssembleElementMatrix2(
1692 int trial_nd = trial_fe.
GetDof(), test_nd = test_fe.
GetDof(), i;
1698 "Trial space must be H(Curl) and test space must be H_1");
1700 #ifdef MFEM_THREAD_SAFE 1706 dshape.SetSize(test_nd,
dim);
1712 elmat.
SetSize(test_nd, trial_nd);
1740 int ir_order = (trial_fe.
Space() == FunctionSpace::Pk) ?
1752 Trans.SetIntPoint(&ip);
1754 Mult(dshape, invdfdx, dshapedxt);
1762 w *= Q->Eval(
Trans, ip);
1770 void VectorFECurlIntegrator::AssembleElementMatrix2(
1774 int trial_nd = trial_fe.
GetDof(), test_nd = test_fe.
GetDof(), i;
1776 int dimc = (
dim == 3) ? 3 : 1;
1780 "At least one of the finite elements must be in H(Curl)");
1782 int curl_nd, vec_nd;
1794 #ifdef MFEM_THREAD_SAFE 1799 curlshapeTrial.
SetSize(curl_nd, dimc);
1800 curlshapeTrial_dFT.
SetSize(curl_nd, dimc);
1801 vshapeTest.
SetSize(vec_nd, dimc);
1805 elmat.
SetSize(test_nd, trial_nd);
1819 Trans.SetIntPoint(&ip);
1832 MultABt(curlshapeTrial,
Trans.Jacobian(), curlshapeTrial_dFT);
1852 w *= Q->Eval(
Trans, ip);
1858 AddMultABt(vshapeTest, curlshapeTrial_dFT, elmat);
1862 AddMultABt(curlshapeTrial_dFT, vshapeTest, elmat);
1867 void DerivativeIntegrator::AssembleElementMatrix2 (
1874 int trial_nd = trial_fe.
GetDof();
1875 int test_nd = test_fe.
GetDof();
1876 int spaceDim =
Trans.GetSpaceDim();
1881 elmat.
SetSize (test_nd,trial_nd);
1882 dshape.SetSize (trial_nd,
dim);
1883 dshapedxt.SetSize(trial_nd, spaceDim);
1884 dshapedxi.SetSize(trial_nd);
1885 invdfdx.SetSize(
dim, spaceDim);
1886 shape.SetSize (test_nd);
1892 if (trial_fe.
Space() == FunctionSpace::Pk)
1901 if (trial_fe.
Space() == FunctionSpace::rQk)
1918 Trans.SetIntPoint (&ip);
1920 det =
Trans.Weight();
1921 Mult (dshape, invdfdx, dshapedxt);
1925 for (l = 0; l < trial_nd; l++)
1927 dshapedxi(l) = dshapedxt(l,xi);
1935 void CurlCurlIntegrator::AssembleElementMatrix
1944 #ifdef MFEM_THREAD_SAFE 1946 DenseMatrix curlshape(nd,dimc), curlshape_dFt(nd,dimc), M;
1949 curlshape_dFt.SetSize(nd,dimc);
1959 if (el.
Space() == FunctionSpace::Pk)
1976 Trans.SetIntPoint (&ip);
1983 MQ->Eval(M,
Trans, ip);
1985 Mult(curlshape_dFt, M, curlshape);
1990 DQ->Eval(D,
Trans, ip);
1996 w *= Q->Eval(
Trans, ip);
2011 int tr_nd = trial_fe.
GetDof();
2012 int te_nd = test_fe.
GetDof();
2017 #ifdef MFEM_THREAD_SAFE 2019 DenseMatrix curlshape(tr_nd,dimc), curlshape_dFt(tr_nd,dimc), M;
2020 DenseMatrix te_curlshape(te_nd,dimc), te_curlshape_dFt(te_nd,dimc);
2022 curlshape.SetSize(tr_nd,dimc);
2023 curlshape_dFt.SetSize(tr_nd,dimc);
2024 te_curlshape.SetSize(te_nd,dimc);
2025 te_curlshape_dFt.
SetSize(te_nd,dimc);
2036 if (trial_fe.
Space() == FunctionSpace::Pk)
2052 Trans.SetIntPoint(&ip);
2060 MQ->Eval(M,
Trans, ip);
2062 Mult(te_curlshape_dFt, M, te_curlshape);
2063 AddMultABt(te_curlshape, curlshape_dFt, elmat);
2067 DQ->Eval(D,
Trans, ip);
2069 AddMultADBt(te_curlshape_dFt,D,curlshape_dFt,elmat);
2075 w *= Q->Eval(
Trans, ip);
2078 AddMultABt(te_curlshape_dFt, curlshape_dFt, elmat);
2083 void CurlCurlIntegrator
2088 #ifdef MFEM_THREAD_SAFE 2092 MFEM_VERIFY(ir == NULL,
"Integration rule (ir) must be NULL")
2097 projcurl.
Mult(
u, flux);
2106 int nd = fluxelem.
GetDof();
2109 #ifdef MFEM_THREAD_SAFE 2113 pointflux.SetSize(
dim);
2114 if (d_energy) { vec.SetSize(
dim); }
2116 int order = 2 * fluxelem.
GetOrder();
2119 double energy = 0.0;
2120 if (d_energy) { *d_energy = 0.0; }
2131 Trans.SetIntPoint(&ip);
2139 double e = w * (pointflux * pointflux);
2148 #if ANISO_EXPERIMENTAL 2152 Trans.Jacobian().MultTranspose(pointflux, pfluxes[i]);
2168 #if ANISO_EXPERIMENTAL 2172 int n = (int) round(pow(ir.
GetNPoints(), 1.0/3.0));
2176 for (
int k = 0; k < n; k++)
2177 for (
int l = 0; l < n; l++)
2178 for (
int m = 0; m < n; m++)
2180 Vector &vec = pfluxes[(k*n + l)*n + m];
2183 tmp = vec; tmp -= pfluxes[(k*n + l)*n + (m-1)];
2184 (*d_energy)[0] += (tmp * tmp);
2188 tmp = vec; tmp -= pfluxes[(k*n + (l-1))*n + m];
2189 (*d_energy)[1] += (tmp * tmp);
2193 tmp = vec; tmp -= pfluxes[((k-1)*n + l)*n + m];
2194 (*d_energy)[2] += (tmp * tmp);
2207 void VectorCurlCurlIntegrator::AssembleElementMatrix(
2212 int cld = (
dim*(
dim-1))/2;
2214 #ifdef MFEM_THREAD_SAFE 2218 dshape_hat.SetSize(dof,
dim);
2220 curlshape.SetSize(
dim*dof, cld);
2228 int order = 2 *
Trans.OrderGrad(&el);
2239 Trans.SetIntPoint(&ip);
2243 Mult(dshape_hat, Jadj, dshape);
2248 w *= Q->Eval(
Trans, ip);
2255 double VectorCurlCurlIntegrator::GetElementEnergy(
2261 #ifdef MFEM_THREAD_SAFE 2264 dshape_hat.SetSize(dof,
dim);
2267 grad_hat.SetSize(
dim);
2281 for (
int i = 0; i < ir->GetNPoints(); i++)
2286 MultAtB(elfun_mat, dshape_hat, grad_hat);
2292 Mult(grad_hat, Jadj, grad);
2296 double curl = grad(0,1) - grad(1,0);
2301 double curl_x = grad(2,1) - grad(1,2);
2302 double curl_y = grad(0,2) - grad(2,0);
2303 double curl_z = grad(1,0) - grad(0,1);
2304 w *= curl_x * curl_x + curl_y * curl_y + curl_z * curl_z;
2309 w *= Q->Eval(Tr, ip);
2315 elfun_mat.ClearExternalData();
2317 return 0.5 * energy;
2320 void MixedCurlIntegrator::AssembleElementMatrix2(
2325 int trial_dof = trial_fe.
GetDof();
2326 int test_dof = test_fe.
GetDof();
2327 int dimc = (
dim == 3) ? 3 : 1;
2331 "Trial finite element must be either 2D/3D H(Curl) or 2D H1");
2334 "Test finite element must be in H1/L2");
2340 dshape.SetSize(trial_dof,
dim);
2341 curlshape.SetSize(trial_dof,
dim);
2346 curlshape.SetSize(trial_dof,dimc);
2347 elmat_comp.SetSize(test_dof, trial_dof);
2349 elmat.
SetSize(dimc * test_dof, trial_dof);
2350 shape.SetSize(test_dof);
2366 Trans.SetIntPoint(&ip);
2370 dshape.GradToVectorCurl2D(curlshape);
2380 c *= Q->Eval(
Trans, ip);
2384 for (
int d = 0; d < dimc; ++d)
2386 double * curldata = &(curlshape.GetData())[d*trial_dof];
2387 for (
int jj = 0; jj < trial_dof; ++jj)
2389 for (
int ii = 0; ii < test_dof; ++ii)
2391 elmat(d * test_dof + ii, jj) += shape(ii) * curldata[jj];
2399 void VectorFEMassIntegrator::AssembleElementMatrix(
2405 int spaceDim =
Trans.GetSpaceDim();
2406 int vdim = std::max(spaceDim, el.
GetVDim());
2410 #ifdef MFEM_THREAD_SAFE 2411 Vector D(DQ ? DQ->GetVDim() : 0);
2413 DenseMatrix K(MQ ? MQ->GetVDim() : 0, MQ ? MQ->GetVDim() : 0);
2415 trial_vshape.
SetSize(dof, vdim);
2416 D.SetSize(DQ ? DQ->GetVDim() : 0);
2417 K.SetSize(MQ ? MQ->GetVDim() : 0, MQ ? MQ->GetVDim() : 0);
2419 DenseMatrix tmp(trial_vshape.Height(), K.Width());
2436 Trans.SetIntPoint (&ip);
2443 MQ->Eval(K,
Trans, ip);
2445 Mult(trial_vshape,K,tmp);
2450 DQ->Eval(D,
Trans, ip);
2458 w *= Q -> Eval (
Trans, ip);
2465 void VectorFEMassIntegrator::AssembleElementMatrix2(
2473 int spaceDim =
Trans.GetSpaceDim();
2474 int vdim = std::max(spaceDim, trial_fe.
GetVDim());
2475 int trial_dof = trial_fe.
GetDof();
2476 int test_dof = test_fe.
GetDof();
2479 #ifdef MFEM_THREAD_SAFE 2482 Vector D(DQ ? DQ->GetVDim() : 0);
2483 DenseMatrix K(MQ ? MQ->GetVDim() : 0, MQ ? MQ->GetVDim() : 0);
2485 trial_vshape.
SetSize(trial_dof, spaceDim);
2487 D.SetSize(DQ ? DQ->GetVDim() : 0);
2488 K.SetSize(MQ ? MQ->GetVDim() : 0, MQ ? MQ->GetVDim() : 0);
2491 elmat.
SetSize(vdim*test_dof, trial_dof);
2505 Trans.SetIntPoint (&ip);
2513 DQ->Eval(D,
Trans, ip);
2515 for (
int d = 0; d < vdim; d++)
2517 for (
int j = 0; j < test_dof; j++)
2519 for (
int k = 0; k < trial_dof; k++)
2521 elmat(d * test_dof + j, k) +=
2522 shape(j) * D(d) * trial_vshape(k, d);
2529 MQ->Eval(K,
Trans, ip);
2531 for (
int d = 0; d < vdim; d++)
2533 for (
int j = 0; j < test_dof; j++)
2535 for (
int k = 0; k < trial_dof; k++)
2538 for (
int vd = 0; vd < spaceDim; vd++)
2540 Kv += K(d, vd) * trial_vshape(k, vd);
2542 elmat(d * test_dof + j, k) += shape(j) * Kv;
2551 w *= Q->Eval(
Trans, ip);
2553 for (
int d = 0; d < vdim; d++)
2555 for (
int j = 0; j < test_dof; j++)
2557 for (
int k = 0; k < trial_dof; k++)
2559 elmat(d * test_dof + j, k) +=
2560 w * shape(j) * trial_vshape(k, d);
2567 else if (test_fe.
GetRangeType() == FiniteElement::VECTOR
2571 int spaceDim =
Trans.GetSpaceDim();
2572 int trial_vdim = std::max(spaceDim, trial_fe.
GetVDim());
2573 int test_vdim = std::max(spaceDim, test_fe.
GetVDim());
2574 int trial_dof = trial_fe.
GetDof();
2575 int test_dof = test_fe.
GetDof();
2578 #ifdef MFEM_THREAD_SAFE 2581 Vector D(DQ ? DQ->GetVDim() : 0);
2582 DenseMatrix K(MQ ? MQ->GetVDim() : 0, MQ ? MQ->GetVDim() : 0);
2584 trial_vshape.
SetSize(trial_dof,trial_vdim);
2585 test_vshape.
SetSize(test_dof,test_vdim);
2586 D.SetSize(DQ ? DQ->GetVDim() : 0);
2587 K.SetSize(MQ ? MQ->GetVDim() : 0, MQ ? MQ->GetVDim() : 0);
2591 elmat.
SetSize (test_dof, trial_dof);
2605 Trans.SetIntPoint (&ip);
2613 MQ->Eval(K,
Trans, ip);
2615 Mult(test_vshape,K,tmp);
2620 DQ->Eval(D,
Trans, ip);
2628 w *= Q -> Eval (
Trans, ip);
2636 mfem_error(
"VectorFEMassIntegrator::AssembleElementMatrix2(...)\n" 2637 " is not implemented for given trial and test bases.");
2641 void VectorDivergenceIntegrator::AssembleElementMatrix2(
2648 int trial_dof = trial_fe.
GetDof();
2649 int test_dof = test_fe.
GetDof();
2652 dshape.SetSize (trial_dof,
dim);
2653 gshape.SetSize (trial_dof,
dim);
2655 divshape.SetSize (
dim*trial_dof);
2656 shape.SetSize (test_dof);
2665 for (
int i = 0; i < ir -> GetNPoints(); i++)
2672 Trans.SetIntPoint (&ip);
2675 Mult (dshape, Jadj, gshape);
2677 gshape.GradToDiv (divshape);
2682 c *= Q -> Eval (
Trans, ip);
2701 void DivDivIntegrator::AssembleElementMatrix(
2709 #ifdef MFEM_THREAD_SAFE 2725 for (
int i = 0; i < ir -> GetNPoints(); i++)
2731 Trans.SetIntPoint (&ip);
2736 c *= Q -> Eval (
Trans, ip);
2744 void DivDivIntegrator::AssembleElementMatrix2(
2750 int tr_nd = trial_fe.
GetDof();
2751 int te_nd = test_fe.
GetDof();
2754 #ifdef MFEM_THREAD_SAFE 2756 Vector te_divshape(te_nd);
2766 int order = 2 * max(test_fe.
GetOrder(),
2773 for (
int i = 0; i < ir -> GetNPoints(); i++)
2780 Trans.SetIntPoint (&ip);
2785 c *= Q -> Eval (
Trans, ip);
2793 void VectorDiffusionIntegrator::AssembleElementMatrix(
2798 const int dof = el.
GetDof();
2800 sdim =
Trans.GetSpaceDim();
2803 vdim = (vdim <= 0) ? sdim : vdim;
2804 const bool square = (
dim == sdim);
2808 vcoeff.SetSize(vdim);
2812 mcoeff.SetSize(vdim);
2815 dshape.SetSize(dof,
dim);
2816 dshapedxt.SetSize(dof, sdim);
2819 pelmat.SetSize(dof);
2829 for (
int i = 0; i < ir -> GetNPoints(); i++)
2835 Trans.SetIntPoint(&ip);
2836 double w =
Trans.Weight();
2837 w = ip.
weight / (square ? w : w*w*w);
2840 Mult(dshape,
Trans.AdjugateJacobian(), dshapedxt);
2844 VQ->Eval(vcoeff,
Trans, ip);
2845 for (
int k = 0; k < vdim; ++k)
2853 MQ->Eval(mcoeff,
Trans, ip);
2854 for (
int ii = 0; ii < vdim; ++ii)
2856 for (
int jj = 0; jj < vdim; ++jj)
2858 Mult_a_AAt(w*mcoeff(ii,jj), dshapedxt, pelmat);
2859 elmat.
AddMatrix(pelmat, dof*ii, dof*jj);
2865 if (Q) { w *= Q->Eval(
Trans, ip); }
2867 for (
int k = 0; k < vdim; ++k)
2875 void VectorDiffusionIntegrator::AssembleElementVector(
2879 const int dof = el.
GetDof();
2884 vdim = (vdim <= 0) ? sdim : vdim;
2885 const bool square = (
dim == sdim);
2889 vcoeff.SetSize(vdim);
2893 mcoeff.SetSize(vdim);
2896 dshape.SetSize(dof,
dim);
2897 dshapedxt.SetSize(dof,
dim);
2915 for (
int i = 0; i < ir->GetNPoints(); i++)
2922 w = ip.
weight / (square ? w : w*w*w);
2928 VQ->Eval(vcoeff, Tr, ip);
2929 for (
int k = 0; k < vdim; ++k)
2931 pelmat *= w*vcoeff(k);
2932 const Vector vec_in(mat_in.GetColumn(k), dof);
2933 Vector vec_out(mat_out.GetColumn(k), dof);
2934 pelmat.AddMult(vec_in, vec_out);
2939 MQ->Eval(mcoeff, Tr, ip);
2940 for (
int ii = 0; ii < vdim; ++ii)
2942 Vector vec_out(mat_out.GetColumn(ii), dof);
2943 for (
int jj = 0; jj < vdim; ++jj)
2945 pelmat *= w*mcoeff(ii,jj);
2946 const Vector vec_in(mat_in.GetColumn(jj), dof);
2947 pelmat.Mult(vec_in, vec_out);
2953 if (Q) { w *= Q->Eval(Tr, ip); }
2955 for (
int k = 0; k < vdim; ++k)
2957 const Vector vec_in(mat_in.GetColumn(k), dof);
2958 Vector vec_out(mat_out.GetColumn(k), dof);
2959 pelmat.AddMult(vec_in, vec_out);
2966 void ElasticityIntegrator::AssembleElementMatrix(
2973 MFEM_ASSERT(
dim ==
Trans.GetSpaceDim(),
"");
2975 #ifdef MFEM_THREAD_SAFE 2979 dshape.SetSize(dof,
dim);
2980 gshape.SetSize(dof,
dim);
2981 pelmat.SetSize(dof);
2990 int order = 2 *
Trans.OrderGrad(&el);
2996 for (
int i = 0; i < ir -> GetNPoints(); i++)
3002 Trans.SetIntPoint(&ip);
3004 Mult(dshape,
Trans.InverseJacobian(), gshape);
3006 gshape.GradToDiv (divshape);
3011 L = lambda->Eval(
Trans, ip);
3026 for (
int d = 0; d <
dim; d++)
3028 for (
int k = 0; k < dof; k++)
3029 for (
int l = 0; l < dof; l++)
3031 elmat (dof*d+k, dof*d+l) += (M * w) * pelmat(k, l);
3034 for (
int ii = 0; ii <
dim; ii++)
3035 for (
int jj = 0; jj <
dim; jj++)
3037 for (
int kk = 0; kk < dof; kk++)
3038 for (
int ll = 0; ll < dof; ll++)
3040 elmat(dof*ii+kk, dof*jj+ll) +=
3041 (M * w) * gshape(kk, jj) * gshape(ll, ii);
3048 void ElasticityIntegrator::ComputeElementFlux(
3053 const int dof = el.
GetDof();
3055 const int tdim =
dim*(
dim+1)/2;
3058 MFEM_ASSERT(
dim == 2 ||
dim == 3,
3059 "dimension is not supported: dim = " <<
dim);
3060 MFEM_ASSERT(
dim ==
Trans.GetSpaceDim(),
"");
3061 MFEM_ASSERT(fluxelem.
GetMapType() == FiniteElement::VALUE,
"");
3062 MFEM_ASSERT(dynamic_cast<const NodalFiniteElement*>(&fluxelem),
"");
3064 #ifdef MFEM_THREAD_SAFE 3070 double gh_data[9], grad_data[9];
3082 for (
int i = 0; i < fnd; i++)
3086 MultAtB(loc_data_mat, dshape, gh);
3088 Trans.SetIntPoint(&ip);
3089 Mult(gh,
Trans.InverseJacobian(), grad);
3094 L = lambda->Eval(
Trans, ip);
3104 const double M2 = 2.0*M;
3107 L *= (grad(0,0) + grad(1,1));
3109 flux(i+fnd*0) = M2*grad(0,0) + L;
3110 flux(i+fnd*1) = M2*grad(1,1) + L;
3111 flux(i+fnd*2) = M*(grad(0,1) + grad(1,0));
3115 L *= (grad(0,0) + grad(1,1) + grad(2,2));
3117 flux(i+fnd*0) = M2*grad(0,0) + L;
3118 flux(i+fnd*1) = M2*grad(1,1) + L;
3119 flux(i+fnd*2) = M2*grad(2,2) + L;
3120 flux(i+fnd*3) = M*(grad(0,1) + grad(1,0));
3121 flux(i+fnd*4) = M*(grad(0,2) + grad(2,0));
3122 flux(i+fnd*5) = M*(grad(1,2) + grad(2,1));
3131 const int dof = fluxelem.
GetDof();
3133 const int tdim =
dim*(
dim+1)/2;
3138 MFEM_ASSERT(d_energy == NULL,
"anisotropic estimates are not supported");
3139 MFEM_ASSERT(flux.
Size() == dof*tdim,
"invalid 'flux' vector");
3141 #ifndef MFEM_THREAD_SAFE 3146 double pointstress_data[6];
3147 Vector pointstress(pointstress_data, tdim);
3158 int order = 2 *
Trans.OrderGrad(&fluxelem);
3162 double energy = 0.0;
3164 for (
int i = 0; i < ir->GetNPoints(); i++)
3169 flux_mat.MultTranspose(shape, pointstress);
3171 Trans.SetIntPoint(&ip);
3177 L = lambda->Eval(
Trans, ip);
3197 const double *
s = pointstress_data;
3201 const double tr_e = (
s[0] +
s[1])/(2*(M + L));
3203 pt_e = (0.25/M)*(
s[0]*(
s[0] - L) +
s[1]*(
s[1] - L) + 2*
s[2]*
s[2]);
3208 const double tr_e = (
s[0] +
s[1] +
s[2])/(2*M + 3*L);
3210 pt_e = (0.25/M)*(
s[0]*(
s[0] - L) +
s[1]*(
s[1] - L) +
s[2]*(
s[2] - L) +
3211 2*(
s[3]*
s[3] +
s[4]*
s[4] +
s[5]*
s[5]));
3233 if (
Trans.Elem2No >= 0)
3242 shape1.SetSize(ndof1);
3243 shape2.SetSize(ndof2);
3252 if (
Trans.Elem2No >= 0)
3253 order = (min(
Trans.Elem1->OrderW(),
Trans.Elem2->OrderW()) +
3259 if (el1.
Space() == FunctionSpace::Pk)
3271 Trans.SetAllIntPoints(&ip);
3280 u->Eval(vu, *
Trans.Elem1, eip1);
3284 nor(0) = 2*eip1.
x - 1.0;
3293 b = beta * fabs(un);
3301 if (un >= 0.0 && ndof2)
3303 rho_p = rho->Eval(*
Trans.Elem2, eip2);
3307 rho_p = rho->Eval(*
Trans.Elem1, eip1);
3316 for (
int i = 0; i < ndof1; i++)
3317 for (
int j = 0; j < ndof1; j++)
3319 elmat(i, j) += w * shape1(i) * shape1(j);
3328 for (
int i = 0; i < ndof2; i++)
3329 for (
int j = 0; j < ndof1; j++)
3331 elmat(ndof1+i, j) -= w * shape2(i) * shape1(j);
3337 for (
int i = 0; i < ndof2; i++)
3338 for (
int j = 0; j < ndof2; j++)
3340 elmat(ndof1+i, ndof1+j) += w * shape2(i) * shape2(j);
3343 for (
int i = 0; i < ndof1; i++)
3344 for (
int j = 0; j < ndof2; j++)
3346 elmat(i, ndof1+j) -= w * shape1(i) * shape2(j);
3357 int int_order = T.Elem1->OrderW() + 2*order;
3361 void DGDiffusionIntegrator::AssembleFaceMatrix(
3365 int dim, ndof1, ndof2, ndofs;
3366 bool kappa_is_nonzero = (
kappa != 0.);
3381 shape1.SetSize(ndof1);
3382 dshape1.SetSize(ndof1,
dim);
3383 dshape1dn.SetSize(ndof1);
3384 if (
Trans.Elem2No >= 0)
3387 shape2.SetSize(ndof2);
3388 dshape2.SetSize(ndof2,
dim);
3389 dshape2dn.SetSize(ndof2);
3396 ndofs = ndof1 + ndof2;
3399 if (kappa_is_nonzero)
3428 Trans.SetAllIntPoints(&ip);
3437 nor(0) = 2*eip1.
x - 1.0;
3455 w *= Q->Eval(*
Trans.Elem1, eip1);
3462 MQ->Eval(mq, *
Trans.Elem1, eip1);
3463 mq.MultTranspose(nh, ni);
3467 if (kappa_is_nonzero)
3482 dshape1.Mult(nh, dshape1dn);
3483 for (
int i = 0; i < ndof1; i++)
3484 for (
int j = 0; j < ndof1; j++)
3486 elmat(i, j) += shape1(i) * dshape1dn(j);
3498 w *= Q->Eval(*
Trans.Elem2, eip2);
3505 MQ->Eval(mq, *
Trans.Elem2, eip2);
3506 mq.MultTranspose(nh, ni);
3510 if (kappa_is_nonzero)
3515 dshape2.Mult(nh, dshape2dn);
3517 for (
int i = 0; i < ndof1; i++)
3518 for (
int j = 0; j < ndof2; j++)
3520 elmat(i, ndof1 + j) += shape1(i) * dshape2dn(j);
3523 for (
int i = 0; i < ndof2; i++)
3524 for (
int j = 0; j < ndof1; j++)
3526 elmat(ndof1 + i, j) -= shape2(i) * dshape1dn(j);
3529 for (
int i = 0; i < ndof2; i++)
3530 for (
int j = 0; j < ndof2; j++)
3532 elmat(ndof1 + i, ndof1 + j) -= shape2(i) * dshape2dn(j);
3536 if (kappa_is_nonzero)
3540 for (
int i = 0; i < ndof1; i++)
3542 const double wsi = wq*shape1(i);
3543 for (
int j = 0; j <= i; j++)
3545 jmat(i, j) += wsi * shape1(j);
3550 for (
int i = 0; i < ndof2; i++)
3552 const int i2 = ndof1 + i;
3553 const double wsi = wq*shape2(i);
3554 for (
int j = 0; j < ndof1; j++)
3556 jmat(i2, j) -= wsi * shape1(j);
3558 for (
int j = 0; j <= i; j++)
3560 jmat(i2, ndof1 + j) += wsi * shape2(j);
3568 if (kappa_is_nonzero)
3570 for (
int i = 0; i < ndofs; i++)
3572 for (
int j = 0; j < i; j++)
3574 double aij = elmat(i,j), aji = elmat(j,i), mij = jmat(i,j);
3575 elmat(i,j) =
sigma*aji - aij + mij;
3576 elmat(j,i) =
sigma*aij - aji + mij;
3578 elmat(i,i) = (
sigma - 1.)*elmat(i,i) + jmat(i,i);
3583 for (
int i = 0; i < ndofs; i++)
3585 for (
int j = 0; j < i; j++)
3587 double aij = elmat(i,j), aji = elmat(j,i);
3588 elmat(i,j) =
sigma*aji - aij;
3589 elmat(j,i) =
sigma*aij - aji;
3591 elmat(i,i) *= (
sigma - 1.);
3598 void DGElasticityIntegrator::AssembleBlock(
3599 const int dim,
const int row_ndofs,
const int col_ndofs,
3600 const int row_offset,
const int col_offset,
3601 const double jmatcoef,
const Vector &col_nL,
const Vector &col_nM,
3606 for (
int jm = 0, j = col_offset; jm <
dim; ++jm)
3608 for (
int jdof = 0; jdof < col_ndofs; ++jdof, ++j)
3610 const double t2 = col_dshape_dnM(jdof);
3611 for (
int im = 0, i = row_offset; im <
dim; ++im)
3613 const double t1 = col_dshape(jdof, jm) * col_nL(im);
3614 const double t3 = col_dshape(jdof, im) * col_nM(jm);
3615 const double tt = t1 + ((im == jm) ? t2 : 0.0) + t3;
3616 for (
int idof = 0; idof < row_ndofs; ++idof, ++i)
3618 elmat(i, j) += row_shape(idof) * tt;
3624 if (jmatcoef == 0.0) {
return; }
3626 for (
int d = 0; d <
dim; ++d)
3628 const int jo = col_offset + d*col_ndofs;
3629 const int io = row_offset + d*row_ndofs;
3630 for (
int jdof = 0, j = jo; jdof < col_ndofs; ++jdof, ++j)
3632 const double sj = jmatcoef * col_shape(jdof);
3633 for (
int i = max(io,j), idof = i - io; idof < row_ndofs; ++idof, ++i)
3635 jmat(i, j) += row_shape(idof) * sj;
3641 void DGElasticityIntegrator::AssembleFaceMatrix(
3645 #ifdef MFEM_THREAD_SAFE 3654 Vector dshape1_dnM, dshape2_dnM;
3659 const int ndofs1 = el1.
GetDof();
3660 const int ndofs2 = (
Trans.Elem2No >= 0) ? el2.
GetDof() : 0;
3661 const int nvdofs =
dim*(ndofs1 + ndofs2);
3671 const bool kappa_is_nonzero = (
kappa != 0.0);
3672 if (kappa_is_nonzero)
3705 for (
int pind = 0; pind < ir->
GetNPoints(); ++pind)
3710 Trans.SetAllIntPoints(&ip);
3721 Mult(dshape1, adjJ, dshape1_ps);
3725 nor(0) = 2*eip1.
x - 1.0;
3738 Mult(dshape2, adjJ, dshape2_ps);
3741 const double w2 = w /
Trans.Elem2->Weight();
3742 const double wL2 = w2 * lambda->Eval(*
Trans.Elem2, eip2);
3743 const double wM2 = w2 *
mu->Eval(*
Trans.Elem2, eip2);
3746 wLM = (wL2 + 2.0*wM2);
3747 dshape2_ps.
Mult(nM2, dshape2_dnM);
3756 const double w1 = w /
Trans.Elem1->Weight();
3757 const double wL1 = w1 * lambda->Eval(*
Trans.Elem1, eip1);
3758 const double wM1 = w1 *
mu->Eval(*
Trans.Elem1, eip1);
3761 wLM += (wL1 + 2.0*wM1);
3762 dshape1_ps.
Mult(nM1, dshape1_dnM);
3765 const double jmatcoef =
kappa * (nor*nor) * wLM;
3769 dim, ndofs1, ndofs1, 0, 0, jmatcoef, nL1, nM1,
3770 shape1, shape1, dshape1_dnM, dshape1_ps, elmat, jmat);
3772 if (ndofs2 == 0) {
continue; }
3779 dim, ndofs1, ndofs2, 0,
dim*ndofs1, jmatcoef, nL2, nM2,
3780 shape1, shape2, dshape2_dnM, dshape2_ps, elmat, jmat);
3783 dim, ndofs2, ndofs1,
dim*ndofs1, 0, jmatcoef, nL1, nM1,
3784 shape2, shape1, dshape1_dnM, dshape1_ps, elmat, jmat);
3787 dim, ndofs2, ndofs2,
dim*ndofs1,
dim*ndofs1, jmatcoef, nL2, nM2,
3788 shape2, shape2, dshape2_dnM, dshape2_ps, elmat, jmat);
3792 if (kappa_is_nonzero)
3794 for (
int i = 0; i < nvdofs; ++i)
3796 for (
int j = 0; j < i; ++j)
3798 double aij = elmat(i,j), aji = elmat(j,i), mij = jmat(i,j);
3799 elmat(i,j) =
alpha*aji - aij + mij;
3800 elmat(j,i) =
alpha*aij - aji + mij;
3802 elmat(i,i) = (
alpha - 1.)*elmat(i,i) + jmat(i,i);
3807 for (
int i = 0; i < nvdofs; ++i)
3809 for (
int j = 0; j < i; ++j)
3811 double aij = elmat(i,j), aji = elmat(j,i);
3812 elmat(i,j) =
alpha*aji - aij;
3813 elmat(j,i) =
alpha*aij - aji;
3815 elmat(i,i) *= (
alpha - 1.);
3821 void TraceJumpIntegrator::AssembleFaceMatrix(
3826 int i, j, face_ndof, ndof1, ndof2;
3831 face_ndof = trial_face_fe.
GetDof();
3832 ndof1 = test_fe1.
GetDof();
3834 face_shape.SetSize(face_ndof);
3835 shape1.SetSize(ndof1);
3837 if (
Trans.Elem2No >= 0)
3839 ndof2 = test_fe2.
GetDof();
3840 shape2.SetSize(ndof2);
3847 elmat.
SetSize(ndof1 + ndof2, face_ndof);
3853 if (
Trans.Elem2No >= 0)
3862 if (trial_face_fe.
GetMapType() == FiniteElement::VALUE)
3864 order +=
Trans.OrderW();
3874 Trans.SetAllIntPoints(&ip);
3882 trial_face_fe.
CalcShape(ip, face_shape);
3891 if (trial_face_fe.
GetMapType() == FiniteElement::VALUE)
3893 w *=
Trans.Weight();
3896 for (i = 0; i < ndof1; i++)
3897 for (j = 0; j < face_ndof; j++)
3899 elmat(i, j) += shape1(i) * face_shape(j);
3904 for (i = 0; i < ndof2; i++)
3905 for (j = 0; j < face_ndof; j++)
3907 elmat(ndof1+i, j) -= shape2(i) * face_shape(j);
3913 void NormalTraceJumpIntegrator::AssembleFaceMatrix(
3918 int i, j, face_ndof, ndof1, ndof2,
dim;
3921 MFEM_VERIFY(trial_face_fe.
GetMapType() == FiniteElement::VALUE,
"");
3923 face_ndof = trial_face_fe.
GetDof();
3924 ndof1 = test_fe1.
GetDof();
3927 face_shape.SetSize(face_ndof);
3928 normal.SetSize(
dim);
3929 shape1.SetSize(ndof1,
dim);
3930 shape1_n.SetSize(ndof1);
3932 if (
Trans.Elem2No >= 0)
3934 ndof2 = test_fe2.
GetDof();
3935 shape2.SetSize(ndof2,
dim);
3936 shape2_n.SetSize(ndof2);
3943 elmat.
SetSize(ndof1 + ndof2, face_ndof);
3949 if (
Trans.Elem2No >= 0)
3966 trial_face_fe.
CalcShape(ip, face_shape);
3967 Trans.Loc1.Transf.SetIntPoint(&ip);
3970 Trans.Loc1.Transform(ip, eip1);
3972 shape1.Mult(normal, shape1_n);
3976 Trans.Loc2.Transform(ip, eip2);
3978 Trans.Loc2.Transf.SetIntPoint(&ip);
3980 shape2.Mult(normal, shape2_n);
3983 for (i = 0; i < ndof1; i++)
3984 for (j = 0; j < face_ndof; j++)
3986 elmat(i, j) += shape1_n(i) * face_shape(j);
3991 for (i = 0; i < ndof2; i++)
3992 for (j = 0; j < face_ndof; j++)
3994 elmat(ndof1+i, j) -= shape2_n(i) * face_shape(j);
4001 void NormalInterpolator::AssembleElementMatrix2(
4005 int spaceDim =
Trans.GetSpaceDim();
4010 for (
int i = 0; i < ran_nodes.Size(); i++)
4013 Trans.SetIntPoint(&ip);
4016 for (
int j = 0; j < shape.Size(); j++)
4018 for (
int d = 0; d < spaceDim; d++)
4020 elmat(i, j+d*shape.Size()) = shape(j)*n(d);
4040 using VectorCoefficient::Eval;
4041 virtual void Eval(Vector &V, ElementTransformation &T,
4042 const IntegrationPoint &ip)
4058 internal::ShapeCoefficient dom_shape_coeff(*Q, dom_fe);
4069 ScalarVectorProductInterpolator::AssembleElementMatrix2(
4093 VShapeCoefficient dom_shape_coeff(*Q, dom_fe,
Trans.GetSpaceDim());
4104 VectorScalarProductInterpolator::AssembleElementMatrix2(
4119 vc(width), shape(height) { }
4131 VecShapeCoefficient dom_shape_coeff(*VQ, dom_fe);
4142 ScalarCrossProductInterpolator::AssembleElementMatrix2(
4160 using VectorCoefficient::Eval;
4167 for (
int k = 0; k < vdim; k++)
4169 V(k) = vc(0) * vshape(k,1) - vc(1) * vshape(k,0);
4174 VCrossVShapeCoefficient dom_shape_coeff(*VQ, dom_fe);
4184 VectorCrossProductInterpolator::AssembleElementMatrix2(
4200 vshape(height, width), vc(width)
4202 MFEM_ASSERT(width == 3,
"");
4211 for (
int k = 0; k < height; k++)
4213 M(k,0) = vc(1) * vshape(k,2) - vc(2) * vshape(k,1);
4214 M(k,1) = vc(2) * vshape(k,0) - vc(0) * vshape(k,2);
4215 M(k,2) = vc(0) * vshape(k,1) - vc(1) * vshape(k,0);
4220 VCrossVShapeCoefficient dom_shape_coeff(*VQ, dom_fe);
4251 vshape(vdim, vq.GetVDim()), vc(vq.GetVDim()) { }
4253 using VectorCoefficient::Eval;
4254 virtual void Eval(Vector &V, ElementTransformation &T,
4255 const IntegrationPoint &ip)
4267 VectorInnerProductInterpolator::AssembleElementMatrix2(
4273 internal::VDotVShapeCoefficient dom_shape_coeff(*VQ, dom_fe);
Abstract class for all finite elements.
void MultABt(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &ABt)
Multiply a matrix A with the transpose of a matrix B: A*Bt.
int GetNPoints() const
Returns the number of the points in the integration rule.
void AddMultVWt(const Vector &v, const Vector &w, DenseMatrix &VWt)
VWt += v w^t.
Class for an integration rule - an Array of IntegrationPoint.
void NewDataAndSize(double *d, int s)
Set the Vector data and size, deleting the old data, if owned.
void MultVWt(const Vector &v, const Vector &w, DenseMatrix &VWt)
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
Base class for vector Coefficients that optionally depend on time and space.
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the vector coefficient in the element described by T at the point ip, storing the result in ...
void SetSize(int s)
Resize the vector to size s.
int Space() const
Returns the type of FunctionSpace on the element.
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
int GetCurlDim() const
Returns the dimension of the curl for vector-valued finite elements.
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
void CalcAdjugate(const DenseMatrix &a, DenseMatrix &adja)
int Size() const
Returns the size of the vector.
Data type dense matrix using column-major storage.
double * Data() const
Returns the matrix data array.
IntegrationRules RefinedIntRules(1, Quadrature1D::GaussLegendre)
A global object with all refined integration rules.
void CalcPhysVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Equivalent to the CalcVShape() method with the same arguments.
void AddMult_a_ABt(double a, const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &ABt)
ABt += a * A * B^t.
void CalcOrtho(const DenseMatrix &J, Vector &n)
void Mult_a_AAt(double a, const DenseMatrix &A, DenseMatrix &AAt)
AAt = a * A * A^t.
void add(const Vector &v1, const Vector &v2, Vector &v)
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference element.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
double * GetData() const
Returns the matrix data array.
void Reset(double *d, int h, int w)
Change the data array and the size of the DenseMatrix.
void MultTranspose(const double *x, double *y) const
Multiply a vector with the transpose matrix.
void mfem_error(const char *msg)
Function called when an error is encountered. Used by the macros MFEM_ABORT, MFEM_ASSERT, MFEM_VERIFY.
void AddMult_a_VWt(const double a, const Vector &v, const Vector &w, DenseMatrix &VWt)
VWt += a * v w^t.
double InnerProduct(const double *x, const double *y) const
Compute y^t A x.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const =0
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
void Invert()
Replaces the current matrix with its inverse.
virtual void CalcPhysCurlShape(ElementTransformation &Trans, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in physical space at the point de...
void AddMult_a_VVt(const double a, const Vector &v, DenseMatrix &VVt)
VVt += a * v v^t.
int GetVDim()
Returns dimension of the vector.
void Mult(const double *x, double *y) const
Matrix vector multiplication.
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Compute the discrete curl matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
void CalcPhysDShape(ElementTransformation &Trans, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in physical space at the poi...
double * GetData() const
Return a pointer to the beginning of the Vector data.
void CalcInverse(const DenseMatrix &a, DenseMatrix &inva)
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Given a matrix coefficient and a transformation, compute an approximation ("projection") in the local...
double p(const Vector &x, double t)
void Transpose()
(*this) = (*this)^t
int GetDim() const
Returns the reference space dimension for the finite element.
void MultVVt(const Vector &v, DenseMatrix &vvt)
Make a matrix from a vector V.Vt.
ComplexDenseMatrix * MultAtB(const ComplexDenseMatrix &A, const ComplexDenseMatrix &B)
Multiply the complex conjugate transpose of a matrix A with a matrix B. A^H*B.
void AddMultABt(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &ABt)
ABt += A * B^t.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
Base class for Matrix Coefficients that optionally depend on time and space.
void MultAAt(const DenseMatrix &a, DenseMatrix &aat)
Calculate the matrix A.At.
void GetColumnReference(int c, Vector &col)
void AddMatrix(DenseMatrix &A, int ro, int co)
Perform (ro+i,co+j)+=A(i,j) for 0<=i<A.Height, 0<=j<A.Width.
int GetDof() const
Returns the number of degrees of freedom in the finite element.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
void SetDataAndSize(double *d, int s)
Set the Vector data and size.
Vector & Set(const double a, const Vector &x)
(*this) = a * x
const IntegrationRule & GetRule(const Integrator &integ, const FiniteElement &trial_fe, const FiniteElement &test_fe, ElementTransformation &Trans)
void CalcPhysShape(ElementTransformation &Trans, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in physical space at the point ...
void AddMultADBt(const DenseMatrix &A, const Vector &D, const DenseMatrix &B, DenseMatrix &ADBt)
ADBt = A D B^t, where D is diagonal.
Class for integration point with weight.
int GetVDim() const
Returns the vector dimension for vector-valued finite elements.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
void GradToCurl(DenseMatrix &curl)
int GetMapType() const
Returns the FiniteElement::MapType of the element describing how reference functions are mapped to ph...
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the coefficient in the element described by T at the point ip.
void AddMultADAt(const DenseMatrix &A, const Vector &D, DenseMatrix &ADAt)
ADAt += A D A^t, where D is diagonal.
int GetRangeType() const
Returns the FiniteElement::RangeType of the element, one of {SCALAR, VECTOR}.
double u(const Vector &xvec)
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
const IntegrationRule & GetNodes() const
Get a const reference to the nodes of the element.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const =0
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
void AddMult_a_AAt(double a, const DenseMatrix &A, DenseMatrix &AAt)
AAt += a * A * A^t.
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
void Neg()
(*this) = -(*this)
double sigma(const Vector &x)