27 MFEM_VERIFY(!
Serial(),
"internal MFEM error");
32 real_t loc_energy, glob_energy;
38 MFEM_ABORT(
"TODO: add energy contribution from shared faces");
67 for (
int i = 0; i < n_shared_faces; i++)
70 int Elem2NbrNo = tr->Elem2No - pmesh->
GetNE();
72 fe1 = pfes->
GetFE(tr->Elem1No);
82 for (
int k = 0; k <
fnfi.Size(); k++)
84 fnfi[k]->AssembleFaceVector(*fe1, *fe2, *tr, el_x, el_y);
95 mfem::forall(N, [=] MFEM_HOST_DEVICE (
int i) { Y_RW[idx[i]] = 0.0; });
101 "this method is not supported yet with partial assembly");
120 if (
fnfi.Size() == 0)
127 MFEM_ABORT(
"TODO: assemble contributions from shared face terms");
163 for (
int s1=0; s1<
fes.Size(); ++s1)
165 for (
int s2=0; s2<
fes.Size(); ++s2)
173 for (
int s=0;
s<pf.
Size();
s++)
182 for (
int s1=0; s1<
fes.Size(); ++s1)
184 for (
int s2=0; s2<
fes.Size(); ++s2)
211 for (
int s = 0;
s <
fes.Size(); ++
s)
226 for (
int s = 0;
s <
fes.Size(); ++
s)
248 for (
int s=0;
s<
fes.Size(); ++
s)
250 fes[
s]->GetProlongationMatrix()->Mult(
258 MFEM_ABORT(
"TODO: assemble contributions from shared face terms");
261 for (
int s=0;
s<
fes.Size(); ++
s)
263 fes[
s]->GetProlongationMatrix()->MultTranspose(
281 for (
int s=0;
s<
fes.Size(); ++
s)
283 fes[
s]->GetProlongationMatrix()->Mult(
293 for (
int i = 0; i <
fes.Size(); ++i)
295 for (
int j = 0; j <
fes.Size(); ++j)
306 for (
int s1=0; s1<
fes.Size(); ++s1)
308 for (
int s2=0; s2<
fes.Size(); ++s2)
324 for (
int s1=0; s1<
fes.Size(); ++s1)
328 for (
int s2=0; s2<
fes.Size(); ++s2)
338 MFEM_ABORT(
"TODO: assemble contributions from shared face terms");
341 for (
int s1=0; s1<
fes.Size(); ++s1)
343 for (
int s2=0; s2<
fes.Size(); ++s2)
351 dA.MakeSquareBlockDiag(pfes[s1]->GetComm(), pfes[s1]->GlobalVSize(),
352 pfes[s1]->GetDofOffsets(),
Grads(s1,s1));
353 Ph.ConvertFrom(pfes[s1]->Dof_TrueDof_Matrix());
361 dA.MakeRectangularBlockDiag(pfes[s1]->GetComm(),
362 pfes[s1]->GlobalVSize(),
363 pfes[s2]->GlobalVSize(),
364 pfes[s1]->GetDofOffsets(),
365 pfes[s2]->GetDofOffsets(),
368 Ph.ConvertFrom(pfes[s2]->Dof_TrueDof_Matrix());
386 for (
int s1=0; s1<
fes.Size(); ++s1)
388 for (
int s2=0; s2<
fes.Size(); ++s2)
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).
A class to handle Block systems in a matrix-free implementation.
void SetBlock(int iRow, int iCol, Operator *op, real_t c=1.0)
Add a block op in the block-entry (iblock, jblock).
void Update(real_t *data, const Array< int > &bOffsets)
Update method.
void SyncFromBlocks() const
Synchronize the memory location flags (i.e. the memory validity flags) of the big/monolithic block-ve...
Vector & GetBlock(int i)
Get the i-th vector in the block.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
DofTransformation * GetElementVDofs(int i, Array< int > &vdofs) const
Returns indices of degrees of freedom for the i'th element. The returned indices are offsets into an ...
Abstract class for all finite elements.
int GetNE() const
Returns number of elements.
Pointer to an Operator of a specified type.
void EliminateRowsCols(OperatorHandle &A, const Array< int > &ess_dof_list)
Reset the OperatorHandle to be the eliminated part of A after elimination of the essential dofs ess_d...
void ConvertFrom(OperatorHandle &A)
Convert the given OperatorHandle A to the currently set type id.
void MakePtAP(OperatorHandle &A, OperatorHandle &P)
Reset the OperatorHandle to hold the product P^t A P.
Operator * Ptr() const
Access the underlying Operator pointer.
void Clear()
Clear the OperatorHandle, deleting the held Operator (if owned), while leaving the type id unchanged.
Operator::Type Type() const
Get the currently set operator type id.
Type
Enumeration defining IDs for some classes derived from Operator.
@ Hypre_ParCSR
ID for class HypreParMatrix.
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 ...
Abstract parallel finite element space.
HYPRE_BigInt GlobalVSize() const
HYPRE_BigInt * GetDofOffsets() const
HypreParMatrix * Dof_TrueDof_Matrix() const
The true dof-to-dof interpolation matrix.
void GetFaceNbrElementVDofs(int i, Array< int > &vdofs, DofTransformation &doftrans) const
ParMesh * GetParMesh() const
const FiniteElement * GetFaceNbrFE(int i) const
const FiniteElement * GetFE(int i) const override
void ExchangeFaceNbrData()
void MakeRef(FiniteElementSpace *f, real_t *v) override
Make the ParGridFunction reference external data on a new FiniteElementSpace.
Class for parallel meshes.
int GetNSharedFaces() const
Return the number of shared faces (3D), edges (2D), vertices (1D)
FaceElementTransformations * GetSharedFaceTransformations(int sf, bool fill2=true)
Get the FaceElementTransformations for the given shared face (edge 2D) using the shared face index sf...
virtual real_t * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), on_dev).
void SetSubVector(const Array< int > &dofs, const real_t value)
Set the entries listed in dofs to the given value.
void AddElementVector(const Array< int > &dofs, const Vector &elemvect)
Add elements of the elemvect Vector to the entries listed in dofs. Negative dof values cause the -dof...
void SyncMemory(const Vector &v) const
Update the memory location of the vector to match v.
void SetSize(int s)
Resize the vector to size s.
real_t * GetData() const
Return a pointer to the beginning of the Vector data.
virtual real_t * HostReadWrite()
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), false).
void GetSubVector(const Array< int > &dofs, Vector &elemvect) const
Extract entries listed in dofs to the output Vector elemvect.
void forall(int N, lambda &&body)
Helper struct to convert a C++ type to an MPI type.