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())
283 bool needs_normal_derivs =
false;
285 for (
int i = 0; i < integs.Size(); ++i)
287 if (integs[i]->RequiresFaceNormalDerivatives())
289 needs_normal_derivs =
true;
293 if (needs_normal_derivs)
300 const bool has_bdr_integs = (
a->
GetBFBFI()->Size() > 0 ||
312 bool needs_normal_derivs =
false;
314 for (
int i = 0; i < integs.Size(); ++i)
316 if (integs[i]->RequiresFaceNormalDerivatives())
318 needs_normal_derivs =
true;
322 if (needs_normal_derivs)
339 if (integ->Patchwise())
342 "Patchwise integration requires a NURBS FE space");
343 integ->AssembleNURBSPA(*
a->
FESpace());
354 integ->AssemblePABoundary(*
a->
FESpace());
360 integ->AssemblePAInteriorFaces(*
a->
FESpace());
366 integ->AssemblePABoundaryFaces(*
a->
FESpace());
382 const int ne = attributes.Size();
383 const int nd = d.Size() / ne;
384 const auto d_attr =
Reshape(attributes.Read(), ne);
385 const auto d_m =
Reshape(markers->Read(), markers->Size());
386 auto d_d =
Reshape(d.ReadWrite(), nd, ne);
389 const int attr = d_attr[e];
390 if (attr <= 0 || d_m[attr - 1] == 0)
392 for (
int i = 0; i < nd; ++i)
401 const int iSz = integrators.
Size();
408 for (
int i = 0; i < iSz; ++i)
410 assemble_diagonal_with_markers(*integrators[i], elem_markers[i],
434 for (
int i = 0; i < iSz; ++i)
436 assemble_diagonal_with_markers(*integrators[i], elem_markers[i],
442 const int n_bdr_integs = bdr_integs.
Size();
447 for (
int i = 0; i < n_bdr_integs; ++i)
449 assemble_diagonal_with_markers(*bdr_integs[i], bdr_markers[i],
488 const bool useAbs)
const
492 const int iSz = integrators.
Size();
494 bool allPatchwise =
true;
495 bool somePatchwise =
false;
497 for (
int i = 0; i < iSz; ++i)
499 if (integrators[i]->Patchwise())
501 somePatchwise =
true;
505 allPatchwise =
false;
509 MFEM_VERIFY(!(somePatchwise && !allPatchwise),
510 "All or none of the integrators should be patchwise");
516 for (
int i = 0; i < iSz; ++i)
518 if (integrators[i]->Patchwise())
520 MFEM_ASSERT(!useAbs,
"AbsMult not implemented with NURBS!")
521 integrators[i]->AddMultNURBSPA(x, y);
525 if (useAbs) { integrators[i]->AddAbsMultPA(x, y); }
526 else { integrators[i]->AddMultPA(x, y); }
535 auto H1elem_restrict =
537 if (H1elem_restrict && useAbs)
546 for (
int i = 0; i < iSz; ++i)
551 if (H1elem_restrict && useAbs)
553 H1elem_restrict->AbsMultTranspose(
localY, y);
567 const int iFISz = intFaceIntegrators.
Size();
570 MFEM_ASSERT(!useAbs,
"AbsMult not implemented for face integrators!")
603 for (
int i = 0; i < iFISz; ++i)
605 if (intFaceIntegrators[i]->RequiresFaceNormalDerivatives())
607 intFaceIntegrators[i]->AddMultPAFaceNormalDerivatives(
627 const int n_bdr_integs = bdr_integs.
Size();
628 const int n_bdr_face_integs = bdr_face_integs.
Size();
629 const bool has_bdr_integs = (n_bdr_face_integs > 0 || n_bdr_integs > 0);
632 MFEM_ASSERT(!useAbs,
"AbsMult not implemented for bdr integrators!")
649 for (
int i = 0; i < n_bdr_integs; ++i)
654 for (
int i = 0; i < n_bdr_face_integs; ++i)
656 if (bdr_face_integs[i]->RequiresFaceNormalDerivatives())
682 const int iSz = integrators.
Size();
688 for (
int i = 0; i < iSz; ++i)
699 for (
int i = 0; i < iSz; ++i)
701 integrators[i]->AddMultTransposePA(x, y);
706 const int iFISz = intFaceIntegrators.
Size();
713 for (
int i = 0; i < iFISz; ++i)
723 const int n_bdr_integs = bdr_integs.
Size();
724 const int n_bdr_face_integs = bdr_face_integs.
Size();
725 const bool has_bdr_integs = (n_bdr_face_integs > 0 || n_bdr_integs > 0);
735 for (
int i = 0; i < n_bdr_integs; ++i)
740 for (
int i = 0; i < n_bdr_face_integs; ++i)
753static void AddWithMarkers_(
763 const auto d_attr =
Reshape(attributes.
Read(), ne);
767 const int attr = d_attr[e];
768 if (attr <= 0 || d_m[attr - 1] == 0) {
return; }
769 for (
int i = 0; i < nd; ++i)
771 d_y(i, e) += d_x(i, e);
794 const int ne = attributes.
Size();
795 const int nd_1 = x.
Size() / ne;
796 const int nd_2 = dxdn.
Size() / ne;
798 AddWithMarkers_(ne, nd_1, tmp_y, *markers, attributes, y);
799 AddWithMarkers_(ne, nd_2, tmp_dydn, *markers, attributes, dydn);
812 const bool transpose,
814 const bool useAbs)
const
830 const int ne = attributes.
Size();
831 const int nd = x.
Size() / ne;
832 AddWithMarkers_(ne, nd,
tmp_evec, *markers, attributes, y);
852 factorize_face_terms(false)
869 auto add_with_markers = [&](
const Vector &ea_1,
Vector &ea_2,
const int ne_,
873 if (ne_ == 0) {
return; }
874 const int sz = ea_1.
Size() / ne_;
875 const int *d_m = markers.Read();
876 const int *d_a = attrs.Read();
878 auto d_ea_2 =
Reshape(
add ? ea_2.ReadWrite() : ea_2.Write(), sz, ne_);
882 const int i = idx % sz;
883 const int e = idx / sz;
885 d_a[e] > 0 ? (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(),
1014 const bool useTranspose,
1015 const bool useAbs)
const
1018 MFEM_ASSERT(useAbs?(elemRest!=
nullptr):
true,
1019 "elem_restrict is not ElementRestriction*!")
1029 elemRest->AbsMult(x,
localX);
1053 const int e = glob_j/NDOFS;
1054 const int j = glob_j%NDOFS;
1056 for (
int i = 0; i < NDOFS; i++)
1058 res += A(i, j, e)*X(i, e);
1067 const int e = glob_j/NDOFS;
1068 const int j = glob_j%NDOFS;
1070 for (
int i = 0; i < NDOFS; i++)
1072 res += A(j, i, e)*X(i, e);
1082 elemRest->AbsMultTranspose(
localY, y);
1093 const int iFISz = intFaceIntegrators.
Size();
1096 MFEM_VERIFY(!useAbs,
"AbsMult not implemented with Face integrators!")
1112 abs_ea_data_int.
Abs();
1115 NDOFS, NDOFS, 2,
nf_int);
1120 const int f = glob_j/NDOFS;
1121 const int j = glob_j%NDOFS;
1123 for (
int i = 0; i < NDOFS; i++)
1125 res += A_int(i, j, 0,
f)*X(i, 0,
f);
1129 for (
int i = 0; i < NDOFS; i++)
1131 res += A_int(i, j, 1,
f)*X(i, 1,
f);
1140 const int f = glob_j/NDOFS;
1141 const int j = glob_j%NDOFS;
1143 for (
int i = 0; i < NDOFS; i++)
1145 res += A_int(j, i, 0,
f)*X(i, 0,
f);
1149 for (
int i = 0; i < NDOFS; i++)
1151 res += A_int(j, i, 1,
f)*X(i, 1,
f);
1161 abs_ea_data_ext.
Abs();
1164 NDOFS, NDOFS, 2,
nf_int);
1169 const int f = glob_j/NDOFS;
1170 const int j = glob_j%NDOFS;
1172 for (
int i = 0; i < NDOFS; i++)
1174 res += A_ext(i, j, 0,
f)*X(i, 0,
f);
1178 for (
int i = 0; i < NDOFS; i++)
1180 res += A_ext(i, j, 1,
f)*X(i, 1,
f);
1189 const int f = glob_j/NDOFS;
1190 const int j = glob_j%NDOFS;
1192 for (
int i = 0; i < NDOFS; i++)
1194 res += A_ext(j, i, 1,
f)*X(i, 0,
f);
1198 for (
int i = 0; i < NDOFS; i++)
1200 res += A_ext(j, i, 0,
f)*X(i, 1,
f);
1213 MFEM_ASSERT(!useAbs,
"AbsMult not implemented with Face integrators!")
1228 const int f = glob_j/NDOFS;
1229 const int j = glob_j%NDOFS;
1231 for (
int i = 0; i < NDOFS; i++)
1233 res += A(i, j,
f)*X(i,
f);
1243 const int f = glob_j/NDOFS;
1244 const int j = glob_j%NDOFS;
1246 for (
int i = 0; i < NDOFS; i++)
1248 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)
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 AbsMult(const Vector &x, Vector &y) const override
Compute Mult without applying signs based on DOF orientations.
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 MultLeftInverse(const Vector &x, Vector &y) const
void AbsMultTranspose(const Vector &x, Vector &y) const override
Compute MultTranspose 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 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...
virtual void AddAbsMultTranspose(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...
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).
const Array< int > & GetElementAttributes() const
Returns the attributes for all elements in this mesh. The i'th entry of the array is the attribute of...
int GetNE() const
Returns number of elements.
int Dimension() const
Dimension of the reference space used within the elements.
FaceInformation GetFaceInformation(int f) const
const Array< int > & GetBdrFaceAttributes() const
Returns the attributes for all boundary elements in this mesh.
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.
void Abs()
(*this)(i) = abs((*this)(i))
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.