Skip to content

Commit

Permalink
Merge pull request #45 from CEED/fix-order-less-2
Browse files Browse the repository at this point in the history
Corrections when `order<2`
  • Loading branch information
vladotomov authored Oct 5, 2023
2 parents 0a5ed24 + 516bb04 commit 1267068
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
20 changes: 9 additions & 11 deletions remhos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,12 +574,8 @@ int main(int argc, char *argv[])
VectorGridFunctionCoefficient v_sub_coef;
Vector x0_sub;

if (order > 1)
if (use_subcell_RD)
{
// The mesh corresponding to Bezier subcells of order p is constructed.
// NOTE: The mesh is assumed to consist of quads or hexes.
MFEM_VERIFY(order > 1, "This code should not be entered for order = 1.");

// Get a uniformly refined mesh.
const int btype = BasisType::ClosedUniform;
subcell_mesh = new ParMesh(ParMesh::MakeRefined(pmesh, order, btype));
Expand Down Expand Up @@ -1037,11 +1033,13 @@ int main(int argc, char *argv[])
x0.HostReadWrite(); v_sub_gf.HostReadWrite();
x.HostReadWrite();
add(x0, t, v_gf, x);
x0_sub.HostReadWrite(); v_sub_gf.HostReadWrite();
MFEM_VERIFY(xsub != NULL,
"xsub == NULL/This code should not be entered for order = 1.");
xsub->HostReadWrite();
add(x0_sub, t, v_sub_gf, *xsub);
if (use_subcell_RD)
{
x0_sub.HostReadWrite(); v_sub_gf.HostReadWrite();
MFEM_VERIFY(xsub != NULL, "Subcell mesh not defined!");
xsub->HostReadWrite();
add(x0_sub, t, v_sub_gf, *xsub);
}
}

if (problem_num != 6 && problem_num != 7 && problem_num != 8)
Expand Down Expand Up @@ -1220,7 +1218,7 @@ int main(int argc, char *argv[])
delete lom.pk;
delete dc;

if (order > 1)
if (use_subcell_RD)
{
delete subcell_mesh;
delete fec_sub;
Expand Down
3 changes: 2 additions & 1 deletion remhos_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ void SmoothnessIndicator::ComputeFromSparsity(const SparseMatrix &K,
DofInfo::DofInfo(ParFiniteElementSpace &pfes_sltn, int btype)
: bounds_type(btype),
pmesh(pfes_sltn.GetParMesh()), pfes(pfes_sltn),
fec_bounds(pfes.GetOrder(0), pmesh->Dimension(), BasisType::GaussLobatto),
fec_bounds(std::max(pfes.GetOrder(0), 1),
pmesh->Dimension(), BasisType::GaussLobatto),
pfes_bounds(pmesh, &fec_bounds),
x_min(&pfes_bounds), x_max(&pfes_bounds)
{
Expand Down

0 comments on commit 1267068

Please sign in to comment.