25 const int dim = par_mesh->Dimension();
26 const int sdim = par_mesh->SpaceDimension();
28 const_cast<ParMesh*
>(par_mesh)->ExchangeFaceNbrData();
59 const int ndof_per_el = vdim * nq;
64 if (n_face_nbr == 0) {
return; }
75 for (
int i = 0; i < n_face_nbr; ++i)
79 for (
const int el : row)
81 for (
int j = 0; j < ndof_per_el; ++j)
83 h_send_data(j, idx) = h_x_local(j, el);
92 for (
int i = 0; i < n_face_nbr + 1; ++i)
98 MPI_Comm comm = mesh->
GetComm();
99 std::vector<MPI_Request> send_reqs(n_face_nbr);
100 std::vector<MPI_Request> recv_reqs(n_face_nbr);
101 std::vector<MPI_Status> statuses(n_face_nbr);
104 const auto send_data_ptr = mpi_gpu_aware ?
send_data.
Read() :
106 auto x_shared_ptr = mpi_gpu_aware ? x_shared.
Write() : x_shared.
HostWrite();
108 for (
int i = 0; i < n_face_nbr; ++i)
122 MPI_Waitall(n_face_nbr, send_reqs.data(), statuses.data());
123 MPI_Waitall(n_face_nbr, recv_reqs.data(), statuses.data());
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
void DeleteAll()
Delete the whole array.
static bool GetGPUAwareMPI()
const GeometricFactors & geom
The GeometricFactors of the Mesh.
FaceNeighborGeometricFactors(const GeometricFactors &geom_)
Communicate (if needed) to gather the face neighbor geometric factors.
Vector J
Jacobian matrices.
Vector X
Physical coordinates of the mesh.
Array< int > send_offsets
Vector detJ
Jacobian determinants.
Array< int > recv_offsets
void ExchangeFaceNbrQVectors(const Vector &x_local, Vector &x_shared, const int vdim)
Given a Q-vector x_local with vdim components, fill the face-neighbor Q-vector x_shared by communicat...
int num_neighbor_elems
Number of face neighbor elements.
Structure for storing mesh geometric factors: coordinates, Jacobians, and determinants of the Jacobia...
Vector X
Mapped (physical) coordinates of all quadrature points.
const IntegrationRule * IntRule
Vector detJ
Determinants of the Jacobians at all quadrature points.
Vector J
Jacobians of the element transformations at all quadrature points.
int GetNE() const
Returns number of elements.
Class for parallel meshes.
Table send_face_nbr_elements
int GetNFaceNeighborElements() const
Array< int > face_nbr_elements_offset
int GetNFaceNeighbors() const
int GetFaceNbrRank(int fn) const
void GetRow(int i, Array< int > &row) const
Return row i in array row (the Table must be finalized)
int Size_of_connections() const
virtual const real_t * HostRead() const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), false).
virtual const real_t * Read(bool on_dev=true) const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), on_dev).
void Destroy()
Destroy a vector.
int Size() const
Returns the size of the vector.
void SetSize(int s)
Resize the vector to size s.
virtual real_t * HostWrite()
Shortcut for mfem::Write(vec.GetMemory(), vec.Size(), false).
virtual real_t * Write(bool on_dev=true)
Shortcut for mfem::Write(vec.GetMemory(), vec.Size(), on_dev).
MFEM_HOST_DEVICE DeviceTensor< sizeof...(Dims), T > Reshape(T *ptr, Dims... dims)
Wrap a pointer as a DeviceTensor with automatically deduced template parameters.
Helper struct to convert a C++ type to an MPI type.