12 #include "../config/config.hpp"
26 MFEM_VERIFY(!
Serial(),
"internal MFEM error");
31 double loc_energy, glob_energy;
37 MFEM_ABORT(
"TODO: add energy contribution from shared faces");
40 MPI_Allreduce(&loc_energy, &glob_energy, 1, MPI_DOUBLE, MPI_SUM,
64 for (
int i = 0; i < n_shared_faces; i++)
78 for (
int k = 0; k <
fnfi.Size(); k++)
80 fnfi[k]->AssembleFaceVector(*fe1, *fe2, *tr, el_x, el_y);
112 if (
fnfi.Size() == 0)
119 MFEM_ABORT(
"TODO: assemble contributions from shared face terms");
154 for (
int s1=0; s1<
fes.
Size(); ++s1)
156 for (
int s2=0; s2<
fes.
Size(); ++s2)
164 for (
int s=0; s<pf.
Size(); s++)
173 for (
int s1=0; s1<
fes.
Size(); ++s1)
175 for (
int s2=0; s2<
fes.
Size(); ++s2)
202 for (
int s=0; s<
fes.
Size(); ++s)
207 for (
int i=0; i <
ess_vdofs[s]->Size(); ++i)
212 (*rhs[s])(tdof) = 0.0;
226 for (
int s=0; s<
fes.
Size(); ++s)
228 fes[s]->GetProlongationMatrix()->Mult(
236 MFEM_ABORT(
"TODO: assemble contributions from shared face terms");
239 for (
int s=0; s<
fes.
Size(); ++s)
241 fes[s]->GetProlongationMatrix()->MultTranspose(
253 for (
int s=0; s<
fes.
Size(); ++s)
255 fes[s]->GetProlongationMatrix()->Mult(
267 for (
int s1=0; s1<
fes.
Size(); ++s1)
269 for (
int s2=0; s2<
fes.
Size(); ++s2)
285 for (
int s1=0; s1<
fes.
Size(); ++s1)
289 for (
int s2=0; s2<
fes.
Size(); ++s2)
299 MFEM_ABORT(
"TODO: assemble contributions from shared face terms");
302 for (
int s1=0; s1<
fes.
Size(); ++s1)
304 for (
int s2=0; s2<
fes.
Size(); ++s2)
312 dA.MakeSquareBlockDiag(pfes[s1]->GetComm(), pfes[s1]->GlobalVSize(),
313 pfes[s1]->GetDofOffsets(),
Grads(s1,s1));
314 Ph.ConvertFrom(pfes[s1]->Dof_TrueDof_Matrix());
319 dA.MakeRectangularBlockDiag(pfes[s1]->GetComm(),
320 pfes[s1]->GlobalVSize(),
321 pfes[s2]->GlobalVSize(),
322 pfes[s1]->GetDofOffsets(),
323 pfes[s2]->GetDofOffsets(),
326 Ph.ConvertFrom(pfes[s2]->Dof_TrueDof_Matrix());
341 for (
int s1=0; s1<
fes.
Size(); ++s1)
343 for (
int s2=0; s2<
fes.
Size(); ++s2)
Abstract class for Finite Elements.
int Size() const
Logical size of the array.
double * HostReadWrite()
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), false).
void ConvertFrom(OperatorHandle &A)
Convert the given OperatorHandle A to the currently set type id.
void ExchangeFaceNbrData()
HYPRE_Int * GetDofOffsets() const
void SetSize(int s)
Resize the vector to size s.
void GetElementVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom in array dofs for i'th element.
int GetNSharedFaces() const
Return the number of shared faces (3D), edges (2D), vertices (1D)
Pointer to an Operator of a specified type.
Operator::Type Type() const
Get the currently set operator type id.
void GetSubVector(const Array< int > &dofs, Vector &elemvect) const
void Update(double *data, const Array< int > &bOffsets)
Update method.
Abstract parallel finite element space.
int GetLocalTDofNumber(int ldof) const
double * GetData() const
Return a pointer to the beginning of the Vector data.
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 GetFaceNbrElementVDofs(int i, Array< int > &vdofs) const
virtual void MakeRef(FiniteElementSpace *f, double *v)
Make the ParGridFunction reference external data on a new FiniteElementSpace.
const FiniteElement * GetFaceNbrFE(int i) 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)
HypreParMatrix * Dof_TrueDof_Matrix() const
The true dof-to-dof interpolation matrix.
void AddElementVector(const Array< int > &dofs, const Vector &elemvect)
Add (element) subvector to the vector.
Operator * Ptr() const
Access the underlying Operator pointer.
HYPRE_Int GlobalVSize() const
Type
Enumeration defining IDs for some classes derived from Operator.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
void Clear()
Clear the OperatorHandle, deleting the held Operator (if owned), while leaving the type id unchanged...
void MakeSquareBlockDiag(MPI_Comm comm, HYPRE_Int glob_size, HYPRE_Int *row_starts, SparseMatrix *diag)
Reset the OperatorHandle to hold a parallel square block-diagonal matrix using the currently set type...
const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement associated with i'th element.
ID for class HypreParMatrix.
A class to handle Block systems in a matrix-free implementation.
Class for parallel meshes.
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.