12 #include "../config/config.hpp" 17 #include "../general/forall.hpp" 27 MFEM_VERIFY(!
Serial(),
"internal MFEM error");
32 double loc_energy, glob_energy;
38 MFEM_ABORT(
"TODO: add energy contribution from shared faces");
41 MPI_Allreduce(&loc_energy, &glob_energy, 1, MPI_DOUBLE, MPI_SUM,
66 for (
int i = 0; i < n_shared_faces; i++)
81 for (
int k = 0; k <
fnfi.Size(); k++)
83 fnfi[k]->AssembleFaceVector(*fe1, *fe2, *tr, el_x, el_y);
94 mfem::forall(N, [=] MFEM_HOST_DEVICE (
int i) { Y_RW[idx[i]] = 0.0; });
100 "this method is not supported yet with partial assembly");
119 if (
fnfi.Size() == 0)
126 MFEM_ABORT(
"TODO: assemble contributions from shared face terms");
162 for (
int s1=0; s1<
fes.
Size(); ++s1)
164 for (
int s2=0; s2<
fes.
Size(); ++s2)
172 for (
int s=0;
s<pf.
Size();
s++)
181 for (
int s1=0; s1<
fes.
Size(); ++s1)
183 for (
int s2=0; s2<
fes.
Size(); ++s2)
233 MPI_Allreduce(&enloc, &englo, 1, MPI_DOUBLE, MPI_SUM,
249 fes[
s]->GetProlongationMatrix()->Mult(
257 MFEM_ABORT(
"TODO: assemble contributions from shared face terms");
262 fes[
s]->GetProlongationMatrix()->MultTranspose(
282 fes[
s]->GetProlongationMatrix()->Mult(
292 for (
int i = 0; i <
fes.
Size(); ++i)
294 for (
int j = 0; j <
fes.
Size(); ++j)
305 for (
int s1=0; s1<
fes.
Size(); ++s1)
307 for (
int s2=0; s2<
fes.
Size(); ++s2)
323 for (
int s1=0; s1<
fes.
Size(); ++s1)
327 for (
int s2=0; s2<
fes.
Size(); ++s2)
337 MFEM_ABORT(
"TODO: assemble contributions from shared face terms");
340 for (
int s1=0; s1<
fes.
Size(); ++s1)
342 for (
int s2=0; s2<
fes.
Size(); ++s2)
350 dA.MakeSquareBlockDiag(pfes[s1]->GetComm(), pfes[s1]->GlobalVSize(),
351 pfes[s1]->GetDofOffsets(),
Grads(s1,s1));
352 Ph.ConvertFrom(pfes[s1]->Dof_TrueDof_Matrix());
360 dA.MakeRectangularBlockDiag(pfes[s1]->GetComm(),
361 pfes[s1]->GlobalVSize(),
362 pfes[s2]->GlobalVSize(),
363 pfes[s1]->GetDofOffsets(),
364 pfes[s2]->GetDofOffsets(),
367 Ph.ConvertFrom(pfes[s2]->Dof_TrueDof_Matrix());
385 for (
int s1=0; s1<
fes.
Size(); ++s1)
387 for (
int s2=0; s2<
fes.
Size(); ++s2)
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
Abstract class for all finite elements.
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 SetSubVector(const Array< int > &dofs, const double value)
Set the entries listed in dofs to the given value.
void ConvertFrom(OperatorHandle &A)
Convert the given OperatorHandle A to the currently set type id.
void ExchangeFaceNbrData()
const FiniteElement * GetFaceNbrFE(int i) const
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.
Pointer to an Operator of a specified type.
void SyncFromBlocks() const
Synchronize the memory location flags (i.e. the memory validity flags) of the big/monolithic block-ve...
void Update(double *data, const Array< int > &bOffsets)
Update method.
Abstract parallel finite element space.
void GetSubVector(const Array< int > &dofs, Vector &elemvect) const
Extract entries listed in dofs to the output Vector elemvect.
virtual void MakeRef(FiniteElementSpace *f, double *v)
Make the ParGridFunction reference external data on a new FiniteElementSpace.
DofTransformation * GetFaceNbrElementVDofs(int i, Array< int > &vdofs) const
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...
FaceElementTransformations * GetSharedFaceTransformations(int sf, bool fill2=true)
ParMesh * GetParMesh() const
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...
double * GetData() const
Return a pointer to the beginning of the Vector data.
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 ...
Type
Enumeration defining IDs for some classes derived from Operator.
int GetNSharedFaces() const
Return the number of shared faces (3D), edges (2D), vertices (1D)
void MakeSquareBlockDiag(MPI_Comm comm, HYPRE_BigInt glob_size, HYPRE_BigInt *row_starts, SparseMatrix *diag)
Reset the OperatorHandle to hold a parallel square block-diagonal matrix using the currently set type...
virtual const FiniteElement * GetFE(int i) const
void forall(int N, lambda &&body)
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
HYPRE_BigInt GlobalVSize() const
void Clear()
Clear the OperatorHandle, deleting the held Operator (if owned), while leaving the type id unchanged...
HYPRE_BigInt * GetDofOffsets() const
int GetNE() const
Returns number of elements.
Operator::Type Type() const
Get the currently set operator type id.
virtual double * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), on_dev).
Operator * Ptr() const
Access the underlying Operator pointer.
int Size() const
Return the logical size of the array.
ID for class HypreParMatrix.
HypreParMatrix * Dof_TrueDof_Matrix() const
The true dof-to-dof interpolation matrix.
A class to handle Block systems in a matrix-free implementation.
Class for parallel meshes.
virtual double * HostReadWrite()
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), false).
void MakePtAP(OperatorHandle &A, OperatorHandle &P)
Reset the OperatorHandle to hold the product P^t A P.
void SetBlock(int iRow, int iCol, Operator *op, double c=1.0)
Add a block op in the block-entry (iblock, jblock).
Vector & GetBlock(int i)
Get the i-th vector in the block.