#pragma once #include "mfem.hpp" namespace serif::utilities { [[nodiscard]] mfem::SparseMatrix build_reduced_matrix( const mfem::SparseMatrix& matrix, const mfem::Array& trialEssentialDofs, const mfem::Array& testEssentialDofs ); /** * @brief Generate a vector of 1s and 0s where 1 elemetns cooresponds to queried dofs. Useful for degugging * @param allDofs array, counding from 0, of all dofs in the system * @param highlightDofs the dofs that you want to identify * @return * * *Example Usage:* * One could use this to identify, for example, which dofs are being identified as the central dofs * @code * ... * mfem::Array phiDofs, thetaDofs; * phiDofs.SetSize(m_fePhi->GetNDofs()); * thetaDofs.SetSize(m_feTheta->GetNDofs()); * const mfem::Vector phiHighlightVector = serif::utilities::build_dof_identification_vector(phiDofs, phiCenterDofs); * const mfem::Vector thetaHighlightVector = serif::utilities::build_dof_identification_vector(thetaDofs, thetaCenterDofs); * Probe::glVisView( * const_cast(phiHighlightVector), * *m_fePhi, * "Phi Center Dofs" * ); * Probe::glVisView( * const_cast(thetaHighlightVector), * *m_feTheta, * "Theta Center Dofs" * ); * @endcode */ mfem::Vector build_dof_identification_vector( const mfem::Array& allDofs, const::mfem::Array& highlightDofs ); }