Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrections when order<2 #45

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading