Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #pragma once 11 : 12 : #include "GeneralPostprocessor.h" 13 : 14 : namespace libMesh 15 : { 16 : template <typename> 17 : class PetscMatrix; 18 : } 19 : 20 : /** 21 : * Checks if two matrices are the same by comparing their coefficients 22 : */ 23 : class MatrixEqualityCheck : public GeneralPostprocessor 24 : { 25 : public: 26 : static InputParameters validParams(); 27 : 28 : MatrixEqualityCheck(const InputParameters & parameters); 29 : 30 54 : virtual void initialize() override {} 31 : virtual void execute() override; 32 : virtual void finalize() override; 33 : virtual Real getValue() const override; 34 : 35 : protected: 36 : const Real _equiv_tol; 37 : const std::string & _mat1_name; 38 : const std::string & _mat2_name; 39 : Mat _petsc_mat1 = nullptr; 40 : Mat _petsc_mat2 = nullptr; 41 : bool _equiv = true; 42 : };