44 trial_fes(
a->FESpace()),
45 test_fes(
a->FESpace())
55 const int integratorCount = integrators.
Size();
56 for (
int i = 0; i < integratorCount; ++i)
58 integrators[i]->AssembleMF(*
a->
FESpace());
61 MFEM_VERIFY(
a->
GetBBFI()->Size() == 0,
"AddBoundaryIntegrator is not "
62 "currently supported in MFBilinearFormExtension");
69 const int iSz = integrators.
Size();
73 for (
int i = 0; i < iSz; ++i)
75 integrators[i]->AssembleDiagonalMF(
localY);
92 for (
int i = 0; i < iSz; ++i)
94 integrators[i]->AssembleDiagonalMF(y);
134 const int iSz = integrators.
Size();
139 for (
int i = 0; i < iSz; ++i)
141 integrators[i]->AddMultMF(x, y);
148 for (
int i = 0; i < iSz; ++i)
156 const int iFISz = intFaceIntegrators.
Size();
163 for (
int i = 0; i < iFISz; ++i)
172 const int bFISz = bdrFaceIntegrators.
Size();
179 for (
int i = 0; i < bFISz; ++i)
191 const int iSz = integrators.
Size();
196 for (
int i = 0; i < iSz; ++i)
206 for (
int i = 0; i < iSz; ++i)
208 integrators[i]->AddMultTransposeMF(x, y);
213 const int iFISz = intFaceIntegrators.
Size();
220 for (
int i = 0; i < iFISz; ++i)
229 const int bFISz = bdrFaceIntegrators.
Size();
236 for (
int i = 0; i < bFISz; ++i)
248 trial_fes(
a->FESpace()),
249 test_fes(
a->FESpace())
270 for (
int i = 0; i < mesh.
GetNE(); ++i)
287 bool needs_normal_derivs =
false;
289 for (
int i = 0; i < integs.Size(); ++i)
291 if (integs[i]->RequiresFaceNormalDerivatives())
293 needs_normal_derivs =
true;
297 if (needs_normal_derivs)
304 const bool has_bdr_integs = (
a->
GetBFBFI()->Size() > 0 ||
316 bool needs_normal_derivs =
false;
318 for (
int i = 0; i < integs.Size(); ++i)
320 if (integs[i]->RequiresFaceNormalDerivatives())
322 needs_normal_derivs =
true;
326 if (needs_normal_derivs)
334 std::unordered_map<int,int> f_to_be;
335 for (
int i = 0; i < mesh.
GetNBE(); ++i)
343 int missing_bdr_elems = 0;
351 if (f_to_be.find(
f) != f_to_be.end())
353 const int be = f_to_be[
f];
366 if (missing_bdr_elems)
368 MFEM_WARNING(
"Missing " << missing_bdr_elems <<
" boundary elements "
369 "for boundary faces.");
381 if (integ->Patchwise())
384 "Patchwise integration requires a NURBS FE space");
385 integ->AssembleNURBSPA(*
a->
FESpace());
396 integ->AssemblePABoundary(*
a->
FESpace());
402 integ->AssemblePAInteriorFaces(*
a->
FESpace());
408 integ->AssemblePABoundaryFaces(*
a->
FESpace());
424 const int ne = attributes.Size();
425 const int nd = d.Size() / ne;
426 const auto d_attr =
Reshape(attributes.Read(), ne);
427 const auto d_m =
Reshape(markers->Read(), markers->Size());
428 auto d_d =
Reshape(d.ReadWrite(), nd, ne);
431 const int attr = d_attr[e];
432 if (d_m[attr - 1] == 0)
434 for (
int i = 0; i < nd; ++i)
443 const int iSz = integrators.
Size();
450 for (
int i = 0; i < iSz; ++i)
452 assemble_diagonal_with_markers(*integrators[i], elem_markers[i],
476 for (
int i = 0; i < iSz; ++i)
478 assemble_diagonal_with_markers(*integrators[i], elem_markers[i],
484 const int n_bdr_integs = bdr_integs.
Size();
489 for (
int i = 0; i < n_bdr_integs; ++i)
491 assemble_diagonal_with_markers(*bdr_integs[i], bdr_markers[i],
533 const int iSz = integrators.
Size();
535 bool allPatchwise =
true;
536 bool somePatchwise =
false;
538 for (
int i = 0; i < iSz; ++i)
540 if (integrators[i]->Patchwise())
542 somePatchwise =
true;
546 allPatchwise =
false;
550 MFEM_VERIFY(!(somePatchwise && !allPatchwise),
551 "All or none of the integrators should be patchwise");
557 for (
int i = 0; i < iSz; ++i)
559 if (integrators[i]->Patchwise())
561 integrators[i]->AddMultNURBSPA(x, y);
565 integrators[i]->AddMultPA(x, y);
576 for (
int i = 0; i < iSz; ++i)
590 const int iFISz = intFaceIntegrators.
Size();
625 for (
int i = 0; i < iFISz; ++i)
627 if (intFaceIntegrators[i]->RequiresFaceNormalDerivatives())
629 intFaceIntegrators[i]->AddMultPAFaceNormalDerivatives(
649 const int n_bdr_integs = bdr_integs.
Size();
650 const int n_bdr_face_integs = bdr_face_integs.
Size();
651 const bool has_bdr_integs = (n_bdr_face_integs > 0 || n_bdr_integs > 0);
670 for (
int i = 0; i < n_bdr_integs; ++i)
675 for (
int i = 0; i < n_bdr_face_integs; ++i)
677 if (bdr_face_integs[i]->RequiresFaceNormalDerivatives())
701 const int iSz = integrators.
Size();
707 for (
int i = 0; i < iSz; ++i)
718 for (
int i = 0; i < iSz; ++i)
720 integrators[i]->AddMultTransposePA(x, y);
725 const int iFISz = intFaceIntegrators.
Size();
732 for (
int i = 0; i < iFISz; ++i)
742 const int n_bdr_integs = bdr_integs.
Size();
743 const int n_bdr_face_integs = bdr_face_integs.
Size();
744 const bool has_bdr_integs = (n_bdr_face_integs > 0 || n_bdr_integs > 0);
754 for (
int i = 0; i < n_bdr_integs; ++i)
759 for (
int i = 0; i < n_bdr_face_integs; ++i)
771static void AddWithMarkers_(
781 const auto d_attr =
Reshape(attributes.
Read(), ne);
785 const int attr = d_attr[e];
786 if (d_m[attr - 1] == 0) {
return; }
787 for (
int i = 0; i < nd; ++i)
789 d_y(i, e) += d_x(i, e);
812 const int ne = attributes.
Size();
813 const int nd_1 = x.
Size() / ne;
814 const int nd_2 = dxdn.
Size() / ne;
816 AddWithMarkers_(ne, nd_1, tmp_y, *markers, attributes, y);
817 AddWithMarkers_(ne, nd_2, tmp_dydn, *markers, attributes, dydn);
830 const bool transpose,
839 const int ne = attributes.
Size();
840 const int nd = x.
Size() / ne;
841 AddWithMarkers_(ne, nd,
tmp_evec, *markers, attributes, y);
853 factorize_face_terms(false)
870 auto add_with_markers = [&](
const Vector &ea_1,
Vector &ea_2,
const int ne_,
874 if (ne_ == 0) {
return; }
875 const int sz = ea_1.
Size() / ne_;
876 const int *d_m = markers.Read();
877 const int *d_a = attrs.Read();
879 auto d_ea_2 =
Reshape(
add ? ea_2.ReadWrite() : ea_2.Write(), sz, ne_);
883 const int i = idx % sz;
884 const int e = idx / sz;
885 const real_t val = d_m[d_a[e] - 1] ? d_ea_1(i, e) : 0.0;
905 for (
int i = 0; i < integrators.
Size(); ++i)
907 const bool add = (i > 0);
909 if (markers ==
nullptr)
916 integrators[i]->AssembleEA(*
a->
FESpace(), ea_data_tmp,
false);
917 add_with_markers(ea_data_tmp,
ea_data,
ne, *markers,
928 const int n_bdr_integs = bdr_integs.
Size();
929 if (n_bdr_integs > 0)
934 for (
int i = 0; i < n_bdr_integs; ++i)
936 const bool add = (i > 0);
938 if (markers ==
nullptr)
945 bdr_integs[i]->AssembleEABoundary(*
a->
FESpace(), ea_data_tmp,
add);
954 const int intFaceIntegratorCount = intFaceIntegrators.
Size();
955 if (intFaceIntegratorCount>0)
961 for (
int i = 0; i < intFaceIntegratorCount; ++i)
963 const bool add = (i > 0);
964 intFaceIntegrators[i]->AssembleEAInteriorFaces(*
a->
FESpace(),
974 const int n_bdr_face_integs = bdr_face_integs.
Size();
975 if (n_bdr_face_integs > 0)
980 for (
int i = 0; i < n_bdr_face_integs; ++i)
982 const bool add = (i > 0);
984 if (markers ==
nullptr)
986 bdr_face_integs[i]->AssembleEABoundaryFaces(
992 bdr_face_integs[i]->AssembleEABoundaryFaces(*
a->
FESpace(),
1035 const int e = glob_j/NDOFS;
1036 const int j = glob_j%NDOFS;
1038 for (
int i = 0; i < NDOFS; i++)
1040 res += A(i, j, e)*X(i, e);
1053 const int iFISz = intFaceIntegrators.
Size();
1070 const int f = glob_j/NDOFS;
1071 const int j = glob_j%NDOFS;
1073 for (
int i = 0; i < NDOFS; i++)
1075 res += A_int(i, j, 0,
f)*X(i, 0,
f);
1079 for (
int i = 0; i < NDOFS; i++)
1081 res += A_int(i, j, 1,
f)*X(i, 1,
f);
1089 const int f = glob_j/NDOFS;
1090 const int j = glob_j%NDOFS;
1092 for (
int i = 0; i < NDOFS; i++)
1094 res += A_ext(i, j, 0,
f)*X(i, 0,
f);
1098 for (
int i = 0; i < NDOFS; i++)
1100 res += A_ext(i, j, 1,
f)*X(i, 1,
f);
1122 const int f = glob_j/NDOFS;
1123 const int j = glob_j%NDOFS;
1125 for (
int i = 0; i < NDOFS; i++)
1127 res += A(i, j,
f)*X(i,
f);
1158 const int e = glob_j/NDOFS;
1159 const int j = glob_j%NDOFS;
1161 for (
int i = 0; i < NDOFS; i++)
1163 res += A(j, i, e)*X(i, e);
1176 const int iFISz = intFaceIntegrators.
Size();
1193 const int f = glob_j/NDOFS;
1194 const int j = glob_j%NDOFS;
1196 for (
int i = 0; i < NDOFS; i++)
1198 res += A_int(j, i, 0,
f)*X(i, 0,
f);
1202 for (
int i = 0; i < NDOFS; i++)
1204 res += A_int(j, i, 1,
f)*X(i, 1,
f);
1212 const int f = glob_j/NDOFS;
1213 const int j = glob_j%NDOFS;
1215 for (
int i = 0; i < NDOFS; i++)
1217 res += A_ext(j, i, 1,
f)*X(i, 0,
f);
1221 for (
int i = 0; i < NDOFS; i++)
1223 res += A_ext(j, i, 0,
f)*X(i, 1,
f);
1245 const int f = glob_j/NDOFS;
1246 const int j = glob_j%NDOFS;
1248 for (
int i = 0; i < NDOFS; i++)
1250 res += A(j, i,
f)*X(i,
f);
1266 element_matrices.
SetSize(ndofs, ndofs,
ne);
1267 const int N = element_matrices.
TotalSize();
1270 auto d_element_matrices =
Reshape(element_matrices.
Write(),
1274 const int *d_dof_map =
nullptr;
1285 d_dof_map = dof_map.
Read();
1294 const int e = idx / ndofs / ndofs;
1295 const int i = idx % ndofs;
1296 const int j = (idx / ndofs) % ndofs;
1297 const int ii_s = d_dof_map[i];
1298 const int ii = (ii_s >= 0) ? ii_s : -1 - ii_s;
1299 const int s_i = (ii_s >= 0) ? 1 : -1;
1300 const int jj_s = d_dof_map[j];
1301 const int jj = (jj_s >= 0) ? jj_s : -1 - jj_s;
1302 const int s_j = (jj_s >= 0) ? 1 : -1;
1303 d_element_matrices(ii, jj, e) = s_i*s_j*d_ea_data(j, i, e);
1311 const int e = idx / ndofs / ndofs;
1312 const int i = idx % ndofs;
1313 const int j = (idx / ndofs) % ndofs;
1314 d_element_matrices(i, j, e) = d_ea_data(j, i, e);
1322 ndof_face, ndof_face,
nf_bdr);
1328 const int n_faces_per_el = 2*
dim;
1329 Array<int> face_maps(ndof_face * n_faces_per_el);
1330 for (
int lf_i = 0; lf_i < n_faces_per_el; ++lf_i)
1334 for (
int i = 0; i < ndof_face; ++i)
1336 face_maps[i + lf_i*ndof_face] = face_map[i];
1353 const auto d_face_maps =
Reshape(face_maps.
Read(), ndof_face, n_faces_per_el);
1360 const int lf_i = d_face_info(0,
f);
1361 const int e = d_face_info(1,
f);
1363 MFEM_FOREACH_THREAD(i_lex_face, x, ndof_face)
1366 const int i_lex = d_face_maps(i_lex_face, lf_i);
1368 const int ii_s = d_dof_map[i_lex];
1369 const int ii = (ii_s >= 0) ? ii_s : -1 - ii_s;
1371 const int i = reorder ? ii : i_lex;
1372 const int s_i = (ii_s < 0 && reorder) ? -1 : 1;
1374 MFEM_FOREACH_THREAD(j_lex_face, y, ndof_face)
1377 const int j_lex = d_face_maps(j_lex_face, lf_i);
1379 const int jj_s = d_dof_map[j_lex];
1380 const int jj = (jj_s >= 0) ? jj_s : -1 - jj_s;
1382 const int j = reorder ? jj : j_lex;
1383 const int s_j = (jj_s < 0 && reorder) ? -1 : 1;
1386 s_i*s_j*d_ea_bdr(i_lex_face, j_lex_face,
f));
1414 bool keep_nbr_block =
false;
1428 keep_nbr_block =
true;
1442 "Full Assembly not yet supported on NCMesh.");
1450 for (
int i =
height; i > 0; i--)
1478 if (restF) { restF->
FillI(*mat, keep_nbr_block); }
1482 for (
int i = 0; i <
height; i++)
1484 const int nnz = h_I[i];
1488 const int nnz = cpt;
1499 for (
int i =
height; i > 0; i--)
1525 pa->ParallelRAP(*pa->mat, A);
1538 "Only DiagonalPolicy::DIAG_ONE supported with"
1539 " FABilinearFormExtension.");
1582 const_cast<Vector&
>(x),0);
1586 auto dg_x_ptr = dg_x.
Write();
1587 auto x_ptr = x.
Read();
1590 dg_x_ptr[i] = x_ptr[i];
1592 const int shared_size = shared_x.
Size();
1593 auto shared_x_ptr = shared_x.
Read();
1596 dg_x_ptr[local_size+i] = shared_x_ptr[i];
1599 if ((pform =
dynamic_cast<ParBilinearForm*
>(
a)) && (pform->keep_nbr_block))
1601 mat->
Mult(dg_x, dg_y);
1603 auto dg_y_ptr = dg_y.
Read();
1607 y_ptr[i] += dg_y_ptr[i];
1643 const_cast<Vector&
>(x),0);
1647 auto dg_x_ptr = dg_x.
Write();
1648 auto x_ptr = x.
Read();
1651 dg_x_ptr[i] = x_ptr[i];
1653 const int shared_size = shared_x.
Size();
1654 auto shared_x_ptr = shared_x.
Read();
1657 dg_x_ptr[local_size+i] = shared_x_ptr[i];
1664 auto dg_y_ptr = dg_y.
Read();
1668 y_ptr[i] += dg_y_ptr[i];
1697 :
Operator(form->Height(), form->Width()),
a(form)
1727 trial_fes(form->TrialFESpace()),
1728 test_fes(form->TestFESpace()),
1729 elem_restrict_trial(NULL),
1730 elem_restrict_test(NULL)
1738 const int integratorCount = integrators.
Size();
1739 for (
int i = 0; i < integratorCount; ++i)
1743 MFEM_VERIFY(
a->
GetBBFI()->Size() == 0,
1744 "Partial assembly does not support AddBoundaryIntegrator yet.");
1746 "Partial assembly does not support AddTraceFaceIntegrator yet.");
1748 "Partial assembly does not support AddBdrTraceFaceIntegrator yet.");
1808 if (elem_restrict_x)
1810 elem_restrict_x->
Mult(x, localX);
1827 if (elem_restrict_y)
1848 const int iSz = integrators.
Size();
1855 for (
int i = 0; i < iSz; ++i)
1880 const int iSz = integrators.
Size();
1887 for (
int i = 0; i < iSz; ++i)
1906 const int iSz = integrators.
Size();
1912 if (H1elem_restrict_trial)
1925 for (
int i = 0; i < iSz; ++i)
1933 integrators[i]->AssembleDiagonalPA_ADAt(D,
localTest);
1938 if (H1elem_restrict_test)
1951 for (
int i = 0; i < iSz; ++i)
1955 integrators[i]->AssembleDiagonalPA_ADAt(
localTrial, diag);
1959 integrators[i]->AssembleDiagonalPA_ADAt(D, diag);
1981 const int integratorCount = integrators.
Size();
1982 for (
int i = 0; i < integratorCount; ++i)
2000 mfem_error(
"A real ElementRestriction is required in this setting!");
2003 auto tm = test_multiplicity.
ReadWrite();
2006 tm[i] = 1.0 / tm[i];
2014 const int iSz = integrators.
Size();
2021 for (
int i = 0; i < iSz; ++i)
2039 mfem_error(
"In this setting you need a real ElementRestriction!");
2047 const int iSz = integrators.
Size();
2053 MFEM_VERIFY(x.
Size() == test_multiplicity.
Size(),
"Input vector of wrong size");
2055 auto tm = test_multiplicity.
Read();
2064 for (
int i = 0; i < iSz; ++i)
2078 mfem_error(
"Trial ElementRestriction not defined");
MFEM_HOST_DEVICE T AtomicAdd(T &add, const T val)
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
Rank 3 tensor (array of matrices)
void SetSize(int i, int j, int k, MemoryType mt_=MemoryType::PRESERVE)
real_t * Write(bool on_dev=true)
Shortcut for mfem::Write(GetMemory(), TotalSize(), on_dev).
static MemoryType GetMemoryType()
(DEPRECATED) Equivalent to GetDeviceMemoryType().
static bool Allows(unsigned long b_mask)
Return true if any of the backends in the backend mask, b_mask, are allowed.
static MemoryType GetDeviceMemoryType()
Get the current Device MemoryType. This is the MemoryType used by most MFEM classes when allocating m...
Operator that converts FiniteElementSpace L-vectors to E-vectors.
void FillSparseMatrix(const Vector &mat_ea, SparseMatrix &mat) const
Fill a Sparse Matrix with Element Matrices.
void FillJAndData(const Vector &ea_data, SparseMatrix &mat) const
void MultTransposeUnsigned(const Vector &x, Vector &y) const
Compute MultTranspose without applying signs based on DOF orientations.
void MultLeftInverse(const Vector &x, Vector &y) const
void MultUnsigned(const Vector &x, Vector &y) const
Compute Mult without applying signs based on DOF orientations.
virtual void AddMultTransposeInPlace(Vector &x, Vector &y) const
Add the face degrees of freedom x to the element degrees of freedom y. Perform the same computation a...
virtual void NormalDerivativeAddMultTranspose(const Vector &x, Vector &y) const
Add the face reference-normal derivative degrees of freedom in x to the element degrees of freedom in...
virtual void AddMultTransposeUnsigned(const Vector &x, Vector &y, const real_t a=1.0) const
Add the face degrees of freedom x to the element degrees of freedom y ignoring the signs from DOF ori...
virtual void NormalDerivativeMult(const Vector &x, Vector &y) const
For each face, sets y to the partial derivative of x with respect to the reference coordinate whose d...
void Mult(const Vector &x, Vector &y) const override=0
Extract the face degrees of freedom from x into y.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
const NURBSExtension * GetNURBSext() const
virtual const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th element in t...
const ElementRestrictionOperator * GetElementRestriction(ElementDofOrdering e_ordering) const
Return an Operator that converts L-vectors to E-vectors.
const FiniteElement * GetTypicalTraceElement() const
Return a "typical" trace element.
int GetNFbyType(FaceType type) const
Returns the number of faces according to the requested type.
Mesh * GetMesh() const
Returns the mesh.
int GetVSize() const
Return the number of vector dofs, i.e. GetNDofs() x GetVDim().
bool IsDGSpace() const
Return whether or not the space is discontinuous (L2)
const FiniteElement * GetTypicalFE() const
Return GetFE(0) if the local mesh is not empty; otherwise return a typical FE based on the Geometry t...
virtual const FaceRestriction * GetFaceRestriction(ElementDofOrdering f_ordering, FaceType, L2FaceValues mul=L2FaceValues::DoubleValued) const
Return an Operator that converts L-vectors to E-vectors on each face.
virtual void GetFaceMap(const int face_id, Array< int > &face_map) const
Return the mapping from lexicographic face DOFs to lexicographic element DOFs for the given local fac...
int GetDof() const
Returns the number of degrees of freedom in the finite element.
Wrapper for hypre's ParCSR matrix class.
Operator that converts L2 FiniteElementSpace L-vectors to E-vectors.
void FillJAndData(const Vector &ea_data, SparseMatrix &mat) const
void FillI(SparseMatrix &mat) const
Operator that extracts Face degrees of freedom for L2 spaces.
virtual void FillI(SparseMatrix &mat, const bool keep_nbr_block=false) const
Fill the I array of SparseMatrix corresponding to the sparsity pattern given by this L2FaceRestrictio...
virtual void FillJAndData(const Vector &fea_data, SparseMatrix &mat, const bool keep_nbr_block=false) const
Fill the J and Data arrays of the SparseMatrix corresponding to the sparsity pattern given by this L2...
virtual void AddFaceMatricesToElementMatrices(const Vector &fea_data, Vector &ea_data) const
This methods adds the DG face matrices to the element matrices.
MemoryType GetMemoryType() const
Return a MemoryType that is currently valid. If both the host and the device pointers are currently v...
void New(int size)
Allocate host memory for size entries with the current host memory type returned by MemoryManager::Ge...
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.
int GetBdrElementFaceIndex(int be_idx) const
Return the local face (codimension-1) index for the given boundary element index.
int GetNE() const
Returns number of elements.
int Dimension() const
Dimension of the reference space used within the elements.
FaceInformation GetFaceInformation(int f) const
int GetNBE() const
Returns number of boundary elements.
Pointer to an Operator of a specified type.
OpType * As() const
Return the Operator pointer statically cast to a specified OpType. Similar to the method Get().
void Reset(OpType *A, bool own_A=true)
Reset the OperatorHandle to the given OpType pointer, A.
void FormRectangularLinearSystem(const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, Vector &x, Vector &b, Operator *&A, Vector &X, Vector &B)
Form a column-constrained linear system using a matrix-free approach.
void FormLinearSystem(const Array< int > &ess_tdof_list, Vector &x, Vector &b, Operator *&A, Vector &X, Vector &B, int copy_interior=0)
Form a constrained linear system using a matrix-free approach.
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.
virtual const Operator * GetOutputRestrictionTranspose() const
Transpose of GetOutputRestriction, directly available in this form to facilitate matrix-free RAP-type...
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().
void FormRectangularSystemOperator(const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, Operator *&A)
Return in A a parallel (on truedofs) version of this rectangular operator (including constraints).
Operator * SetupRAP(const Operator *Pi, const Operator *Po)
Returns RAP Operator of this, using input/output Prolongation matrices Pi corresponds to "P",...
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 ...
void Assemble() override
Partial assembly of all internal integrators.
PADiscreteLinearOperatorExtension(DiscreteLinearOperator *linop)
void AddMult(const Vector &x, Vector &y, const real_t c=1.0) const override
Operator application: y+=A(x) (default) or y+=a*A(x).
void AddMultTranspose(const Vector &x, Vector &y, const real_t c=1.0) const override
Operator transpose application: y+=A^t(x) (default) or y+=a*A^t(x).
const Operator * GetOutputRestrictionTranspose() const override
Transpose of GetOutputRestriction, directly available in this form to facilitate matrix-free RAP-type...
void FormRectangularSystemOperator(const Array< int > &, const Array< int > &, OperatorHandle &A) override
Abstract parallel finite element space.
void ExchangeFaceNbrData()
int GetFaceNbrVSize() const
Class for parallel grid function.
void ExchangeFaceNbrData()
void MakeRef(FiniteElementSpace *f, real_t *v) override
Make the ParGridFunction reference external data on a new FiniteElementSpace.
Rectangular Operator for imposing essential boundary conditions on the input space using only the act...
void MultTranspose(const Vector &x, Vector &y) const override
Multiply a vector with the transposed matrix. y = At * x.
Memory< int > & GetMemoryI()
void Mult(const Vector &x, Vector &y) const override
Matrix vector multiplication.
void OverrideSize(int height_, int width_)
Sets the height and width of the matrix.
void SortColumnIndices()
Sort the column indices corresponding to each row.
Memory< int > & GetMemoryJ()
Memory< real_t > & GetMemoryData()
const Array< int > & GetDofMap() const
Get an Array<int> that maps lexicographically ordered indices to the indices of the respective nodes/...
virtual const real_t * Read(bool on_dev=true) const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), on_dev).
virtual real_t * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), on_dev).
void SyncAliasMemory(const Vector &v) const
Update the alias memory location of the vector to match v.
Vector & Set(const real_t a, const Vector &x)
(*this) = a * x
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.
virtual real_t * Write(bool on_dev=true)
Shortcut for mfem::Write(vec.GetMemory(), vec.Size(), on_dev).
void mfem_error(const char *msg)
void add(const Vector &v1, const Vector &v2, Vector &v)
MFEM_HOST_DEVICE DeviceTensor< sizeof...(Dims), T > Reshape(T *ptr, Dims... dims)
Wrap a pointer as a DeviceTensor with automatically deduced template parameters.
bool DeviceCanUseCeed()
Function that determines if a CEED kernel should be used, based on the current mfem::Device configura...
void forall_2D(int N, int X, int Y, lambda &&body)
ElementDofOrdering GetEVectorOrdering(const FiniteElementSpace &fes)
Return LEXICOGRAPHIC if mesh contains only one topology and the elements are tensor elements,...
ElementDofOrdering
Constants describing the possible orderings of the DOFs in one element.
@ NATIVE
Native ordering as defined by the FiniteElement.
std::function< real_t(const Vector &)> f(real_t mass_coeff)
void forall(int N, lambda &&body)
@ CEED_MASK
Bitwise-OR of all CEED backends.