24 MFEM_VERIFY(lf->
Size() == fes.
GetVSize(),
"LinearForm size does not "
25 "match the number of vector dofs!");
32 for (
int k = 0; k < domain_integs.
Size(); ++k)
35 const Array<int> *domain_integs_marker_k = domain_integs_marker[k];
38 const bool has_markers_k = domain_integs_marker_k !=
nullptr;
43 MFEM_VERIFY(mesh_attributes_max == domain_integs_marker_k->
Size(),
44 "invalid element marker for domain linear form "
45 "integrator #" << k <<
", counting from zero");
53 const int NE = fes.
GetNE();
54 const auto attr = attributes->
Read();
55 const auto dimk = domain_integs_marker_k->
Read();
56 auto markers_w = markers.
Write();
59 markers_w[e] = dimk[attr[e]-1] == 1;
65 domain_integs[k]->AssembleDevice(fes, markers, b);
75 for (
int k = 0; k < boundary_integs.
Size(); ++k)
78 const Array<int> *boundary_integs_marker_k = boundary_integs_marker[k];
81 const bool has_markers_k = boundary_integs_marker_k !=
nullptr;
86 MFEM_VERIFY(bdr_attributes_max == boundary_integs_marker_k->
Size(),
87 "invalid boundary marker for boundary linear form "
88 "integrator #" << k <<
", counting from zero");
92 if (!has_markers_k) { bdr_markers.
HostReadWrite(); bdr_markers = 1; }
96 const int NBE = bdr_face_attributes->
Size();
97 const auto attr = bdr_face_attributes->
Read();
98 const auto attr_markers = boundary_integs_marker_k->
Read();
99 auto markers_w = bdr_markers.
Write();
103 attr[e] > 0 ? (attr_markers[attr[e] - 1] == 1) :
false;
109 boundary_integs[k]->AssembleDevice(fes, bdr_markers, bdr_b);
124 const int NE = fes.
GetNE();
132 MFEM_VERIFY(elem_restrict_lex,
"Element restriction not available");
141 const int nf_bdr = bdr_face_attributes->
Size();
149 MFEM_VERIFY(bdr_restrict_lex,
"Face restriction not available");
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
T * Write(bool on_dev=true)
Shortcut for mfem::Write(a.GetMemory(), a.Size(), on_dev).
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
T * HostReadWrite()
Shortcut for mfem::ReadWrite(a.GetMemory(), a.Size(), false).
static MemoryType GetMemoryType()
(DEPRECATED) Equivalent to GetDeviceMemoryType().
void AddMultTranspose(const Vector &x, Vector &y, const real_t a=1.0) const override=0
Add the E-vector degrees of freedom x to the L-vector degrees of freedom y.
Base class for operators that extracts Face degrees of freedom.
void AddMultTranspose(const Vector &x, Vector &y, const real_t a=1.0) const override=0
Add the face degrees of freedom x to the element degrees of freedom y.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
int GetNE() const
Returns number of elements in the mesh.
const ElementRestrictionOperator * GetElementRestriction(ElementDofOrdering e_ordering) const
Return an Operator that converts L-vectors to E-vectors.
Mesh * GetMesh() const
Returns the mesh.
int GetVSize() const
Return the number of vector dofs, i.e. GetNDofs() x GetVDim().
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.
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
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...
const Array< int > & GetBdrFaceAttributes() const
Returns the attributes for all boundary elements in this mesh.
Array< int > attributes
A list of all unique element attributes used by the Mesh.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
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 ...
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.
ElementDofOrdering
Constants describing the possible orderings of the DOFs in one element.
void forall(int N, lambda &&body)