22 MFEM_ABORT(
"the assembly level has already been set!");
37 mfem_error(
"Unknown assembly level for this form.");
79 MFEM_ABORT(
"internal MFEM error");
90 MFEM_VERIFY(!
fnfi.Size(),
"Interior faces terms not yet implemented!");
91 MFEM_VERIFY(!
bfnfi.Size(),
"Boundary face terms not yet implemented!");
109 for (
int k = 0; k <
dnfi.Size(); k++)
117 MFEM_ASSERT(marker.
Size() == attr_marker.
Size(),
118 "invalid marker for domain integrator #"
119 << k <<
", counting from zero");
120 for (
int i = 0; i < attr_marker.
Size(); i++)
122 attr_marker[i] |= marker[i];
126 for (
int i = 0; i <
fes->
GetNE(); i++)
129 if (attr_marker[attr-1] == 0) {
continue; }
136 for (
int k = 0; k <
dnfi.Size(); k++)
141 energy +=
dnfi[k]->GetElementEnergy(*fe, *T, el_x);
152 for (
int k = 0; k <
bnfi.Size(); k++)
160 MFEM_ASSERT(bdr_marker.
Size() == bdr_attr_marker.
Size(),
161 "invalid boundary marker for boundary integrator #"
162 << k <<
", counting from zero");
163 for (
int i = 0; i < bdr_attr_marker.
Size(); i++)
165 bdr_attr_marker[i] |= bdr_marker[i];
172 if (bdr_attr_marker[bdr_attr-1] == 0) {
continue; }
179 for (
int k = 0; k <
bnfi.Size(); k++)
184 energy +=
bnfi[k]->GetElementEnergy(*fe, *T, el_x);
192 MFEM_ABORT(
"TODO: add energy contribution from interior face terms");
197 MFEM_ABORT(
"TODO: add energy contribution from boundary face terms");
205 MFEM_VERIFY(x.
Size() ==
Width(),
"invalid input Vector size");
233 mfem::forall(N, [=] MFEM_HOST_DEVICE (
int i) { Y[tdof[i]] = 0.0; });
254 for (
int k = 0; k <
dnfi.Size(); k++)
262 MFEM_ASSERT(marker.
Size() == attr_marker.
Size(),
263 "invalid marker for domain integrator #"
264 << k <<
", counting from zero");
265 for (
int i = 0; i < attr_marker.
Size(); i++)
267 attr_marker[i] |= marker[i];
271 for (
int i = 0; i <
fes->
GetNE(); i++)
274 if (attr_marker[attr-1] == 0) {
continue; }
281 for (
int k = 0; k <
dnfi.Size(); k++)
286 dnfi[k]->AssembleElementVector(*fe, *T, el_x, el_y);
299 for (
int k = 0; k <
bnfi.Size(); k++)
307 MFEM_ASSERT(bdr_marker.
Size() == bdr_attr_marker.
Size(),
308 "invalid boundary marker for boundary integrator #"
309 << k <<
", counting from zero");
310 for (
int i = 0; i < bdr_attr_marker.
Size(); i++)
312 bdr_attr_marker[i] |= bdr_marker[i];
319 if (bdr_attr_marker[bdr_attr-1] == 0) {
continue; }
326 for (
int k = 0; k <
bnfi.Size(); k++)
331 bnfi[k]->AssembleElementVector(*fe, *T, el_x, el_y);
358 for (
int k = 0; k <
fnfi.Size(); k++)
360 fnfi[k]->AssembleFaceVector(*fe1, *fe2, *tr, el_x, el_y);
376 for (
int k = 0; k <
bfnfi.Size(); k++)
384 MFEM_ASSERT(bdr_marker.
Size() == bdr_attr_marker.
Size(),
385 "invalid boundary marker for boundary face integrator #"
386 << k <<
", counting from zero");
387 for (
int i = 0; i < bdr_attr_marker.
Size(); i++)
389 bdr_attr_marker[i] |= bdr_marker[i];
393 for (
int i = 0; i <
fes -> GetNBE(); i++)
396 if (bdr_attr_marker[bdr_attr-1] == 0) {
continue; }
409 for (
int k = 0; k <
bfnfi.Size(); k++)
414 bfnfi[k]->AssembleFaceVector(*fe1, *fe2, *tr, el_x, el_y);
448 const int skip_zeros = 0;
473 for (
int k = 0; k <
dnfi.Size(); k++)
481 MFEM_ASSERT(marker.
Size() == attr_marker.
Size(),
482 "invalid marker for domain integrator #"
483 << k <<
", counting from zero");
484 for (
int i = 0; i < attr_marker.
Size(); i++)
486 attr_marker[i] |= marker[i];
490 for (
int i = 0; i <
fes->
GetNE(); i++)
493 if (attr_marker[attr-1] == 0) {
continue; }
500 for (
int k = 0; k <
dnfi.Size(); k++)
505 dnfi[k]->AssembleElementGrad(*fe, *T, el_x, elmat);
519 for (
int k = 0; k <
bnfi.Size(); k++)
527 MFEM_ASSERT(bdr_marker.
Size() == bdr_attr_marker.
Size(),
528 "invalid boundary marker for boundary integrator #"
529 << k <<
", counting from zero");
530 for (
int i = 0; i < bdr_attr_marker.
Size(); i++)
532 bdr_attr_marker[i] |= bdr_marker[i];
539 if (bdr_attr_marker[bdr_attr-1] == 0) {
continue; }
546 for (
int k = 0; k <
bnfi.Size(); k++)
551 bnfi[k]->AssembleElementGrad(*fe, *T, el_x, elmat);
578 for (
int k = 0; k <
fnfi.Size(); k++)
580 fnfi[k]->AssembleFaceGrad(*fe1, *fe2, *tr, el_x, elmat);
596 for (
int k = 0; k <
bfnfi.Size(); k++)
604 MFEM_ASSERT(bdr_marker.
Size() == bdr_attr_marker.
Size(),
605 "invalid boundary marker for boundary face integrator #"
606 << k <<
", counting from zero");
607 for (
int i = 0; i < bdr_attr_marker.
Size(); i++)
609 bdr_attr_marker[i] |= bdr_marker[i];
613 for (
int i = 0; i <
fes -> GetNBE(); i++)
616 if (bdr_attr_marker[bdr_attr-1] == 0) {
continue; }
629 for (
int k = 0; k <
bfnfi.Size(); k++)
634 bfnfi[k]->AssembleFaceGrad(*fe1, *fe2, *tr, el_x, elmat);
692 for (
int i = 0; i <
dnfi.Size(); i++) {
delete dnfi[i]; }
693 for (
int i = 0; i <
bnfi.Size(); i++) {
delete bnfi[i]; }
694 for (
int i = 0; i <
fnfi.Size(); i++) {
delete fnfi[i]; }
695 for (
int i = 0; i <
bfnfi.Size(); i++) {
delete bfnfi[i]; }
702 fes(0), BlockGrad(NULL)
712 for (
int i=0; i<
Grads.NumRows(); ++i)
714 for (
int j=0; j<
Grads.NumCols(); ++j)
720 for (
int i = 0; i <
ess_tdofs.Size(); ++i)
733 for (
int i=0; i<
fes.Size(); ++i)
751 P.SetSize(
fes.Size());
752 cP.SetSize(
fes.Size());
754 for (
int s = 0;
s <
fes.Size(); ++
s)
757 P[
s] =
fes[
s]->GetProlongationMatrix();
779 fes(0), BlockGrad(NULL)
787 for (
int s = 0;
s <
fes.Size(); ++
s)
808 Mesh *mesh =
fes[0]->GetMesh();
811 for (
int i=0; i<
fes.Size(); ++i)
813 el_x_const[i] = el_x[i] =
new Vector();
823 for (
int k = 0; k <
dnfi.Size(); k++)
831 MFEM_ASSERT(marker.
Size() == attr_marker.
Size(),
832 "invalid marker for domain integrator #"
833 << k <<
", counting from zero");
834 for (
int i = 0; i < attr_marker.
Size(); i++)
836 attr_marker[i] |= marker[i];
840 for (
int i = 0; i <
fes[0]->GetNE(); ++i)
843 if (attr_marker[attr-1] == 0) {
continue; }
845 T =
fes[0]->GetElementTransformation(i);
846 for (
int s=0;
s<
fes.Size(); ++
s)
848 fe[
s] =
fes[
s]->GetFE(i);
849 doftrans =
fes[
s]->GetElementVDofs(i, *vdofs[
s]);
854 for (
int k = 0; k <
dnfi.Size(); ++k)
859 energy +=
dnfi[k]->GetElementEnergy(fe, *T, el_x_const);
870 for (
int k = 0; k <
bnfi.Size(); k++)
878 MFEM_ASSERT(bdr_marker.
Size() == bdr_attr_marker.
Size(),
879 "invalid boundary marker for boundary integrator #"
880 << k <<
", counting from zero");
881 for (
int i = 0; i < bdr_attr_marker.
Size(); i++)
883 bdr_attr_marker[i] |= bdr_marker[i];
887 for (
int i = 0; i < mesh->
GetNBE(); i++)
890 if (bdr_attr_marker[bdr_attr-1] == 0) {
continue; }
892 T =
fes[0]->GetBdrElementTransformation(i);
893 for (
int s = 0;
s <
fes.Size(); ++
s)
895 fe[
s] =
fes[
s]->GetBE(i);
896 doftrans =
fes[
s]->GetBdrElementVDofs(i, *(vdofs[
s]));
901 for (
int k = 0; k <
bnfi.Size(); k++)
906 energy +=
bnfi[k]->GetElementEnergy(fe, *T, el_x_const);
912 for (
int i = 0; i <
fes.Size(); ++i)
920 MFEM_ABORT(
"TODO: add energy contribution from interior face terms");
925 MFEM_ABORT(
"TODO: add energy contribution from boundary face terms");
949 Mesh *mesh =
fes[0]->GetMesh();
954 for (
int s=0;
s<
fes.Size(); ++
s)
956 el_x_const[
s] = el_x[
s] =
new Vector();
968 for (
int k = 0; k <
dnfi.Size(); k++)
976 MFEM_ASSERT(marker.
Size() == attr_marker.
Size(),
977 "invalid marker for domain integrator #"
978 << k <<
", counting from zero");
979 for (
int i = 0; i < attr_marker.
Size(); i++)
981 attr_marker[i] |= marker[i];
985 for (
int i = 0; i <
fes[0]->GetNE(); ++i)
988 if (attr_marker[attr-1] == 0) {
continue; }
990 T =
fes[0]->GetElementTransformation(i);
991 for (
int s = 0;
s <
fes.Size(); ++
s)
993 doftrans[
s] =
fes[
s]->GetElementVDofs(i, *(vdofs[
s]));
994 fe[
s] =
fes[
s]->GetFE(i);
996 if (doftrans[
s]) {doftrans[
s]->InvTransformPrimal(*el_x[
s]); }
999 for (
int k = 0; k <
dnfi.Size(); ++k)
1004 dnfi[k]->AssembleElementVector(fe, *T,
1007 for (
int s=0;
s<
fes.Size(); ++
s)
1009 if (el_y[
s]->Size() == 0) {
continue; }
1010 if (doftrans[
s]) {doftrans[
s]->TransformDual(*el_y[
s]); }
1022 bdr_attr_marker = 0;
1023 for (
int k = 0; k <
bnfi.Size(); k++)
1027 bdr_attr_marker = 1;
1031 MFEM_ASSERT(bdr_marker.
Size() == bdr_attr_marker.
Size(),
1032 "invalid boundary marker for boundary integrator #"
1033 << k <<
", counting from zero");
1034 for (
int i = 0; i < bdr_attr_marker.
Size(); i++)
1036 bdr_attr_marker[i] |= bdr_marker[i];
1040 for (
int i = 0; i < mesh->
GetNBE(); i++)
1043 if (bdr_attr_marker[bdr_attr-1] == 0) {
continue; }
1045 T =
fes[0]->GetBdrElementTransformation(i);
1046 for (
int s = 0;
s <
fes.Size(); ++
s)
1048 doftrans[
s] =
fes[
s]->GetBdrElementVDofs(i, *(vdofs[
s]));
1049 fe[
s] =
fes[
s]->GetBE(i);
1051 if (doftrans[
s]) {doftrans[
s]->InvTransformPrimal(*el_x[
s]); }
1054 for (
int k = 0; k <
bnfi.Size(); k++)
1059 bnfi[k]->AssembleElementVector(fe, *T, el_x_const, el_y);
1061 for (
int s=0;
s<
fes.Size(); ++
s)
1063 if (el_y[
s]->Size() == 0) {
continue; }
1064 if (doftrans[
s]) {doftrans[
s]->TransformDual(*el_y[
s]); }
1081 for (
int s=0;
s<
fes.Size(); ++
s)
1083 fe[
s] =
fes[
s]->GetFE(tr->Elem1No);
1084 fe2[
s] =
fes[
s]->GetFE(tr->Elem2No);
1086 fes[
s]->GetElementVDofs(tr->Elem1No, *(vdofs[
s]));
1087 fes[
s]->GetElementVDofs(tr->Elem2No, *(vdofs2[
s]));
1094 for (
int k = 0; k <
fnfi.Size(); ++k)
1097 fnfi[k]->AssembleFaceVector(fe, fe2, *tr, el_x_const, el_y);
1099 for (
int s=0;
s<
fes.Size(); ++
s)
1101 if (el_y[
s]->Size() == 0) {
continue; }
1116 bdr_attr_marker = 0;
1117 for (
int k = 0; k <
bfnfi.Size(); ++k)
1121 bdr_attr_marker = 1;
1125 MFEM_ASSERT(bdr_marker.
Size() == bdr_attr_marker.
Size(),
1126 "invalid boundary marker for boundary face integrator #"
1127 << k <<
", counting from zero");
1128 for (
int i = 0; i < bdr_attr_marker.
Size(); ++i)
1130 bdr_attr_marker[i] |= bdr_marker[i];
1134 for (
int i = 0; i < mesh->
GetNBE(); ++i)
1137 if (bdr_attr_marker[bdr_attr-1] == 0) {
continue; }
1142 for (
int s=0;
s<
fes.Size(); ++
s)
1144 fe[
s] =
fes[
s]->GetFE(tr->Elem1No);
1145 fe2[
s] =
fes[
s]->GetFE(tr->Elem1No);
1147 fes[
s]->GetElementVDofs(tr->Elem1No, *(vdofs[
s]));
1151 for (
int k = 0; k <
bfnfi.Size(); ++k)
1156 bfnfi[k]->AssembleFaceVector(fe, fe2, *tr, el_x_const, el_y);
1158 for (
int s=0;
s<
fes.Size(); ++
s)
1160 if (el_y[
s]->Size() == 0) {
continue; }
1168 for (
int s=0;
s<
fes.Size(); ++
s)
1181 MFEM_VERIFY(bx.
Size() ==
Width(),
"invalid input BlockVector size");
1186 for (
int s = 0;
s <
fes.Size();
s++)
1211 for (
int s = 0;
s <
fes.Size();
s++)
1223 const int skip_zeros = 0;
1233 Mesh *mesh =
fes[0]->GetMesh();
1235 for (
int i=0; i<
fes.Size(); ++i)
1237 el_x_const[i] = el_x[i] =
new Vector();
1240 for (
int j=0; j<
fes.Size(); ++j)
1246 for (
int i=0; i<
fes.Size(); ++i)
1248 for (
int j=0; j<
fes.Size(); ++j)
1250 if (
Grads(i,j) != NULL)
1257 fes[j]->GetVSize());
1268 for (
int k = 0; k <
dnfi.Size(); k++)
1276 MFEM_ASSERT(marker.
Size() == attr_marker.
Size(),
1277 "invalid marker for domain integrator #"
1278 << k <<
", counting from zero");
1279 for (
int i = 0; i < attr_marker.
Size(); i++)
1281 attr_marker[i] |= marker[i];
1285 for (
int i = 0; i <
fes[0]->GetNE(); ++i)
1288 if (attr_marker[attr-1] == 0) {
continue; }
1290 T =
fes[0]->GetElementTransformation(i);
1291 for (
int s = 0;
s <
fes.Size(); ++
s)
1293 fe[
s] =
fes[
s]->GetFE(i);
1294 doftrans[
s] =
fes[
s]->GetElementVDofs(i, *vdofs[
s]);
1296 if (doftrans[
s]) {doftrans[
s]->InvTransformPrimal(*el_x[
s]); }
1299 for (
int k = 0; k <
dnfi.Size(); ++k)
1304 dnfi[k]->AssembleElementGrad(fe, *T, el_x_const, elmats);
1306 for (
int j=0; j<
fes.Size(); ++j)
1308 for (
int l=0; l<
fes.Size(); ++l)
1310 if (elmats(j,l)->
Height() == 0) {
continue; }
1311 if (doftrans[j] || doftrans[l])
1315 Grads(j,l)->AddSubMatrix(*vdofs[j], *vdofs[l],
1316 *elmats(j,l), skip_zeros);
1328 bdr_attr_marker = 0;
1329 for (
int k = 0; k <
bnfi.Size(); k++)
1333 bdr_attr_marker = 1;
1337 MFEM_ASSERT(bdr_marker.
Size() == bdr_attr_marker.
Size(),
1338 "invalid boundary marker for boundary integrator #"
1339 << k <<
", counting from zero");
1340 for (
int i = 0; i < bdr_attr_marker.
Size(); i++)
1342 bdr_attr_marker[i] |= bdr_marker[i];
1346 for (
int i = 0; i < mesh->
GetNBE(); i++)
1349 if (bdr_attr_marker[bdr_attr-1] == 0) {
continue; }
1351 T =
fes[0]->GetBdrElementTransformation(i);
1352 for (
int s = 0;
s <
fes.Size(); ++
s)
1354 fe[
s] =
fes[
s]->GetBE(i);
1355 doftrans[
s] =
fes[
s]->GetBdrElementVDofs(i, *(vdofs[
s]));
1357 if (doftrans[
s]) {doftrans[
s]->InvTransformPrimal(*el_x[
s]); }
1360 for (
int k = 0; k <
bnfi.Size(); k++)
1365 bnfi[k]->AssembleElementGrad(fe, *T, el_x_const, elmats);
1367 for (
int j=0; j<
fes.Size(); ++j)
1369 for (
int l=0; l<
fes.Size(); ++l)
1371 if (elmats(j,l)->
Height() == 0) {
continue; }
1372 if (doftrans[j] || doftrans[l])
1376 Grads(j,l)->AddSubMatrix(*vdofs[j], *vdofs[l],
1377 *elmats(j,l), skip_zeros);
1392 for (
int s=0;
s <
fes.Size(); ++
s)
1394 fe[
s] =
fes[
s]->GetFE(tr->Elem1No);
1395 fe2[
s] =
fes[
s]->GetFE(tr->Elem2No);
1397 fes[
s]->GetElementVDofs(tr->Elem1No, *vdofs[
s]);
1398 fes[
s]->GetElementVDofs(tr->Elem2No, *vdofs2[
s]);
1404 for (
int k = 0; k <
fnfi.Size(); ++k)
1406 fnfi[k]->AssembleFaceGrad(fe, fe2, *tr, el_x_const, elmats);
1407 for (
int j=0; j<
fes.Size(); ++j)
1409 for (
int l=0; l<
fes.Size(); ++l)
1411 if (elmats(j,l)->
Height() == 0) {
continue; }
1412 Grads(j,l)->AddSubMatrix(*vdofs[j], *vdofs[l],
1413 *elmats(j,l), skip_zeros);
1427 bdr_attr_marker = 0;
1428 for (
int k = 0; k <
bfnfi.Size(); ++k)
1432 bdr_attr_marker = 1;
1436 MFEM_ASSERT(bdr_marker.
Size() == bdr_attr_marker.
Size(),
1437 "invalid boundary marker for boundary face integrator #"
1438 << k <<
", counting from zero");
1439 for (
int i = 0; i < bdr_attr_marker.
Size(); ++i)
1441 bdr_attr_marker[i] |= bdr_marker[i];
1445 for (
int i = 0; i < mesh->
GetNBE(); ++i)
1448 if (bdr_attr_marker[bdr_attr-1] == 0) {
continue; }
1453 for (
int s = 0;
s <
fes.Size(); ++
s)
1455 fe[
s] =
fes[
s]->GetFE(tr->Elem1No);
1458 fes[
s]->GetElementVDofs(tr->Elem1No, *vdofs[
s]);
1462 for (
int k = 0; k <
bfnfi.Size(); ++k)
1466 bfnfi[k]->AssembleFaceGrad(fe, fe2, *tr, el_x_const, elmats);
1467 for (
int l=0; l<
fes.Size(); ++l)
1469 for (
int j=0; j<
fes.Size(); ++j)
1471 if (elmats(j,l)->
Height() == 0) {
continue; }
1472 Grads(j,l)->AddSubMatrix(*vdofs[j], *vdofs[l],
1473 *elmats(j,l), skip_zeros);
1481 if (!
Grads(0,0)->Finalized())
1483 for (
int i=0; i<
fes.Size(); ++i)
1485 for (
int j=0; j<
fes.Size(); ++j)
1487 Grads(i,j)->Finalize(skip_zeros);
1492 for (
int i=0; i<
fes.Size(); ++i)
1494 for (
int j=0; j<
fes.Size(); ++j)
1515 for (
int s1 = 0; s1 <
fes.Size(); ++s1)
1517 for (
int s2 = 0; s2 <
fes.Size(); ++s2)
1521 mGrads(s1, s2) =
cGrads(s1, s2);
1526 for (
int s = 0;
s <
fes.Size(); ++
s)
1528 for (
int i = 0; i <
ess_tdofs[
s]->Size(); ++i)
1530 for (
int j = 0; j <
fes.Size(); ++j)
1548 for (
int i = 0; i <
fes.Size(); ++i)
1550 for (
int j = 0; j <
fes.Size(); ++j)
1561 for (
int i=0; i<
fes.Size(); ++i)
1563 for (
int j=0; j<
fes.Size(); ++j)
1571 for (
int i = 0; i <
dnfi.Size(); ++i)
1576 for (
int i = 0; i <
bnfi.Size(); ++i)
1581 for (
int i = 0; i <
fnfi.Size(); ++i)
1586 for (
int i = 0; i <
bfnfi.Size(); ++i)
Dynamic 2D array using row-major layout.
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
void PartialSum()
Fill the entries of the array with the cumulative sum of the entries.
int Append(const T &el)
Append element 'el' to array, resize if necessary.
void Copy(Array ©) const
Create a copy of the internal array to the provided copy.
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
A class to handle Block systems in a matrix-free implementation.
void SetBlock(int iRow, int iCol, Operator *op, real_t c=1.0)
Add a block op in the block-entry (iblock, jblock).
A class to handle Vectors in a block fashion.
void Update(real_t *data, const Array< int > &bOffsets)
Update method.
void SyncFromBlocks() const
Synchronize the memory location flags (i.e. the memory validity flags) of the big/monolithic block-ve...
void SyncToBlocks() const
Synchronize the memory location flags (i.e. the memory validity flags) of the big/monolithic block-ve...
Vector & GetBlock(int i)
Get the i-th vector in the block.
Data type dense matrix using column-major storage.
const FiniteElement * GetBE(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th boundary fac...
virtual int GetTrueVSize() const
Return the number of vector true (conforming) dofs.
ElementTransformation * GetElementTransformation(int i) const
Returns ElementTransformation for the i-th element.
static void ListToMarker(const Array< int > &list, int marker_size, Array< int > &marker, int mark_val=-1)
Convert an array of indices (list) to a Boolean marker array where all indices in the list are marked...
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1) const
Get a list of essential true dofs, ess_tdof_list, corresponding to the boundary attributes marked in ...
int GetNBE() const
Returns number of boundary elements in the mesh.
virtual const Operator * GetProlongationMatrix() const
The returned Operator is owned by the FiniteElementSpace.
DofTransformation * GetElementVDofs(int i, Array< int > &vdofs) const
Returns indices of degrees of freedom for the i'th element. The returned indices are offsets into an ...
virtual const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th element in t...
ElementTransformation * GetBdrElementTransformation(int i) const
Returns ElementTransformation for the i-th boundary element.
int GetNE() const
Returns number of elements in the mesh.
static void MarkerToList(const Array< int > &marker, Array< int > &list)
Convert a Boolean marker array to a list containing all marked indices.
void ConvertToConformingVDofs(const Array< int > &dofs, Array< int > &cdofs)
For a partially conforming FE space, convert a marker array (nonzero entries are true) on the partial...
Mesh * GetMesh() const
Returns the mesh.
int GetVSize() const
Return the number of vector dofs, i.e. GetNDofs() x GetVDim().
DofTransformation * GetBdrElementVDofs(int i, Array< int > &vdofs) const
Returns indices of degrees of freedom for i'th boundary element. The returned indices are offsets int...
Abstract class for all finite elements.
void BooleanMultTranspose(int alpha, const int *x, int beta, int *y)
The "Boolean" analog of y = alpha * A^T * x + beta * y, where elements in the sparsity pattern of the...
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
int GetNumFaces() const
Return the number of faces (3D), edges (2D) or vertices (1D).
int GetAttribute(int i) const
Return the attribute of element i.
int GetBdrAttribute(int i) const
Return the attribute of boundary element i.
FaceElementTransformations * GetBdrFaceTransformations(int BdrElemNo)
Builds the transformation defining the given boundary face.
int GetNBE() const
Returns number of boundary elements.
FaceElementTransformations * GetInteriorFaceTransformations(int FaceNo)
See GetFaceElementTransformations().
Array< int > attributes
A list of all unique element attributes used by the Mesh.
void Clear()
Clear the OperatorHandle, deleting the held Operator (if owned), while leaving the type id unchanged.
void Reset(OpType *A, bool own_A=true)
Reset the OperatorHandle to the given OpType pointer, A.
int width
Dimension of the input / number of columns in the matrix.
void FormSystemOperator(const Array< int > &ess_tdof_list, Operator *&A)
Return in A a parallel (on truedofs) version of this square operator.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
int height
Dimension of the output / number of rows in the matrix.
virtual void Mult(const Vector &x, Vector &y) const =0
Operator application: y=A(x).
@ DIAG_ONE
Set the diagonal value to one.
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
Abstract parallel finite element space.
int GetTrueVSize() const override
Return the number of local vector true dofs.
HypreParMatrix * Dof_TrueDof_Matrix() const
The true dof-to-dof interpolation matrix.
virtual void MultTranspose(const Vector &x, Vector &y) const
Multiply a vector with the transposed matrix. y = At * x.
void EliminateRowCol(int rc, const real_t sol, Vector &rhs, DiagonalPolicy dpolicy=DIAG_ONE)
Eliminate row rc and column rc and modify the rhs using sol.
bool Finalized() const
Returns whether or not CSR format has been finalized.
void AddSubMatrix(const Array< int > &rows, const Array< int > &cols, const DenseMatrix &subm, int skip_zeros=1)
virtual void Finalize(int skip_zeros=1)
Finalize the matrix initialization, switching the storage format from LIL to CSR.
virtual real_t * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), on_dev).
void SetSubVector(const Array< int > &dofs, const real_t value)
Set the entries listed in dofs to the given value.
void AddElementVector(const Array< int > &dofs, const Vector &elemvect)
Add elements of the elemvect Vector to the entries listed in dofs. Negative dof values cause the -dof...
int Size() const
Returns the size of the vector.
virtual void UseDevice(bool use_dev) const
Enable execution of Vector operations using the mfem::Device.
void SetSize(int s)
Resize the vector to size s.
void GetSubVector(const Array< int > &dofs, Vector &elemvect) const
Extract entries listed in dofs to the output Vector elemvect.
void mfem_error(const char *msg)
void TransformDual(const DofTransformation *ran_dof_trans, const DofTransformation *dom_dof_trans, DenseMatrix &elmat)
AssemblyLevel
Enumeration defining the assembly level for bilinear and nonlinear form classes derived from Operator...
void RAP(const DenseMatrix &A, const DenseMatrix &P, DenseMatrix &RAP)
std::function< real_t(const Vector &)> f(real_t mass_coeff)
void forall(int N, lambda &&body)