diff --git a/remhos.cpp b/remhos.cpp index 478b2a1..93ea0f3 100644 --- a/remhos.cpp +++ b/remhos.cpp @@ -1436,10 +1436,12 @@ void AdvectionOperator::ComputeMask(const Vector &x, Array &mask) const } if (!dofs_active) + { for (int j = 0; j < ndof_el; j++) { bool_dofs[j+ndof_el*k] = false; } + } } // Apply the u mask to all product fields @@ -1447,10 +1449,12 @@ void AdvectionOperator::ComputeMask(const Vector &x, Array &mask) const const int ndim = block_offsets.Size() - 1; mask.SetSize(ndofs * ndim); for (int i = 0; i < ndofs; i++) + { for (int d = 0; d < ndim; d++) { mask[i+ndofs*d] = bool_dofs[i]; } + } } void AdvectionOperator::LimitMult(const Vector &X, Vector &Y) const @@ -1463,7 +1467,6 @@ void AdvectionOperator::LimitMult(const Vector &X, Vector &Y) const const Vector &u = block_X.GetBlock(0); Vector &d_u = block_Y.GetBlock(0); - if (fct_solver) { MFEM_VERIFY(ho_solver && lo_solver, "FCT requires HO and LO solvers."); diff --git a/remhos_solvers.hpp b/remhos_solvers.hpp index 8561301..b37a96f 100644 --- a/remhos_solvers.hpp +++ b/remhos_solvers.hpp @@ -57,6 +57,8 @@ class LimitedTimeDependentOperator : public TimeDependentOperator { MFEM_ABORT("Mask computation not implemented!"); } /// Limit the action vector @a k + /// Assumes that MultUnlimited(u, k) has been called, which has computed the + /// unlimited solution in @a k. virtual void LimitMult(const Vector &u, Vector &k) const = 0; }; @@ -94,6 +96,7 @@ class RKIDPSolver : public IDPODESolver void ConstructD(); + /// Adds only DOFs that have mask = true. void AddMasked(const Array &mask, real_t b, const Vector &vb, Vector &va);