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++)
79 for (
int k = 0; k <
fnfi.Size(); k++)
81 fnfi[k]->AssembleFaceVector(*fe1, *fe2, *tr, el_x, el_y);
113 if (
fnfi.Size() == 0)
120 MFEM_ABORT(
"TODO: assemble contributions from shared face terms");
155 for (
int s1=0; s1<
fes.
Size(); ++s1)
157 for (
int s2=0; s2<
fes.
Size(); ++s2)
165 for (
int s=0; s<pf.
Size(); s++)
174 for (
int s1=0; s1<
fes.
Size(); ++s1)
176 for (
int s2=0; s2<
fes.
Size(); ++s2)
203 for (
int s = 0; s <
fes.
Size(); ++s)
207 rhs[s]->SetSubVector(*
ess_tdofs[s], 0.0);
217 for (
int s = 0; s <
fes.
Size(); ++s)
225 MPI_Allreduce(&enloc, &englo, 1, MPI_DOUBLE, MPI_SUM,
238 for (
int s=0; s<
fes.
Size(); ++s)
240 fes[s]->GetProlongationMatrix()->Mult(
248 MFEM_ABORT(
"TODO: assemble contributions from shared face terms");
251 for (
int s=0; s<
fes.
Size(); ++s)
253 fes[s]->GetProlongationMatrix()->MultTranspose(
267 for (
int s=0; s<
fes.
Size(); ++s)
269 fes[s]->GetProlongationMatrix()->Mult(
278 for (
int i = 0; i <
fes.
Size(); ++i)
280 for (
int j = 0; j <
fes.
Size(); ++j)
291 for (
int s1=0; s1<
fes.
Size(); ++s1)
293 for (
int s2=0; s2<
fes.
Size(); ++s2)
309 for (
int s1=0; s1<
fes.
Size(); ++s1)
313 for (
int s2=0; s2<
fes.
Size(); ++s2)
323 MFEM_ABORT(
"TODO: assemble contributions from shared face terms");
326 for (
int s1=0; s1<
fes.
Size(); ++s1)
328 for (
int s2=0; s2<
fes.
Size(); ++s2)
336 dA.MakeSquareBlockDiag(pfes[s1]->GetComm(), pfes[s1]->GlobalVSize(),
337 pfes[s1]->GetDofOffsets(),
Grads(s1,s1));
338 Ph.ConvertFrom(pfes[s1]->Dof_TrueDof_Matrix());
346 dA.MakeRectangularBlockDiag(pfes[s1]->GetComm(),
347 pfes[s1]->GlobalVSize(),
348 pfes[s2]->GlobalVSize(),
349 pfes[s1]->GetDofOffsets(),
350 pfes[s2]->GetDofOffsets(),
353 Ph.ConvertFrom(pfes[s2]->Dof_TrueDof_Matrix());
371 for (
int s1=0; s1<
fes.
Size(); ++s1)
373 for (
int s2=0; s2<
fes.
Size(); ++s2)
Abstract class for all finite elements.
int Size() const
Return the logical size of the array.
void SetSubVector(const Array< int > &dofs, const double value)
Set the entries listed in dofs to the given value.
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()
ParMesh * GetParMesh() const
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
Extract entries listed in dofs to the output Vector elemvect.
void Update(double *data, const Array< int > &bOffsets)
Update method.
int GetNE() const
Returns number of elements.
Abstract parallel finite element space.
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 elements of the elemvect Vector to the entries listed in dofs. Negative dof values cause the -dof...
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 in the FiniteElementCollection associated with i'th element in t...
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.