14 #include "../general/text.hpp"
15 #include "../general/forall.hpp"
16 #include "../mesh/mesh_headers.hpp"
17 #include "../fem/libceed/ceed.hpp"
29 template <>
void Ordering::
30 DofsToVDofs<Ordering::byNODES>(
int ndofs,
int vdim,
Array<int> &dofs)
33 int size = dofs.Size();
34 dofs.SetSize(size*vdim);
35 for (
int vd = 1; vd < vdim; vd++)
37 for (
int i = 0; i < size; i++)
39 dofs[i+size*vd] = Map<byNODES>(ndofs, vdim, dofs[i], vd);
44 template <>
void Ordering::
45 DofsToVDofs<Ordering::byVDIM>(
int ndofs,
int vdim,
Array<int> &dofs)
48 int size = dofs.Size();
49 dofs.SetSize(size*vdim);
50 for (
int vd = vdim-1; vd >= 0; vd--)
52 for (
int i = 0; i < size; i++)
54 dofs[i+size*vd] = Map<byVDIM>(ndofs, vdim, dofs[i], vd);
60 FiniteElementSpace::FiniteElementSpace()
62 ndofs(0), nvdofs(0), nedofs(0), nfdofs(0), nbdofs(0),
63 fdofs(NULL), bdofs(NULL),
64 elem_dof(NULL), bdrElem_dof(NULL), face_dof(NULL),
65 NURBSext(NULL), own_ext(false),
66 cP(NULL), cR(NULL), cP_is_set(false),
75 mesh = mesh ? mesh : orig.
mesh;
76 fec = fec ? fec : orig.
fec;
110 if (
vdim == 1) {
return; }
111 if (ndofs < 0) { ndofs = this->
ndofs; }
115 Ordering::DofsToVDofs<Ordering::byNODES>(
ndofs,
vdim, dofs);
119 Ordering::DofsToVDofs<Ordering::byVDIM>(
ndofs,
vdim, dofs);
125 if (
vdim == 1) {
return; }
126 if (ndofs < 0) { ndofs = this->
ndofs; }
130 for (
int i = 0; i < dofs.
Size(); i++)
132 dofs[i] = Ordering::Map<Ordering::byNODES>(
ndofs,
vdim, dofs[i], vd);
137 for (
int i = 0; i < dofs.
Size(); i++)
139 dofs[i] = Ordering::Map<Ordering::byVDIM>(
ndofs,
vdim, dofs[i], vd);
146 if (
vdim == 1) {
return dof; }
147 if (ndofs < 0) { ndofs = this->
ndofs; }
151 return Ordering::Map<Ordering::byNODES>(
ndofs,
vdim, dof, vd);
155 return Ordering::Map<Ordering::byVDIM>(
ndofs,
vdim, dof, vd);
162 int n = vdofs.
Size(), *vdof = vdofs;
163 for (
int i = 0; i < n; i++)
166 if ((j = vdof[i]) < 0)
222 for (
int i = 0; i <
mesh ->
GetNE(); i++)
225 el_dof -> AddColumnsInRow (i, dofs.
Size());
228 for (
int i = 0; i <
mesh ->
GetNE(); i++)
231 el_dof -> AddConnections (i, (
int *)dofs, dofs.
Size());
233 el_dof -> ShiftUpI();
270 for (
int i = 0; i < fc_dof->
Size(); i++)
276 for (
int i = 0; i < fc_dof->
Size(); i++)
299 for (
int k = 0, dof_counter = 0; k < nnz; k++)
301 const int sdof = J[k];
302 const int dof = (sdof < 0) ? -1-sdof : sdof;
303 int new_dof = dof_marker[dof];
306 dof_marker[dof] = new_dof = dof_counter++;
308 J[k] = (sdof < 0) ? -1-new_dof : new_dof;
321 for (
int i = 0; i <
mesh ->
GetNE(); i++)
323 const int *dofs =
elem_dof -> GetRow(i);
324 const int n =
elem_dof -> RowSize(i);
325 for (
int j = 0; j < n; j++)
338 for (
int i = 0; i < dofs.
Size(); i++)
341 if (k < 0) { k = -1 - k; }
355 for (
int i = 0; i <
GetNBE(); i++)
363 mark_dofs(vdofs, ess_vdofs);
368 for (
int d = 0; d < dofs.
Size(); d++)
369 { dofs[d] =
DofToVDof(dofs[d], component); }
370 mark_dofs(dofs, ess_vdofs);
382 for (
int i = 0; i < bdr_verts.
Size(); i++)
387 mark_dofs(vdofs, ess_vdofs);
392 for (
int d = 0; d < dofs.
Size(); d++)
393 { dofs[d] =
DofToVDof(dofs[d], component); }
394 mark_dofs(dofs, ess_vdofs);
397 for (
int i = 0; i < bdr_edges.
Size(); i++)
402 mark_dofs(vdofs, ess_vdofs);
407 for (
int d = 0; d < dofs.
Size(); d++)
408 { dofs[d] =
DofToVDof(dofs[d], component); }
409 mark_dofs(dofs, ess_vdofs);
439 for (
int i = 0; i < marker.
Size(); i++)
441 if (marker[i]) { num_marked++; }
446 for (
int i = 0; i < marker.
Size(); i++)
448 if (marker[i]) { list.
Append(i); }
460 for (
int i = 0; i < list.
Size(); i++)
462 marker[list[i]] = mark_val;
471 else { dofs.
Copy(cdofs); }
479 else { cdofs.
Copy(dofs); }
497 if (d_vdofs.
Size() != c_vdofs.
Size())
499 mfem_error (
"FiniteElementSpace::D2C_GlobalRestrictionMatrix (...)");
503 for (j = 0; j < d_vdofs.
Size(); j++)
505 R -> Set (c_vdofs[j], d_vdofs[j], 1.0);
529 if (c_dofs.
Size() != 1)
531 "D2Const_GlobalRestrictionMatrix (...)");
534 for (j = 0; j < d_dofs.
Size(); j++)
536 R -> Set (c_dofs[0], d_dofs[j], 1.0);
560 for (
int i = 0; i <
mesh ->
GetNE(); i++)
567 if (geom != cached_geom)
569 h_fe =
this ->
GetFE (i);
570 l_fe = lfes ->
GetFE (i);
572 h_fe->
Project(*l_fe, T, loc_restr);
576 for (
int vd = 0; vd <
vdim; vd++)
578 l_dofs.
Copy(l_vdofs);
581 h_dofs.
Copy(h_vdofs);
584 R -> SetSubMatrix (l_vdofs, h_vdofs, loc_restr, 1);
597 for (
int i = 0; i < slave_dofs.
Size(); i++)
599 int sdof = slave_dofs[i];
602 for (
int j = 0; j < master_dofs.
Size(); j++)
604 double coef = I(i, j);
605 if (std::abs(coef) > 1e-12)
607 int mdof = master_dofs[j];
608 if (mdof != sdof && mdof != (-1-sdof))
610 deps.
Add(sdof, mdof, coef);
625 for (
int i = 0; i < ndep; i++)
627 if (!finalized[dep[i]]) {
return false; }
651 if (!dofs.
Size()) {
return; }
656 for (
int i = 0; i < nv; i++)
659 dofs[nv+i] = edof[nv+i];
663 for (
int i = 0; i < ne; i++)
665 dofs[face_vert*nv + i] = edof[2*nv + i];
686 MFEM_VERIFY(dynamic_cast<const ParFiniteElementSpace*>(
this) == NULL,
687 "This method should not be used with a ParFiniteElementSpace!");
699 for (
int entity = 1; entity <= 2; entity++)
702 if (!list.
masters.Size()) {
continue; }
710 for (
int mi = 0; mi < list.
masters.Size(); mi++)
715 if (!master_dofs.
Size()) {
continue; }
718 if (!fe) {
continue; }
725 default: MFEM_ABORT(
"unsupported geometry");
732 if (!slave_dofs.
Size()) {
continue; }
747 for (
int i = 0; i <
ndofs; i++)
749 if (!deps.
RowSize(i)) { n_true_dofs++; }
753 if (n_true_dofs == ndofs)
765 for (
int i = 0; i < n_true_dofs; i++)
770 cR_I[n_true_dofs] = n_true_dofs;
781 for (
int i = 0, true_dof = 0; i <
ndofs; i++)
786 cP->
Add(i, true_dof++, 1.0);
799 int n_finalized = n_true_dofs;
805 for (
int dof = 0; dof <
ndofs; dof++)
813 for (
int j = 0; j < n_dep; j++)
820 finalized[dof] =
true;
830 if (n_finalized != ndofs)
832 MFEM_ABORT(
"Error creating cP matrix.");
848 if (
vdim == 1) {
return; }
850 int height = mat.
Height();
851 int width = mat.
Width();
857 for (
int i = 0; i < height; i++)
859 mat.
GetRow(i, dofs, srow);
860 for (
int vd = 0; vd <
vdim; vd++)
928 key_face key = std::make_tuple(is_dg_space, e_ordering, type, m);
929 auto itr =
L2F.find(key);
930 if (itr !=
L2F.end())
953 for (
int i = 0; i <
E2Q_array.Size(); i++)
956 if (qi->
IntRule == &ir) {
return qi; }
967 for (
int i = 0; i <
E2Q_array.Size(); i++)
970 if (qi->
qspace == &qs) {
return qi; }
987 if (qi->
IntRule == &ir) {
return qi; }
1000 if (qi->
IntRule == &ir) {
return qi; }
1011 const int coarse_ndofs,
const Table &coarse_elem_dof,
1022 if (elem_geoms.
Size() == 1)
1024 const int coarse_ldof = localP[elem_geoms[0]].
SizeJ();
1042 const int fine_ldof = localP[
geom].
SizeI();
1047 for (
int vd = 0; vd <
vdim; vd++)
1049 coarse_dofs.Copy(coarse_vdofs);
1052 for (
int i = 0; i < fine_ldof; i++)
1055 int m = (r >= 0) ? r : (-1 - r);
1060 P->
SetRow(r, coarse_vdofs, row);
1067 MFEM_ASSERT(mark.
Sum() == P->
Height(),
"Not all rows of P set.");
1080 int nmat = pmats.
SizeK();
1087 localP.
SetSize(ldof, ldof, nmat);
1088 for (
int i = 0; i < nmat; i++)
1096 const Table* old_elem_dof)
1098 MFEM_VERIFY(
GetNE() >= old_elem_dof->
Size(),
1099 "Previous mesh is not coarser.");
1104 for (
int i = 0; i < elem_geoms.Size(); i++)
1115 , old_elem_dof(old_elem_dof)
1117 MFEM_VERIFY(fespace->
GetNE() >= old_elem_dof->
Size(),
1118 "Previous mesh is not coarser.");
1120 width = old_ndofs * fespace->
GetVDim();
1125 for (
int i = 0; i < elem_geoms.Size(); i++)
1133 :
Operator(fespace->GetVSize(), coarse_fes->GetVSize()),
1134 fespace(fespace), old_elem_dof(NULL)
1138 for (
int i = 0; i < elem_geoms.Size(); i++)
1141 localP[elem_geoms[i]]);
1150 delete old_elem_dof;
1162 int old_ndofs = width /
vdim;
1166 for (
int k = 0; k < mesh->
GetNE(); k++)
1177 for (
int vd = 0; vd <
vdim; vd++)
1181 old_dofs.
Copy(old_vdofs);
1184 lP.
Mult(subX, subY);
1204 int old_ndofs = width /
vdim;
1208 for (
int k = 0; k < mesh->
GetNE(); k++)
1219 for (
int vd = 0; vd <
vdim; vd++)
1221 f_dofs.
Copy(f_vdofs);
1223 c_dofs.
Copy(c_vdofs);
1228 for (
int p = 0;
p < f_dofs.
Size(); ++
p)
1240 for (
int p = 0;
p < f_dofs.
Size(); ++
p)
1255 "incompatible coarse and fine FE spaces");
1263 for (
int gi = 0; gi < elem_geoms.
Size(); gi++)
1275 emb_tr.SetIdentityTransformation(geom);
1276 for (
int i = 0; i < pmats.
SizeK(); i++)
1278 emb_tr.SetPointMat(pmats(i));
1286 Table ref_type_to_matrix;
1288 ref_type_to_matrix, ref_type_to_geom);
1289 MFEM_ASSERT(coarse_to_fine.
Size() == c_fes->
GetNE(),
"");
1291 const int total_ref_types = ref_type_to_geom.
Size();
1293 Array<int> ref_type_to_coarse_elem_offset(total_ref_types);
1294 ref_type_to_fine_elem_offset.
SetSize(total_ref_types);
1297 for (
int i = 0; i < total_ref_types; i++)
1300 ref_type_to_coarse_elem_offset[i] = num_ref_types[g];
1301 ref_type_to_fine_elem_offset[i] = num_fine_elems[g];
1303 num_fine_elems[g] += ref_type_to_matrix.
RowSize(i);
1308 if (num_ref_types[g] == 0) {
continue; }
1309 const int fine_dofs = localP[g].
SizeI();
1310 const int coarse_dofs = localP[g].
SizeJ();
1311 localPtMP[g].
SetSize(coarse_dofs, coarse_dofs, num_ref_types[g]);
1312 localR[g].
SetSize(coarse_dofs, fine_dofs, num_fine_elems[g]);
1314 for (
int i = 0; i < total_ref_types; i++)
1317 DenseMatrix &lPtMP = localPtMP[g](ref_type_to_coarse_elem_offset[i]);
1318 int lR_offset = ref_type_to_fine_elem_offset[i];
1319 const int *mi = ref_type_to_matrix.
GetRow(i);
1320 const int nm = ref_type_to_matrix.
RowSize(i);
1322 for (
int s = 0; s < nm; s++)
1331 for (
int s = 0; s < nm; s++)
1344 delete coarse_elem_dof;
1353 const int vdim = fine_fes->GetVDim();
1354 const int coarse_ndofs = height/
vdim;
1355 for (
int coarse_el = 0; coarse_el < coarse_to_fine.Size(); coarse_el++)
1357 coarse_elem_dof->GetRow(coarse_el, c_vdofs);
1358 fine_fes->DofsToVDofs(c_vdofs, coarse_ndofs);
1362 const int ref_type = coarse_to_ref_type[coarse_el];
1364 const int *fine_elems = coarse_to_fine.GetRow(coarse_el);
1365 const int num_fine_elems = coarse_to_fine.RowSize(coarse_el);
1366 const int lR_offset = ref_type_to_fine_elem_offset[ref_type];
1367 for (
int s = 0; s < num_fine_elems; s++)
1370 fine_fes->GetElementVDofs(fine_elems[s], f_vdofs);
1373 AddMult(lR, loc_x_mat, loc_y_mat);
1388 const int nmat = pmats.
SizeK();
1389 const int ldof = fe->
GetDof();
1395 localR.
SetSize(ldof, ldof, nmat);
1396 for (
int i = 0; i < nmat; i++)
1404 const Table* old_elem_dof)
1406 MFEM_VERIFY(
Nonconforming(),
"Not implemented for conforming meshes.");
1407 MFEM_VERIFY(old_ndofs,
"Missing previous (finer) space.");
1408 MFEM_VERIFY(
ndofs <= old_ndofs,
"Previous space is not finer.");
1416 for (
int i = 0; i < elem_geoms.
Size(); i++)
1424 localR[elem_geoms[0]].SizeI());
1432 MFEM_ASSERT(dtrans.
embeddings.Size() == old_elem_dof->
Size(),
"");
1435 for (
int k = 0; k < dtrans.
embeddings.Size(); k++)
1442 old_elem_dof->
GetRow(k, old_dofs);
1444 for (
int vd = 0; vd <
vdim; vd++)
1446 old_dofs.
Copy(old_vdofs);
1449 for (
int i = 0; i < lR.
Height(); i++)
1451 if (!std::isfinite(lR(i, 0))) {
continue; }
1454 int m = (r >= 0) ? r : (-1 - r);
1459 R->
SetRow(r, old_vdofs, row);
1467 MFEM_VERIFY(num_marked == R->
Height(),
1468 "internal error: not all rows of R were set.");
1487 int nmat = pmats.
SizeK();
1494 for (
int i = 0; i < nmat; i++)
1521 mfem_error(
"FiniteElementSpace::FiniteElementSpace :\n"
1522 " NURBS FE space requires NURBS mesh.");
1525 if (NURBSext == NULL)
1541 this->NURBSext = NULL;
1552 mfem_error(
"FiniteElementSpace::StealNURBSext");
1561 MFEM_VERIFY(
NURBSext,
"NURBSExt not defined.");
1603 if (b == -1) {
continue; }
1613 for (
int i = 0; i < nv; i++)
1615 MFEM_VERIFY(fv[i] == bv[i],
1616 "non-matching face and boundary elements detected!");
1621 for (
int i = 0; i < row.
Size(); i++)
1624 face_dof_list.
Append(conn);
1633 MFEM_VERIFY(!
NURBSext,
"internal error");
1657 bool have_face_dofs =
false;
1663 have_face_dofs =
true;
1705 int k, j, nv, ne, nf, nb, nfd, nd,
dim;
1726 for (k = 0; k < F.
Size(); k++)
1732 nd = V.
Size() * nv + E.
Size() * ne + nfd + nb;
1736 for (k = 0; k < V.
Size(); k++)
1738 for (j = 0; j < nv; j++)
1740 dofs[k*nv+j] = V[k]*nv+j;
1748 for (k = 0; k < E.
Size(); k++)
1751 for (j = 0; j < ne; j++)
1755 dofs[nv+k*ne+j] = -1 - (
nvdofs+E[k]*ne+(-1-ind[j]) );
1759 dofs[nv+k*ne+j] =
nvdofs+E[k]*ne+ind[j];
1764 ne = nv + ne * E.
Size();
1768 for (k = 0; k < F.
Size(); k++)
1773 for (j = 0; j < nf; j++)
1790 for (j = 0; j < nb; j++)
1800 if (i < 0 || !mesh->
GetNE()) {
return NULL; }
1801 MFEM_VERIFY(i < mesh->
GetNE(),
1802 "Invalid element id " << i <<
", maximum allowed " <<
mesh->
GetNE()-1);
1824 int k, j, nv, ne, nf, nd, iF, oF,
dim;
1838 nd = V.
Size() * nv + E.
Size() * ne;
1849 for (k = 0; k < V.
Size(); k++)
1851 for (j = 0; j < nv; j++)
1853 dofs[k*nv+j] = V[k]*nv+j;
1861 for (k = 0; k < E.
Size(); k++)
1864 for (j = 0; j < ne; j++)
1868 dofs[nv+k*ne+j] = -1 - (
nvdofs+E[k]*ne+(-1-ind[j]) );
1872 dofs[nv+k*ne+j] =
nvdofs+E[k]*ne+ind[j];
1880 ne = nv + ne * E.
Size();
1883 for (j = 0; j < nf; j++)
1924 nd = V.
Size() * nv + E.
Size() * ne + nf;
1928 for (k = 0; k < V.
Size(); k++)
1930 for (j = 0; j < nv; j++)
1932 dofs[k*nv+j] = V[k]*nv+j;
1939 for (k = 0; k < E.
Size(); k++)
1942 for (j = 0; j < ne; j++)
1946 dofs[nv+k*ne+j] = -1 - (
nvdofs+E[k]*ne+(-1-ind[j]) );
1950 dofs[nv+k*ne+j] =
nvdofs+E[k]*ne+ind[j];
1955 ne = nv + ne * E.
Size();
1980 for (k = 0; k < 2; k++)
1982 for (j = 0; j < nv; j++)
1984 dofs[k*nv+j] = V[k]*nv+j;
1989 for (j = 0, k =
nvdofs+i*ne; j < ne; j++, k++)
2001 for (j = 0; j < nv; j++)
2011 nb =
fec -> DofForGeometry (
mesh -> GetElementBaseGeometry (i));
2014 for (j = 0; j < nb; j++)
2026 for (j = 0, k =
nvdofs+i*ne; j < ne; j++, k++)
2095 "NURBS mesh: only boundary faces are supported!");
2104 MFEM_ASSERT(
mesh->
Dimension() > 1,
"No edges with a mesh dimension < 2");
2126 for (
int i = 0; i <
E2Q_array.Size(); i++)
2164 RemoveCeedBasisAndRestriction(
this);
2177 for (
int i = 0; i < elem_geoms.
Size(); i++)
2180 localP[elem_geoms[i]]);
2214 if (RP_case == 0) {
return; }
2227 cR, T.
Ptr(), coarse_P,
false, owner,
false));
2241 MFEM_ABORT(
"Error in update sequence. Space needs to be updated after "
2242 "each mesh modification.");
2252 Table* old_elem_dof = NULL;
2279 old_elem_dof = NULL;
2297 false,
false,
true));
2306 delete old_elem_dof;
2312 int fes_format = 90;
2313 bool nurbs_unit_weights =
false;
2324 MFEM_VERIFY(nurbs_fec,
"invalid FE collection");
2326 const double eps = 5e-14;
2337 out << (fes_format == 90 ?
2338 "FiniteElementSpace\n" :
"MFEM FiniteElementSpace v1.0\n")
2339 <<
"FiniteElementCollection: " <<
fec->
Name() <<
'\n'
2340 <<
"VDim: " <<
vdim <<
'\n'
2341 <<
"Ordering: " <<
ordering <<
'\n';
2343 if (fes_format == 100)
2357 out <<
"NURBS_orders\n";
2364 out <<
"NURBS_periodic\n";
2369 if (!nurbs_unit_weights)
2371 out <<
"NURBS_weights\n";
2375 out <<
"End: MFEM FiniteElementSpace v1.0\n";
2382 int fes_format = 0, ord;
2388 getline(input, buff);
2390 if (buff ==
"FiniteElementSpace") { fes_format = 90; }
2391 else if (buff ==
"MFEM FiniteElementSpace v1.0") { fes_format = 100; }
2392 else { MFEM_ABORT(
"input stream is not a FiniteElementSpace!"); }
2393 getline(input, buff,
' ');
2395 getline(input, buff);
2398 getline(input, buff,
' ');
2400 getline(input, buff,
' ');
2405 if (fes_format == 90)
2409 MFEM_VERIFY(m->
NURBSext,
"NURBS FE collection requires a NURBS mesh!");
2410 const int order = nurbs_fec->
GetOrder();
2418 else if (fes_format == 100)
2423 MFEM_VERIFY(input.good(),
"error reading FiniteElementSpace v1.0");
2424 getline(input, buff);
2426 if (buff ==
"NURBS_order" || buff ==
"NURBS_orders")
2428 MFEM_VERIFY(nurbs_fec,
2429 buff <<
": NURBS FE collection is required!");
2430 MFEM_VERIFY(m->
NURBSext, buff <<
": NURBS mesh is required!");
2431 MFEM_VERIFY(!NURBSext, buff <<
": order redefinition!");
2432 if (buff ==
"NURBS_order")
2445 else if (buff ==
"NURBS_periodic")
2452 else if (buff ==
"NURBS_weights")
2454 MFEM_VERIFY(NURBSext,
"NURBS_weights: NURBS_orders have to be "
2455 "specified before NURBS_weights!");
2458 else if (buff ==
"element_orders")
2460 MFEM_VERIFY(!nurbs_fec,
"section element_orders cannot be used "
2461 "with a NURBS FE collection");
2462 MFEM_ABORT(
"element_orders: not implemented yet!");
2464 else if (buff ==
"End: MFEM FiniteElementSpace v1.0")
2470 MFEM_ABORT(
"unknown section: " << buff);
2486 element_offsets =
new int[num_elem + 1];
2491 for (
int i = 0; i < num_elem; i++)
2493 element_offsets[i] = offset;
2495 if (int_rule[geom] == NULL)
2501 element_offsets[num_elem] = size = offset;
2507 const char *msg =
"invalid input stream";
2510 in >> ident; MFEM_VERIFY(ident ==
"QuadratureSpace", msg);
2511 in >> ident; MFEM_VERIFY(ident ==
"Type:", msg);
2513 if (ident ==
"default_quadrature")
2515 in >> ident; MFEM_VERIFY(ident ==
"Order:", msg);
2520 MFEM_ABORT(
"unknown QuadratureSpace type: " << ident);
2529 out <<
"QuadratureSpace\n"
2530 <<
"Type: default_quadrature\n"
2531 <<
"Order: " <<
order <<
'\n';
2537 : dom_fes(dom_fes_), ran_fes(ran_fes_),
2539 fw_t_oper(), bw_t_oper()
2544 MFEM_VERIFY(par_dom == par_ran,
"the domain and range FE spaces must both"
2545 " be either serial or parallel");
2556 return *t_oper.
Ptr();
2566 MFEM_VERIFY(mat != NULL,
"Operator is not a SparseMatrix");
2569 t_oper.
Reset(const_cast<SparseMatrix*>(mat),
false);
2582 const int RP_case = bool(out_cR) + 2*bool(in_cP);
2586 t_oper.
Reset(const_cast<Operator*>(&oper),
false);
2599 out_cR, &oper, in_cP,
false,
false,
false));
2605 MFEM_ABORT(
"Operator::Type is not supported: " <<
oper_type);
2627 else if ((hy_mat = dynamic_cast<const HypreParMatrix *>(&oper)))
2636 MFEM_ABORT(
"unknown Operator type");
2643 false,
false,
false));
2647 MFEM_ABORT(
"Operator::Type is not supported: " <<
oper_type);
2652 return *t_oper.
Ptr();
2687 for (
int i = 0; i < elem_geoms.Size(); i++)
2690 localP[elem_geoms[i]]);
2697 MFEM_ABORT(
"Operator::Type is not supported: " <<
oper_type);
2727 MFEM_ABORT(
"unknown type of FE space");
2738 MFEM_ABORT(
"Operator::Type is not supported: " <<
oper_type);
2747 :
Operator(fes_lor_.GetVSize(), fes_ho_.GetVSize()),
2753 "mixed meshes are not supported");
2756 if (mesh_ho->
GetNE() == 0) {
return; }
2760 ndof_lor = fe_lor->
GetDof();
2761 ndof_ho = fe_ho->
GetDof();
2763 const int nel_lor = fes_lor.
GetNE();
2764 const int nel_ho = fes_ho.
GetNE();
2766 nref = nel_lor/nel_ho;
2773 for (
int ilor=0; ilor<nel_lor; ++ilor)
2782 R.
SetSize(ndof_lor*nref, ndof_ho, nel_ho);
2784 P.
SetSize(ndof_ho, ndof_lor*nref, nel_ho);
2786 DenseMatrix Minv_lor(ndof_lor*nref, ndof_lor*nref);
2805 Vector shape_ho(ndof_ho);
2806 Vector shape_lor(ndof_lor);
2812 for (
int iho=0; iho<nel_ho; ++iho)
2814 for (
int iref=0; iref<nref; ++iref)
2817 int ilor = ho2lor.
GetRow(iho)[iref];
2820 M_lor.
CopyMN(M_lor_el, iref*ndof_lor, iref*ndof_lor);
2824 Minv_lor.
CopyMN(M_lor_el, iref*ndof_lor, iref*ndof_lor);
2851 M_mixed.
CopyMN(M_mixed_el, iref*ndof_lor, 0);
2858 RtMlorR_inv.
Mult(RtMlor, P(iho));
2865 int vdim = fes_ho.GetVDim();
2869 for (
int iho=0; iho<fes_ho.GetNE(); ++iho)
2871 fes_ho.GetElementVDofs(iho, vdofs);
2875 for (
int iref=0; iref<nref; ++iref)
2877 int ilor = ho2lor.GetRow(iho)[iref];
2878 for (
int vd=0; vd<vdim; ++vd)
2880 fes_lor.GetElementDofs(ilor, vdofs);
2881 fes_lor.DofsToVDofs(vd, vdofs);
2891 int vdim = fes_ho.GetVDim();
2895 for (
int iho=0; iho<fes_ho.GetNE(); ++iho)
2898 for (
int iref=0; iref<nref; ++iref)
2900 int ilor = ho2lor.GetRow(iho)[iref];
2901 for (
int vd=0; vd<vdim; ++vd)
2903 fes_lor.GetElementDofs(ilor, vdofs);
2904 fes_lor.DofsToVDofs(vd, vdofs);
2911 fes_ho.GetElementVDofs(iho, vdofs);
int GetNPoints() const
Returns the number of the points in the integration rule.
Abstract class for all finite elements.
int GetOrder() const
Get the order of the NURBS collection: either a positive number, when using fixed order...
virtual ~InterpolationGridTransfer()
Arbitrary order non-uniform rational B-splines (NURBS) finite elements.
const Operator & MakeTrueOperator(FiniteElementSpace &fes_in, FiniteElementSpace &fes_out, const Operator &oper, OperatorHandle &t_oper)
Ordering::Type GetOrdering() const
Return the ordering method.
int Size() const
Return the logical size of the array.
void GetFaceEdges(int i, Array< int > &, Array< int > &) const
int RowSize(const int i) const
Returns the number of elements in row i.
void SetSubVector(const Array< int > &dofs, const double value)
Set the entries listed in dofs to the given value.
int GetVSize() const
Return the number of vector dofs, i.e. GetNDofs() x GetVDim().
void GetVertexVDofs(int i, Array< int > &vdofs) const
void Add(const int i, const int j, const double a)
OpType * As() const
Return the Operator pointer statically cast to a specified OpType. Similar to the method Get()...
const Vector & GetWeights() const
void AddMultVWt(const Vector &v, const Vector &w, DenseMatrix &VWt)
VWt += v w^t.
void Load(std::istream &in, int fmt=0)
Read an Array from the stream in using format fmt. The format fmt can be:
void BuildTranspose() const
Build and store internally the transpose of this matrix which will be used in the methods AddMultTran...
int GetNDofs() const
Returns number of degrees of freedom.
int ndofs
Number of degrees of freedom. Number of unknowns is ndofs * vdim.
Class for an integration rule - an Array of IntegrationPoint.
const Array< int > & GetMaster() const
void GetElementInteriorVDofs(int i, Array< int > &vdofs) const
int DofToVDof(int dof, int vd, int ndofs=-1) const
void GetBdrElementEdges(int i, Array< int > &edges, Array< int > &cor) const
Return the indices and the orientations of all edges of bdr element i.
const SparseMatrix * GetConformingProlongation() const
The returned SparseMatrix is owned by the FiniteElementSpace.
const CoarseFineTransformations & GetDerefinementTransforms()
virtual void Update(bool want_transform=true)
Reflect changes in the mesh: update number of DOFs, etc. Also, calculate GridFunction transformation ...
void SetSize(int dim, int connections_per_row)
Set the size and the number of connections for the table.
void LoadBE(int i, const FiniteElement *BE) const
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
void GetEdgeVertices(int i, Array< int > &vert) const
Returns the indices of the vertices of edge i.
Operator that extracts Face degrees of freedom.
BilinearFormIntegrator * mass_integ
Ownership depends on own_mass_integ.
void BuildElementToDofTable() const
void AddColumnsInRow(int r, int ncol)
void BuildNURBSFaceToDofTable() const
Generates partial face_dof table for a NURBS space.
void MakeI(int nrows)
Next 7 methods are used together with the default constructor.
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
virtual void GetVertices(Array< int > &v) const =0
Returns element's vertices.
DerefinementOperator(const FiniteElementSpace *f_fes, const FiniteElementSpace *c_fes, BilinearFormIntegrator *mass_integ)
void Prolongate(const Vector &x, Vector &y) const
FiniteElementSpace & dom_fes
Domain FE space.
const FiniteElement * GetTraceElement(int i, Geometry::Type geom_type) const
Return the trace element from element 'i' to the given 'geom_type'.
virtual void Finalize(int skip_zeros=1)
Finalize the matrix initialization, switching the storage format from LIL to CSR. ...
int GetNumGeometries(int dim) const
Return the number of geometries of the given dimension present in the mesh.
HypreParMatrix * LeftDiagMult(const SparseMatrix &D, HYPRE_Int *row_starts=NULL) const
Multiply the HypreParMatrix on the left by a block-diagonal parallel matrix D and return the result a...
void SetSize(int s)
Resize the vector to size s.
SparseMatrix * RefinementMatrix(int old_ndofs, const Table *old_elem_dof)
int GetNBE() const
Returns number of boundary elements.
SparseMatrix * DerefinementMatrix(int old_ndofs, const Table *old_elem_dof)
Calculate GridFunction restriction matrix after mesh derefinement.
void GetElementVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom in array dofs for i'th element.
int * GetRowColumns(const int row)
Return a pointer to the column indices in a row.
static int DecodeDof(int dof)
Helpers to remove encoded sign from a DOF.
const T * HostRead() const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), false).
SparseMatrix * RefinementMatrix_main(const int coarse_ndofs, const Table &coarse_elem_dof, const DenseTensor localP[]) const
void BooleanMult(const Array< int > &x, Array< int > &y) const
y = A * x, treating all entries as booleans (zero=false, nonzero=true).
Lists all edges/faces in the nonconforming mesh.
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
void GetElementFaces(int i, Array< int > &, Array< int > &) const
Return the indices and the orientations of all faces of element i.
Pointer to an Operator of a specified type.
Operator::Type Type() const
Get the currently set operator type id.
virtual const FiniteElement * FiniteElementForGeometry(Geometry::Type GeomType) const =0
void Copy(Array ©) const
Create a copy of the internal array to the provided copy.
virtual ~DerefinementOperator()
void GetSubVector(const Array< int > &dofs, Vector &elemvect) const
Extract entries listed in dofs to the output Vector elemvect.
int GetFaceOrder(int i) const
Returns the order of the i'th face finite element.
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
virtual void GetEssentialVDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_vdofs, int component=-1) const
Mark degrees of freedom associated with boundary elements with the specified boundary attributes (mar...
void GetFaceVertices(int i, Array< int > &vert) const
Returns the indices of the vertices of face i.
Data type dense matrix using column-major storage.
int vdim
Vector dimension (number of unknowns per degree of freedom).
Geometry::Type Geom() const
void GetRow(int i, Array< int > &row) const
Return row i in array row (the Table must be finalized)
Operator::Type oper_type
Desired Operator::Type for the construction of all operators defined by the underlying transfer algor...
void Save(std::ostream &out, int fmt=0) const
Save the Array to the stream out using the format fmt. The format fmt can be:
int GetBdrAttribute(int i) const
int GetBdrElementEdgeIndex(int i) const
void SetSize(int i, int j, int k)
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1)
Get a list of essential true dofs, ess_tdof_list, corresponding to the boundary attributes marked in ...
int GetNE() const
Returns number of elements.
const Element * GetFace(int i) const
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
void GetDegenerateFaceDofs(int index, Array< int > &dofs, Geometry::Type master_geom) const
T Sum()
Return the sum of all the array entries using the '+'' operator for class 'T'.
void RebuildElementToDofTable()
Geometry::Type GetFaceBaseGeometry(int i) const
Abstract parallel finite element space.
virtual void MultTranspose(const Vector &x, Vector &y) const
Action of the transpose operator: y=A^t(x). The default behavior in class Operator is to generate an ...
const FiniteElement * GetFaceElement(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th face in the ...
virtual void GetTrueTransferOperator(const FiniteElementSpace &coarse_fes, OperatorHandle &T) const
Construct and return an Operator that can be used to transfer true-dof data from coarse_fes, defined on a coarse mesh, to this FE space, defined on a refined mesh.
int GetMapType() const
Returns the FiniteElement::MapType of the element describing how reference functions are mapped to ph...
void GetInverseMatrix(DenseMatrix &Ainv) const
Compute and return the inverse matrix in Ainv.
FiniteElementCollection * Load(Mesh *m, std::istream &input)
Read a FiniteElementSpace from a stream. The returned FiniteElementCollection is owned by the caller...
virtual const Operator & ForwardOperator()
Return an Operator that transfers GridFunctions from the domain FE space to GridFunctions in the rang...
void Factor()
Factor the current DenseMatrix, *a.
int HasFaceDofs(Geometry::Type GeomType) const
static bool IsEnabled()
Return true if any backend other than Backend::CPU is enabled.
double * GetData() const
Returns the matrix data array.
void AddRow(const int row, const Array< int > &cols, const Vector &srow)
double * GetRowEntries(const int row)
Return a pointer to the entries in a row.
double * GetData() const
Return a pointer to the beginning of the Vector data.
const FiniteElementCollection * fec
Associated FE collection (not owned).
OperatorHandle Th
Transformation to apply to GridFunctions after space Update().
HypreParMatrix * ParMult(const HypreParMatrix *A, const HypreParMatrix *B, bool own_matrix)
Geometry::Type GetElementBaseGeometry(int i) const
int Size_of_connections() const
void GetLocalDerefinementMatrices(Geometry::Type geom, DenseTensor &localR) const
bool HasGeometry(Geometry::Type geom) const
Return true iff the given geom is encountered in the mesh. Geometries of dimensions lower than Dimens...
void skip_comment_lines(std::istream &is, const char comment_char)
Check if the stream starts with comment_char. If so skip it.
void DeleteAll()
Delete the whole array.
void BooleanMultTranspose(const Array< int > &x, Array< int > &y) const
y = At * x, treating all entries as booleans (zero=false, nonzero=true).
void AddConnections(int r, const int *c, int nc)
Array< int > dof_elem_array
static void MarkerToList(const Array< int > &marker, Array< int > &list)
Convert a Boolean marker array to a list containing all marked indices.
void GetFaceInteriorDofs(int i, Array< int > &dofs) const
Derefinement operator, used by the friend class InterpolationGridTransfer.
virtual int DofForGeometry(Geometry::Type GeomType) const =0
virtual void GetFaceDofs(int i, Array< int > &dofs) const
Returns the indexes of the degrees of freedom for i'th face including the dofs for the edges and the ...
FiniteElementSpace & ran_fes
Range FE space.
void ConvertFromConformingVDofs(const Array< int > &cdofs, Array< int > &dofs)
For a partially conforming FE space, convert a marker array (nonzero entries are true) on the conform...
const IntegrationRule * IntRule
Not owned.
const Operator * GetElementRestriction(ElementDofOrdering e_ordering) const
Return an Operator that converts L-vectors to E-vectors.
int GetNumFaces() const
Return the number of faces (3D), edges (2D) or vertices (1D).
const SparseMatrix * GetConformingRestriction() const
The returned SparseMatrix is owned by the FiniteElementSpace.
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference element.
ID for class SparseMatrix.
const Array< int > & GetSlave() const
virtual void Mult(const Vector &x, Vector &y) const
Operator application: y=A(x).
void Load(std::istream **in, int np, int *dim)
Reads a vector from multiple files.
int GetNE() const
Returns number of elements in the mesh.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
void GetVertexDofs(int i, Array< int > &dofs) const
virtual const Operator & BackwardOperator()
Return an Operator that transfers GridFunctions from the range FE space back to GridFunctions in the ...
virtual void AssembleElementMatrix(const FiniteElement &el, ElementTransformation &Trans, DenseMatrix &elmat)
void MultTranspose(const double *x, double *y) const
Multiply a vector with the transpose matrix.
General product operator: x -> (A*B)(x) = A(B(x)).
void BuildBdrElementToDofTable() const
ID for the base class Operator, i.e. any type.
const FiniteElement * GetEdgeElement(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th edge in the ...
virtual int GetRow(const int row, Array< int > &cols, Vector &srow) const
Extract all column indices and values from a given row.
virtual void Mult(const Vector &x, Vector &y) const
Operator application: y=A(x).
void AddMult(const DenseMatrix &b, const DenseMatrix &c, DenseMatrix &a)
Matrix matrix multiplication. A += B * C.
int GetNBE() const
Returns number of boundary elements in the mesh.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
int Append(const T &el)
Append element 'el' to array, resize if necessary.
Mesh * GetMesh() const
Returns the mesh.
Operator that extracts Face degrees of freedom.
OperatorHandle F
Forward, coarse-to-fine, operator.
void mfem_error(const char *msg)
Function called when an error is encountered. Used by the macros MFEM_ABORT, MFEM_ASSERT, MFEM_VERIFY.
A class that performs interpolation from an E-vector to quadrature point values and/or derivatives (Q...
GridTransfer(FiniteElementSpace &dom_fes_, FiniteElementSpace &ran_fes_)
SparseMatrix * cR
Conforming restriction matrix such that cR.cP=I.
void GetRow(int r, Vector &row) const
const IntegrationRule * IntRule
Not owned.
SparseMatrix * D2Const_GlobalRestrictionMatrix(FiniteElementSpace *cfes)
Generate the global restriction matrix from a discontinuous FE space to the piecewise constant FE spa...
static const int NumVerts[NumGeom]
SparseMatrix * D2C_GlobalRestrictionMatrix(FiniteElementSpace *cfes)
Generate the global restriction matrix from a discontinuous FE space to the continuous FE space of th...
void AddConnection(int r, int c)
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...
HypreParMatrix * Dof_TrueDof_Matrix() const
The true dof-to-dof interpolation matrix.
virtual const Operator * GetProlongationMatrix() const
The returned Operator is owned by the FiniteElementSpace.
virtual void GetElementDofs(int i, Array< int > &dofs) const
Returns indexes of degrees of freedom in array dofs for i'th element.
void BuildConformingInterpolation() const
Calculate the cP and cR matrices for a nonconforming mesh.
NURBSExtension * StealNURBSext()
void Reserve(int capacity)
Ensures that the allocated size is at least the given size.
virtual ~RefinementOperator()
virtual const FiniteElement * TraceFiniteElementForGeometry(Geometry::Type GeomType) const
L2Projection(const FiniteElementSpace &fes_ho_, const FiniteElementSpace &fes_lor_)
static void AddDependencies(SparseMatrix &deps, Array< int > &master_dofs, Array< int > &slave_dofs, DenseMatrix &I)
bool IsDGSpace() const
Return whether or not the space is discontinuous (L2)
Array< int > dof_ldof_array
const Array< int > & GetOrders() const
Read-only access to the orders of all knot vectors.
int GetVDim() const
Returns vector dimension.
int Size() const
Returns the number of TYPE I elements.
int GetNF() const
Returns number of faces (i.e. co-dimension 1 entities) in the mesh.
virtual void GetBoundaryClosure(const Array< int > &bdr_attr_is_ess, Array< int > &bdr_vertices, Array< int > &bdr_edges)
Array< QuadratureInterpolator * > E2Q_array
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...
A class that performs interpolation from a face E-vector to quadrature point values and/or derivative...
void GetEdgeDofs(int i, Array< int > &dofs) const
Returns the indexes of the degrees of freedom for i'th edge including the dofs for the vertices of th...
Operator * Ptr() const
Access the underlying Operator pointer.
OperatorHandle L2E_nat
The element restriction operators, see GetElementRestriction().
int slaves_end
slave faces
void GetTransferOperator(const FiniteElementSpace &coarse_fes, OperatorHandle &T) const
Construct and return an Operator that can be used to transfer GridFunction data from coarse_fes...
OperatorHandle B
Backward, fine-to-coarse, operator.
void GetElementInteriorDofs(int i, Array< int > &dofs) const
void GetLocalRefinementMatrices(Geometry::Type geom, DenseTensor &localP) const
int GetOrder() const
If all orders are identical, return that number. Otherwise, return NURBSFECollection::VariableOrder.
List of mesh geometries stored as Array<Geometry::Type>.
virtual const Operator & BackwardOperator()
Return an Operator that transfers GridFunctions from the range FE space back to GridFunctions in the ...
virtual const Operator * GetFaceRestriction(ElementDofOrdering e_ordering, FaceType, L2FaceValues mul=L2FaceValues::DoubleValued) const
Return an Operator that converts L-vectors to E-vectors on each face.
void GetBdrElementFace(int i, int *, int *) const
Return the index and the orientation of the face of bdr element i. (3D)
void SetMassIntegrator(BilinearFormIntegrator *mass_integ_, bool own_mass_integ_=true)
Assign a mass integrator to be used in the construction of the backward, fine-to-coarse, transfer operator.
double Min() const
Returns the minimal element of the vector.
ElementTransformation * GetElementTransformation(int i) const
Returns ElementTransformation for the i-th element.
Type
Enumeration defining IDs for some classes derived from Operator.
virtual const int * DofOrderForOrientation(Geometry::Type GeomType, int Or) const =0
Returns an array, say p, that maps a local permuted index i to a local base index: base_i = p[i]...
RefinementOperator(const FiniteElementSpace *fespace, Table *old_elem_dof, int old_ndofs)
double p(const Vector &x, double t)
void LoadFE(int i, const FiniteElement *FE) const
void SetOrder(int Order) const
Set the order and the name, based on the given Order: either a positive number for fixed order...
Operator that converts FiniteElementSpace L-vectors to E-vectors.
void Print(std::ostream &out=mfem::out, int width=8) const
Prints vector to stream out.
Nonconforming edge/face within a bigger edge/face.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
int GetDof() const
Returns the number of degrees of freedom in the finite element.
virtual ~FiniteElementSpace()
bool OwnsOperator() const
Return true if the OperatorHandle owns the held Operator.
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
SparseMatrix * H2L_GlobalRestrictionMatrix(FiniteElementSpace *lfes)
Construct the restriction matrix from the FE space given by (*this) to the lower degree FE space give...
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
L2Prolongation * B
Backward, fine-to-coarse, operator.
int GetOrder(int i) const
Returns the order of the i'th finite element.
void Save(std::ostream &out) const
Write the QuadratureSpace to the stream out.
void Clear()
Clear the OperatorHandle, deleting the held Operator (if owned), while leaving the type id unchanged...
Helper struct for defining a connectivity table, see Table::MakeFromList.
void Mult(const double *x, double *y) const
Matrix vector multiplication with the inverse of dense matrix.
Table * GetElementDofTable()
void MakeVDimMatrix(SparseMatrix &mat) const
Replicate 'mat' in the vector dimension, according to vdim ordering mode.
Table * GetBdrElementDofTable()
bool own_mass_integ
Ownership flag for mass_integ.
The ordering method used when the number of unknowns per mesh node (vector dimension) is bigger than ...
void GetEdgeInteriorVDofs(int i, Array< int > &vdofs) const
void GetEntityDofs(int entity, int index, Array< int > &dofs, Geometry::Type master_geom=Geometry::INVALID) const
Helper to get vertex, edge or face DOFs (entity=0,1,2 resp.).
Linear2DFiniteElement TriangleFE
const CoarseFineTransformations & GetRefinementTransforms()
L2Projection * F
Forward, coarse-to-fine, operator.
Operation GetLastOperation() const
Return type of last modification of the mesh.
static FiniteElementCollection * New(const char *name)
Factory method: return a newly allocated FiniteElementCollection according to the given name...
T * HostWrite()
Shortcut for mfem::Write(a.GetMemory(), a.Size(), false).
bool Nonconforming() const
virtual void GetBdrElementDofs(int i, Array< int > &dofs) const
Returns indexes of degrees of freedom for i'th boundary element.
NURBSExtension * NURBSext
Optional NURBS mesh extension.
int GetNV() const
Returns number of vertices. Vertices are only at the corners of elements, where you would expect them...
virtual const Operator & ForwardOperator()
Return an Operator that transfers GridFunctions from the domain FE space to GridFunctions in the rang...
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...
virtual const char * Name() const
Class for integration point with weight.
void SetOperatorOwner(bool own=true)
Set the ownership flag for the held Operator.
void GetElementEdges(int i, Array< int > &edges, Array< int > &cor) const
Return the indices and the orientations of all edges of element i.
Mesh * mesh
The mesh that FE space lives on (not owned).
void ReorderElementToDofTable()
Reorder the scalar DOFs based on the element ordering.
GridFunction interpolation operator applicable after mesh refinement.
double Max() const
Returns the maximal element of the vector.
static const int DimStart[MaxDim+2]
const NCList & GetNCList(int entity)
Return vertex/edge/face list (entity = 0/1/2, respectively).
Array< FaceQuadratureInterpolator * > E2BFQ_array
int GetNConformingDofs() const
void GetEdgeInteriorDofs(int i, Array< int > &dofs) const
const QuadratureInterpolator * GetQuadratureInterpolator(const IntegrationRule &ir) const
Return a QuadratureInterpolator that interpolates E-vectors to quadrature point values and/or derivat...
ElementDofOrdering
Constants describing the possible orderings of the DOFs in one element.
General triple product operator x -> A*B*C*x, with ownership of the factors.
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Array< FaceQuadratureInterpolator * > E2IFQ_array
void BuildFaceToDofTable() const
signed char geom
Geometry::Type (faces only) (char to save RAM)
void OrientedPointMatrix(const Slave &slave, DenseMatrix &oriented_matrix) const
Return the point matrix oriented according to the master and slave edges.
const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th element in t...
int index(int i, int j, int nx, int ny)
Lexicographic ordering for tensor-product FiniteElements.
virtual int GetNVertices() const =0
int parent
Element index in the coarse mesh.
FiniteElementSpace()
Default constructor: the object is invalid until initialized using the method Load().
QuadratureSpace(Mesh *mesh_, int order_)
Create a QuadratureSpace based on the global rules from IntRules.
void Constructor(Mesh *mesh, NURBSExtension *ext, const FiniteElementCollection *fec, int vdim=1, int ordering=Ordering::byNODES)
Help function for constructors + Load().
NCMesh * ncmesh
Optional non-conforming mesh extension.
Geometry::Type GetBdrElementBaseGeometry(int i) const
void GetFaceVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom for i'th face element (2D and 3D).
void SetRow(const int row, const Array< int > &cols, const Vector &srow)
void GetEdgeVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom for i'th edge.
HYPRE_Int * GetTrueDofOffsets() const
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 Mult(const Vector &x, Vector &y) const
Perform the L2 projection onto the LOR space.
int GetNEdges() const
Return the number of edges.
void filter_dos(std::string &line)
Check for, and remove, a trailing '\r' from and std::string.
void MakeRef(T *, int)
Make this Array a reference to a pointer.
int GetNFaces() const
Return the number of faces in a 3D mesh.
BiLinear2DFiniteElement QuadrilateralFE
void MultAtB(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &AtB)
Multiply the transpose of a matrix A with a matrix B: At*B.
void Mult(const double *x, double *y) const
Matrix vector multiplication.
std::tuple< bool, ElementDofOrdering, FaceType, L2FaceValues > key_face
The face restriction operators, see GetFaceRestriction().
ID for class HypreParMatrix.
void CopyMN(const DenseMatrix &A, int m, int n, int Aro, int Aco)
Copy the m x n submatrix of A at row/col offsets Aro/Aco to *this.
const Table & GetElementToDofTable() const
Return a reference to the internal Table that stores the lists of scalar dofs, for each mesh element...
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
static bool DofFinalizable(int dof, const Array< bool > &finalized, const SparseMatrix &deps)
Class representing the storage layout of a QuadratureFunction.
void UseExternalData(double *d, int h, int w)
Change the data array and the size of the DenseMatrix.
const FiniteElement * GetBE(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th boundary fac...
NURBSExtension * NURBSext
void GetBdrElementVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom for i'th boundary element.
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
Wrapper for hypre's ParCSR matrix class.
virtual const SparseMatrix * GetRestrictionMatrix() const
The returned SparseMatrix is owned by the FiniteElementSpace.
void Swap(SparseMatrix &other)
Rank 3 tensor (array of matrices)
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
void Save(std::ostream &out) const
Save finite element space to output stream out.
Abstract data type element.
void BuildDofToArrays()
Initialize internal data that enables the use of the methods GetElementForDof() and GetLocalDofForDof...
Linear1DFiniteElement SegmentFE
void GetBdrElementVertices(int i, Array< int > &v) const
Returns the indices of the vertices of boundary element i.
Operator that converts L2 FiniteElementSpace L-vectors to E-vectors.
void GetElementVertices(int i, Array< int > &v) const
Returns the indices of the vertices of element i.
static void AdjustVDofs(Array< int > &vdofs)
void SetType(Operator::Type tid)
Invoke Clear() and set a new type id.
const Element * GetBdrElement(int i) const
Defines the position of a fine element within a coarse element.
void Reset(OpType *A, bool own_A=true)
Reset the OperatorHandle to the given OpType pointer, A.
int matrix
Index into the DenseTensor corresponding to the parent Geometry::Type stored in CoarseFineTransformat...
double f(const Vector &p)
const QuadratureSpace * qspace
Not owned.
void DofsToVDofs(Array< int > &dofs, int ndofs=-1) const
const FaceQuadratureInterpolator * GetFaceQuadratureInterpolator(const IntegrationRule &ir, FaceType type) const
Return a FaceQuadratureInterpolator that interpolates E-vectors to quadrature point values and/or der...