12 #include "../config/config.hpp" 19 #include "../general/forall.hpp" 38 const int *partitioning)
54 int element_counter = 0;
56 const int glob_ne = glob_fes->
GetNE();
57 for (
int i = 0; i < glob_ne; i++)
59 if (partitioning[i] == MyRank)
101 MFEM_ASSERT(
pfes != NULL,
"not a ParFiniteElementSpace");
116 MFEM_ASSERT(
pfes != NULL,
"not a ParFiniteElementSpace");
131 MFEM_ASSERT(
pfes != NULL,
"not a ParFiniteElementSpace");
144 prolong->
Mult(*tv, *
this);
235 MPI_Request *requests =
new MPI_Request[2*num_face_nbrs];
236 MPI_Request *send_requests = requests;
237 MPI_Request *recv_requests = requests + num_face_nbrs;
238 MPI_Status *statuses =
new MPI_Status[num_face_nbrs];
240 auto d_data = this->
Read();
244 const int ldof = d_send_ldof[i];
245 d_send_data[i] = d_data[ldof >= 0 ? ldof : -1-ldof];
252 for (
int fn = 0; fn < num_face_nbrs; fn++)
257 MPI_Isend(&send_data_ptr[send_offset[fn]],
258 send_offset[fn+1] - send_offset[fn],
259 MPI_DOUBLE, nbr_rank, tag, MyComm, &send_requests[fn]);
261 MPI_Irecv(&face_nbr_data_ptr[recv_offset[fn]],
262 recv_offset[fn+1] - recv_offset[fn],
263 MPI_DOUBLE, nbr_rank, tag, MyComm, &recv_requests[fn]);
266 MPI_Waitall(num_face_nbrs, send_requests, statuses);
267 MPI_Waitall(num_face_nbrs, recv_requests, statuses);
287 int s = dofs.
Size()/fes_vdim;
338 return (DofVal * LocVec);
358 int dof = FElem->
GetDof();
375 for (
int k = 0; k < vdim; k++)
377 val(k) = shape * (&loc_data[dof * k]);
400 int comp,
Vector *tr)
const 419 T.Transform(ip, *tr);
444 return (DofVal * LocVec);
468 T.Transform(ip, *tr);
496 for (
int k = 0; k < vdim; k++)
498 val(k) = shape * (&loc_data[dof * k]);
504 int vdim = std::max(spaceDim, fe->
GetVDim());
508 vshape.MultTranspose(loc_data, val);
518 gcomm.
Bcast(elem_per_vdof);
530 gcomm.
Bcast(overlap);
536 for (
int i = 0; i < overlap.Size(); i++)
538 der(i) /= overlap[i];
548 "ParGridFunction::GetElementDofValues: ExchangeFaceNbrData " 549 "must be called before accessing face neighbor elements.");
571 double loc_integral, glob_integral;
575 MPI_Allreduce(&loc_integral, &glob_integral, 1, MPI_DOUBLE, MPI_SUM,
578 (*this) *= (delta_c->
Scale() / glob_integral);
592 ldof_attr.
Copy(gdof_attr);
595 gcomm.
Bcast(gdof_attr);
601 if (gdof_attr[i] > ldof_attr[i])
615 gcomm.
Bcast(gdof_attr);
618 (*this)(i) /= gdof_attr[i];
638 gcomm.
Bcast(zones_per_vdof);
660 gcomm.
Bcast(zones_per_vdof);
676 for (
int i = 0; i < values.
Size(); i++)
678 values(i) = values_counter[i] ? (*this)(i) : 0.0;
687 for (
int i = 0; i < values.
Size(); i++)
689 if (values_counter[i])
691 (*this)(i) = values(i)/values_counter[i];
698 for (
int i = 0; i < values_counter.
Size(); i++)
701 bool(values_counter[i]) == bool(ess_vdofs_marker[i]),
714 for (
int i = 0; i < values.
Size(); i++)
716 values(i) = values_counter[i] ? (*this)(i) : 0.0;
725 for (
int i = 0; i < values.
Size(); i++)
727 if (values_counter[i])
729 (*this)(i) = values(i)/values_counter[i];
736 for (
int i = 0; i < values_counter.
Size(); i++)
739 bool(values_counter[i]) == bool(ess_vdofs_marker[i]),
752 int fdof, intorder, k;
754 Vector shape, el_dofs, err_val, ell_coeff_val;
761 std::map<int,int> local_to_shared;
765 local_to_shared[i_local] = i;
770 double shared_face_factor = 1.0;
771 bool shared_face =
false;
772 int iel1, iel2, info1, info2;
781 if (info2 >= 0 && iel2 < 0)
783 int ishared = local_to_shared[i];
787 if ( (k = fe2->
GetOrder()) > intorder )
792 shared_face_factor = 0.5;
800 if ( (k = fe2->
GetOrder()) > intorder )
814 intorder = 2 * intorder;
827 transf = face_elem_transf->
Elem1;
833 for (k = 0; k < fdof; k++)
836 el_dofs(k) = (*this)(vdofs[k]);
840 el_dofs(k) = - (*this)(-1-vdofs[k]);
847 ell_coeff_val(j) = ell_coeff->
Eval(*transf, eip);
848 err_val(j) = exsol->
Eval(*transf, eip) - (shape * el_dofs);
853 transf = face_elem_transf->
Elem2;
860 for (k = 0; k < fdof; k++)
873 for (k = 0; k < fdof; k++)
876 el_dofs(k) = (*this)(vdofs[k]);
880 el_dofs(k) = - (*this)(-1 - vdofs[k]);
888 ell_coeff_val(j) += ell_coeff->
Eval(*transf, eip);
889 ell_coeff_val(j) *= 0.5;
890 err_val(j) -= (exsol->
Eval(*transf, eip) - (shape * el_dofs));
893 transf = face_elem_transf;
898 double nu = jump_scaling.
Eval(h,
p);
899 error += shared_face_factor*(ip.
weight * nu * ell_coeff_val(j) *
901 err_val(j) * err_val(j));
905 error = (error < 0.0) ? -sqrt(-error) : sqrt(error);
911 double *data_ =
const_cast<double*
>(
HostRead());
912 for (
int i = 0; i <
size; i++)
919 for (
int i = 0; i <
size; i++)
928 ostringstream fname_with_suffix;
929 fname_with_suffix << fname <<
"." << setfill(
'0') << setw(6) << rank;
930 ofstream ofs(fname_with_suffix.str().c_str());
931 ofs.precision(precision);
942 ofs.precision(precision);
956 serialgf.
Save(fname, precision);
962 Mesh &serial_mesh)
const 967 int vdim = pfespace->
GetVDim();
975 gf_serial.MakeOwner(fec_serial);
983 MPI_Comm my_comm = pmesh->
GetComm();
987 if (my_rank == save_rank)
990 for (
int e = 0; e < pmesh->
GetNE(); e++)
993 fespace_serial->GetElementVDofs(elem_count++, dofs);
994 gf_serial.SetSubVector(dofs, nodeval);
997 for (
int p = 0;
p < nranks;
p++)
999 if (
p == save_rank) {
continue; }
1000 MPI_Recv(&n_send_recv, 1, MPI_INT,
p, 448, my_comm, &status);
1004 MPI_Recv(&vals[0], n_send_recv, MPI_DOUBLE,
p, 449, my_comm, &status);
1006 for (
int i = 0; i < n_send_recv; )
1008 fespace_serial->GetElementVDofs(elem_count++, dofs);
1009 gf_serial.SetSubVector(dofs, &vals[i]);
1018 for (
int e = 0; e < pmesh->
GetNE(); e++)
1021 n_send_recv += vdim*fe->
GetDof();
1023 MPI_Send(&n_send_recv, 1, MPI_INT, save_rank, 448, my_comm);
1026 for (
int e = 0; e < pmesh->
GetNE(); e++)
1029 for (
int j = 0; j < nodeval.
Size(); j++)
1036 MPI_Send(&vals[0], n_send_recv, MPI_DOUBLE, save_rank, 449, my_comm);
1040 MPI_Barrier(my_comm);
1044 #ifdef MFEM_USE_ADIOS2 1046 const std::string& variable_name,
1049 double *data_ =
const_cast<double*
>(
HostRead());
1050 for (
int i = 0; i <
size; i++)
1057 for (
int i = 0; i <
size; i++)
1072 MyComm =
pfes -> GetComm();
1074 MPI_Comm_size(MyComm, &NRanks);
1075 MPI_Comm_rank(MyComm, &MyRank);
1077 double **values =
new double*[NRanks];
1078 int *nv =
new int[NRanks];
1079 int *nvdofs =
new int[NRanks];
1080 int *nedofs =
new int[NRanks];
1081 int *nfdofs =
new int[NRanks];
1082 int *nrdofs =
new int[NRanks];
1084 double * h_data =
const_cast<double *
>(this->
HostRead());
1087 nv[0] =
pfes -> GetVSize();
1088 nvdofs[0] =
pfes -> GetNVDofs();
1089 nedofs[0] =
pfes -> GetNEDofs();
1090 nfdofs[0] =
pfes -> GetNFDofs();
1097 for (
p = 1;
p < NRanks;
p++)
1099 MPI_Recv(&nv[
p], 1, MPI_INT,
p, 455, MyComm, &status);
1100 MPI_Recv(&nvdofs[
p], 1, MPI_INT,
p, 456, MyComm, &status);
1101 MPI_Recv(&nedofs[
p], 1, MPI_INT,
p, 457, MyComm, &status);
1102 MPI_Recv(&nfdofs[
p], 1, MPI_INT,
p, 458, MyComm, &status);
1103 values[
p] =
new double[nv[
p]];
1104 MPI_Recv(values[
p], nv[
p], MPI_DOUBLE,
p, 460, MyComm, &status);
1107 int vdim =
pfes -> GetVDim();
1109 for (
p = 0;
p < NRanks;
p++)
1111 nrdofs[
p] = nv[
p]/vdim - nvdofs[
p] - nedofs[
p] - nfdofs[
p];
1116 for (
int d = 0; d < vdim; d++)
1118 for (
p = 0;
p < NRanks;
p++)
1119 for (i = 0; i < nvdofs[
p]; i++)
1121 os << *values[
p]++ <<
'\n';
1124 for (
p = 0;
p < NRanks;
p++)
1125 for (i = 0; i < nedofs[
p]; i++)
1127 os << *values[
p]++ <<
'\n';
1130 for (
p = 0;
p < NRanks;
p++)
1131 for (i = 0; i < nfdofs[
p]; i++)
1133 os << *values[
p]++ <<
'\n';
1136 for (
p = 0;
p < NRanks;
p++)
1137 for (i = 0; i < nrdofs[
p]; i++)
1139 os << *values[
p]++ <<
'\n';
1145 for (
p = 0;
p < NRanks;
p++)
1146 for (i = 0; i < nvdofs[
p]; i++)
1147 for (
int d = 0; d < vdim; d++)
1149 os << *values[
p]++ <<
'\n';
1152 for (
p = 0;
p < NRanks;
p++)
1153 for (i = 0; i < nedofs[
p]; i++)
1154 for (
int d = 0; d < vdim; d++)
1156 os << *values[
p]++ <<
'\n';
1159 for (
p = 0;
p < NRanks;
p++)
1160 for (i = 0; i < nfdofs[
p]; i++)
1161 for (
int d = 0; d < vdim; d++)
1163 os << *values[
p]++ <<
'\n';
1166 for (
p = 0;
p < NRanks;
p++)
1167 for (i = 0; i < nrdofs[
p]; i++)
1168 for (
int d = 0; d < vdim; d++)
1170 os << *values[
p]++ <<
'\n';
1174 for (
p = 1;
p < NRanks;
p++)
1177 delete [] values[
p];
1183 MPI_Send(&nv[0], 1, MPI_INT, 0, 455, MyComm);
1184 MPI_Send(&nvdofs[0], 1, MPI_INT, 0, 456, MyComm);
1185 MPI_Send(&nedofs[0], 1, MPI_INT, 0, 457, MyComm);
1186 MPI_Send(&nfdofs[0], 1, MPI_INT, 0, 458, MyComm);
1187 MPI_Send(h_data, nv[0], MPI_DOUBLE, 0, 460, MyComm);
1207 loc_norm = -pow(-loc_norm,
p);
1211 loc_norm = pow(loc_norm,
p);
1214 MPI_Allreduce(&loc_norm, &glob_norm, 1, MPI_DOUBLE, MPI_SUM, comm);
1216 if (glob_norm < 0.0)
1218 glob_norm = -pow(-glob_norm, 1.0/
p);
1222 glob_norm = pow(glob_norm, 1.0/
p);
1227 MPI_Allreduce(&loc_norm, &glob_norm, 1, MPI_DOUBLE, MPI_MAX, comm);
1239 MFEM_VERIFY(ffes,
"the flux FE space must be ParFiniteElementSpace");
1252 for (
int i = 0; i < count.Size(); i++)
1254 if (count[i] != 0) { flux(i) /= count[i]; }
1275 int norm_p,
double solver_tol,
int solver_max_it)
1285 for (
int i = 0; i < xfes->
GetNE(); i++)
1296 *flux_fes.
GetFE(i), el_f,
false);
1313 MFEM_VERIFY(smooth_flux_fes.
GetFE(0) != NULL,
1314 "Could not obtain FE of smooth flux space.");
1320 a->AddDomainIntegrator(vmass);
1369 double total_error = 0.0;
1371 for (
int i = 0; i < xfes->
GetNE(); i++)
1374 total_error += pow(errors(i), norm_p);
1378 MPI_Allreduce(&total_error, &glob_error, 1, MPI_DOUBLE, MPI_SUM,
1381 return pow(glob_error, 1.0/norm_p);
1386 #endif // MFEM_USE_MPI 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 ...
virtual void GetElementDofValues(int el, Vector &dof_vals) const
T * HostReadWrite()
Shortcut for mfem::ReadWrite(a.GetMemory(), a.Size(), false).
virtual void Mult(const Vector &x, Vector &y) const
Matrix vector multiplication.
void SetSubVector(const Array< int > &dofs, const double value)
Set the entries listed in dofs to the given value.
virtual void CountElementsPerVDof(Array< int > &elem_per_vdof) const
For each vdof, counts how many elements contain the vdof, as containment is determined by FiniteEleme...
int GetNPoints() const
Returns the number of the points in the integration rule.
Class for an integration rule - an Array of IntegrationPoint.
virtual const Operator * GetProlongationMatrix() const
The returned Operator is owned by the FiniteElementSpace.
HypreParVector * NewTrueDofVector()
Class for grid function - Vector with associated FE space.
void GetDerivative(int comp, int der_comp, ParGridFunction &der)
Parallel version of GridFunction::GetDerivative(); see its documentation.
virtual void GetVectorValue(int i, const IntegrationPoint &ip, Vector &val) const
void ExchangeFaceNbrData()
void SumFluxAndCount(BilinearFormIntegrator &blfi, GridFunction &flux, Array< int > &counts, bool wcoef, int subdomain)
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
Base class for vector Coefficients that optionally depend on time and space.
void ProjectDeltaCoefficient(DeltaCoefficient &delta_coeff, double &integral)
const FiniteElement * GetFaceNbrFE(int i) const
void SaveAsOne(const char *fname, int precision=16) const
void Bcast(T *ldata, int layout) const
Broadcast within each group where the master is the root.
int GetNumFaces() const
Return the number of faces (3D), edges (2D) or vertices (1D).
HypreParVector * ParallelAssemble() const
Returns a new vector assembled on the true dofs.
void SetSize(int s)
Resize the vector to size s.
virtual const double * HostRead() const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), false).
double Scale()
Return the scale factor times the optional time dependent function. Returns with when not set by th...
virtual void Mult(const HypreParVector &b, HypreParVector &x) const
Solve Ax=b with hypre's PCG.
void ProjectDiscCoefficient(VectorCoefficient &coeff, Array< int > &dof_attr)
ParFiniteElementSpace * pfes
Points to the same object as fes.
int Size() const
Returns the size of the vector.
Data type dense matrix using column-major storage.
virtual double * HostWrite()
Shortcut for mfem::Write(vec.GetMemory(), vec.Size(), false).
Delta function coefficient optionally multiplied by a weight coefficient and a scaled time dependent ...
virtual void CountElementsPerVDof(Array< int > &elem_per_vdof) const
For each vdof, counts how many elements contain the vdof, as containment is determined by FiniteEleme...
virtual const double * Read(bool on_dev=true) const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), on_dev).
void DivideByGroupSize(double *vec)
Scale a vector of true dofs.
virtual void Mult(const Vector &x, Vector &y) const =0
Operator application: y=A(x).
virtual void ProjectDiscCoefficient(VectorCoefficient &coeff)
Project a discontinuous vector coefficient as a grid function on a continuous finite element space...
virtual void SetSpace(FiniteElementSpace *f)
Associate a new FiniteElementSpace with the ParGridFunction.
void AccumulateAndCountBdrTangentValues(VectorCoefficient &vcoeff, Array< int > &bdr_attr, Array< int > &values_counter)
Abstract parallel finite element space.
int GetFaceNbrVSize() const
virtual void ProjectCoefficient(Coefficient &coeff)
Project coeff Coefficient to this GridFunction. The projection computation depends on the choice of t...
double Eval(double h, int p) const
Vector send_data
Vector used as an MPI buffer to send face-neighbor data in ExchangeFaceNbrData() to neighboring proce...
void GetSubVector(const Array< int > &dofs, Vector &elemvect) const
Extract entries listed in dofs to the output Vector elemvect.
void ComputeMeans(AvgType type, Array< int > &zones_per_vdof)
virtual const SparseMatrix * GetRestrictionMatrix() const
Get the R matrix which restricts a local dof vector to true dof vector.
void SetPrintLevel(int print_lvl)
virtual double GetValue(int i, const IntegrationPoint &ip, int vdim=1) const
virtual const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th element in t...
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
void GetFaceElements(int Face, int *Elem1, int *Elem2) const
std::function< double(const Vector &)> f(double mass_coeff)
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
The BoomerAMG solver in hypre.
virtual void GetEssentialVDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_dofs, int component=-1) const
Determine the boundary degrees of freedom.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
Communicator performing operations within groups defined by a GroupTopology with arbitrary-size data ...
void ExchangeFaceNbrData()
double GetElementSize(ElementTransformation *T, int type=0)
static void Sum(OpData< T >)
Reduce operation Sum, instantiated for int and double.
int Append(const T &el)
Append element 'el' to array, resize if necessary.
virtual void Update()
Transform by the Space UpdateMatrix (e.g., on Mesh change).
const FiniteElementCollection * FEColl() const
virtual double * Write(bool on_dev=true)
Shortcut for mfem::Write(vec.GetMemory(), vec.Size(), on_dev).
Memory< int > & GetJMemory()
void MultTranspose(const double *x, double *y) const
Multiply a vector with the transpose matrix.
FaceElementTransformations * GetFaceElementTransformations(int FaceNo, int mask=31) override
void SetPrintLevel(int print_level)
FaceElementTransformations * GetSharedFaceTransformations(int sf, bool fill2=true)
ParMesh * GetParMesh() const
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const =0
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual const char * Name() const
void Reserve(int capacity)
Ensures that the allocated size is at least the given size.
int GetNFaceNeighbors() const
void AccumulateAndCountDerivativeValues(int comp, int der_comp, GridFunction &der, Array< int > &zones_per_dof)
Used for the serial and parallel implementations of the GetDerivative() method; see its documentation...
void AccumulateAndCountZones(Coefficient &coeff, AvgType type, Array< int > &zones_per_vdof)
Accumulates (depending on type) the values of coeff at all shared vdofs and counts in how many zones ...
HypreParVector * ParallelProject() const
Returns a new vector restricted to the true dofs.
virtual void MakeRef(FiniteElementSpace *f, double *v)
Make the GridFunction reference external data on a new FiniteElementSpace.
void GetFaceInfos(int Face, int *Inf1, int *Inf2) const
void ParallelProject(Vector &tv) const
Returns the vector restricted to the true dofs.
FiniteElementSpace * FESpace()
const T * Read(const Memory< T > &mem, int size, bool on_dev=true)
Get a pointer for read access to mem with the mfem::Device's DeviceMemoryClass, if on_dev = true...
ElementTransformation * GetFaceNbrElementTransformation(int i) const
int GetNE() const
Returns number of elements in the mesh.
int GetSharedFace(int sface) const
Return the local face index for the given shared face.
void SetMaxIter(int max_iter)
double * GetData() const
Return a pointer to the beginning of the Vector data.
int GetVDim() const
Returns vector dimension.
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 ...
virtual void GetElementDofValues(int el, Vector &dof_vals) const
Wrapper for hypre's parallel vector class.
double GlobalLpNorm(const double p, double loc_norm, MPI_Comm comm)
Compute a global Lp norm from the local Lp norms computed by each processor.
Mesh * GetMesh() const
Returns the mesh.
double p(const Vector &x, double t)
int GetNSharedFaces() const
Return the number of shared faces (3D), edges (2D), vertices (1D)
virtual const FiniteElement * GetFE(int i) const
void forall(int N, lambda &&body)
void ProjectBdrCoefficient(Coefficient *coeff[], VectorCoefficient *vcoeff, Array< int > &attr)
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
HypreParVector * ParallelAverage() const
Returns a new vector averaged on the true dofs.
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
FiniteElementSpace * fes
FE space on which the grid function lives. Owned if fec is not NULL.
virtual void ComputeFlux(BilinearFormIntegrator &blfi, GridFunction &flux, bool wcoef=true, int subdomain=-1)
static void Max(OpData< T >)
Reduce operation Max, instantiated for int and double.
ParFiniteElementSpace * ParFESpace() const
virtual double ComputeDGFaceJumpError(Coefficient *exsol, Coefficient *ell_coeff, JumpScaling jump_scaling, const IntegrationRule *irs[]=NULL) const
Returns the Face Jumps error for L2 elements.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
GroupCommunicator & GroupComm()
Return a reference to the internal GroupCommunicator (on VDofs)
int GetLocalTDofNumber(int ldof) const
static bool GetGPUAwareMPI()
FiniteElementCollection * fec
Used when the grid function is read from a file. It can also be set explicitly, see MakeOwner()...
int GetDof() const
Returns the number of degrees of freedom in the finite element.
double L2ZZErrorEstimator(BilinearFormIntegrator &flux_integrator, const ParGridFunction &x, ParFiniteElementSpace &smooth_flux_fes, ParFiniteElementSpace &flux_fes, Vector &errors, int norm_p, double solver_tol, int solver_max_it)
void Distribute(const Vector *tv)
virtual double GetValue(int i, const IntegrationPoint &ip, int vdim=1) const
virtual DofTransformation * GetElementDofs(int elem, Array< int > &dofs) const
Returns indices of degrees of freedom of element 'elem'. The returned indices are offsets into an ldo...
virtual void Update()
Transform by the Space UpdateMatrix (e.g., on Mesh change).
double ComputeElementLpDistance(double p, int i, GridFunction &gf1, GridFunction &gf2)
Compute the Lp distance between two grid functions on the given element.
int SpaceDimension() const
Dimension of the physical space containing the mesh.
virtual void GetVectorValue(int i, const IntegrationPoint &ip, Vector &val) const
virtual void Save(std::ostream &out) const
static FiniteElementCollection * New(const char *name)
Factory method: return a newly allocated FiniteElementCollection according to the given name...
void GetFaceNbrElementTransformation(int i, IsoparametricTransformation *ElTr)
int GetNE() const
Returns number of elements.
Vector face_nbr_data
Vector used to store data from face-neighbor processors, initialized by ExchangeFaceNbrData().
void CalcPhysShape(ElementTransformation &Trans, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in physical space at the point ...
Class for integration point with weight.
int GetVDim() const
Returns the vector dimension for vector-valued finite elements.
Ordering::Type GetOrdering() const
Return the ordering method.
virtual void ProjectBdrCoefficientTangent(VectorCoefficient &vcoeff, Array< int > &bdr_attr)
Project the tangential components of the given VectorCoefficient on the boundary. Only boundary attri...
double GetFaceNbrElementSize(int i, int type=0)
void SetPreconditioner(HypreSolver &precond)
Set the hypre solver to be used as a preconditioner.
void Destroy()
Destroy a vector.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
void Reduce(T *ldata, void(*Op)(OpData< T >)) const
Reduce within each group where the master is the root.
void Copy(Array ©) const
Create a copy of the internal array to the provided copy.
void AddDistribute(double a, const Vector *tv)
int GetVSize() const
Return the number of vector dofs, i.e. GetNDofs() x GetVDim().
int GetMapType() const
Returns the FiniteElement::MapType of the element describing how reference functions are mapped to ph...
double infinity()
Define a shortcut for std::numeric_limits<double>::infinity()
virtual void ProjectCoefficient(Coefficient &coeff)
Project coeff Coefficient to this GridFunction. The projection computation depends on the choice of t...
int Size_of_connections() const
virtual void SetSpace(FiniteElementSpace *f)
Associate a new FiniteElementSpace with the GridFunction.
int Size() const
Return the logical size of the array.
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the coefficient in the element described by T at the point ip.
void SaveAsSerial(const char *fname, int precision=16, int save_rank=0) const
bool Nonconforming() const
for VectorFiniteElements (Nedelec, Raviart-Thomas)
int GetFaceNbrRank(int fn) const
HypreParVector * GetTrueDofs() const
Returns the true dofs in a new HypreParVector.
Vector coefficient defined by a vector GridFunction.
int GetRangeType() const
Returns the FiniteElement::RangeType of the element, one of {SCALAR, VECTOR}.
HypreParMatrix * Dof_TrueDof_Matrix() const
The true dof-to-dof interpolation matrix.
Class for parallel grid function.
virtual void Save(std::ostream &out) const
Save the GridFunction to an output stream.
Wrapper for hypre's ParCSR matrix class.
Mesh GetSerialMesh(int save_rank) const
Class for parallel meshes.
GridFunction GetSerialGridFunction(int save_rank, Mesh &serial_mesh) const
void DofsToVDofs(Array< int > &dofs, int ndofs=-1) const
Compute the full set of vdofs corresponding to each entry in dofs.
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
virtual double * HostReadWrite()
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), false).
HYPRE_Int Mult(HypreParVector &x, HypreParVector &y, double alpha=1.0, double beta=0.0) const
Computes y = alpha * A * x + beta * y.
void AccumulateAndCountBdrValues(Coefficient *coeff[], VectorCoefficient *vcoeff, Array< int > &attr, Array< int > &values_counter)
ElementTransformation * GetElementTransformation(int i) const
Returns ElementTransformation for the i-th element.