Skip to content

Commit

Permalink
Merge branch 'master' into cusparseXcsrsort
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-sim-dev authored Oct 24, 2024
2 parents a9e5c58 + db1cb03 commit 2434d4a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
12 changes: 7 additions & 5 deletions fem/gslib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ FindPointsGSLIB::FindPointsGSLIB()
: mesh(NULL),
fec_map_lin(NULL),
fdata2D(NULL), fdata3D(NULL), cr(NULL), gsl_comm(NULL),
dim(-1), points_cnt(0), setupflag(false), default_interp_value(0),
dim(-1), points_cnt(-1), setupflag(false), default_interp_value(0),
avgtype(AvgType::ARITHMETIC), bdr_tol(1e-8)
{
mesh_split.SetSize(4);
Expand Down Expand Up @@ -85,7 +85,7 @@ FindPointsGSLIB::FindPointsGSLIB(MPI_Comm comm_)
: mesh(NULL),
fec_map_lin(NULL),
fdata2D(NULL), fdata3D(NULL), cr(NULL), gsl_comm(NULL),
dim(-1), points_cnt(0), setupflag(false), default_interp_value(0),
dim(-1), points_cnt(-1), setupflag(false), default_interp_value(0),
avgtype(AvgType::ARITHMETIC), bdr_tol(1e-8)
{
mesh_split.SetSize(4);
Expand Down Expand Up @@ -307,6 +307,7 @@ void FindPointsGSLIB::FreeData()
}
if (fec_map_lin) { delete fec_map_lin; fec_map_lin = NULL; }
setupflag = false;
points_cnt = -1;
}

void FindPointsGSLIB::SetupSplitMeshes()
Expand Down Expand Up @@ -897,7 +898,8 @@ void FindPointsGSLIB::Interpolate(const GridFunction &field_in,
int gf_order_h1 = std::max(gf_order, 1); // H1 should be at least order 1
H1_FECollection fec(gf_order_h1, dim);
const int ncomp = field_in.FESpace()->GetVDim();
FiniteElementSpace fes(mesh, &fec, ncomp);
FiniteElementSpace fes(mesh, &fec, ncomp,
field_in.FESpace()->GetOrdering());
GridFunction field_in_h1(&fes);

if (avgtype == AvgType::ARITHMETIC)
Expand Down Expand Up @@ -927,7 +929,7 @@ void FindPointsGSLIB::Interpolate(const GridFunction &field_in,
{
for (int i = 0; i < indl2.Size(); i++)
{
int idx = field_in.FESpace()->GetOrdering() == Ordering::byNODES ?
int idx = field_in_h1.FESpace()->GetOrdering() == Ordering::byNODES?
indl2[i] + j*points_cnt:
indl2[i]*ncomp + j;
field_out(idx) = field_out_l2(idx);
Expand Down Expand Up @@ -1172,7 +1174,7 @@ void FindPointsGSLIB::DistributePointInfoToOwningMPIRanks(
Array<unsigned int> &recv_elem, Vector &recv_ref,
Array<unsigned int> &recv_code)
{
MFEM_VERIFY(points_cnt,
MFEM_VERIFY(points_cnt >= 0,
"Invalid size. Please make sure to call FindPoints method "
"before calling this function.");

Expand Down
4 changes: 2 additions & 2 deletions linalg/handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

// Make sure that hypre and PETSc use the same size indices.
#if defined(MFEM_USE_MPI) && defined(MFEM_USE_PETSC)
#if (defined(HYPRE_BIGINT) && !defined(PETSC_USE_64BIT_INDICES)) || \
(!defined(HYPRE_BIGINT) && defined(PETSC_USE_64BIT_INDICES))
#if ((defined(HYPRE_BIGINT) || defined(HYPRE_MIXEDINT)) && !defined(PETSC_USE_64BIT_INDICES)) || \
(!defined(HYPRE_BIGINT) && !defined(HYPRE_MIXEDINT) && defined(PETSC_USE_64BIT_INDICES))
#error HYPRE and PETSC do not use the same size integers!
#endif
#endif
Expand Down
4 changes: 2 additions & 2 deletions linalg/petsc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
#if defined(PETSC_USE_COMPLEX)
#error "MFEM does not work with PETSc compiled with complex numbers support"
#endif
#if defined(PETSC_USE_64BIT_INDICES) && !defined(HYPRE_BIGINT)
#if defined(PETSC_USE_64BIT_INDICES) && !defined(HYPRE_BIGINT) && !defined(HYPRE_MIXEDINT)
#error "Mismatch between HYPRE (32bit) and PETSc (64bit) integer types"
#endif
#if !defined(PETSC_USE_64BIT_INDICES) && defined(HYPRE_BIGINT)
#if !defined(PETSC_USE_64BIT_INDICES) && (defined(HYPRE_BIGINT) || defined(HYPRE_MIXEDINT))
#error "Mismatch between HYPRE (64bit) and PETSc (32bit) integer types"
#endif

Expand Down
4 changes: 4 additions & 0 deletions tests/unit/fem/test_gslib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,10 @@ TEST_CASE("GSLIBCustomInterpolation",
int npt = 101;
Vector xyz(npt*dim);
xyz.Randomize(myid + 1);
if (myid == 1) // zero out # of points on rank 1
{
xyz.SetSize(0);
}

// Find points on the ParMesh
Vector interp_vals(npt);
Expand Down

0 comments on commit 2434d4a

Please sign in to comment.