LCOV - code coverage report
Current view: top level - include/systems - explicit_system.h (source / functions) Hit Total Coverage
Test: libMesh/libmesh: #4229 (6a9aeb) with base 727f46 Lines: 2 2 100.0 %
Date: 2025-08-19 19:27:09 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : // The libMesh Finite Element Library.
       2             : // Copyright (C) 2002-2025 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
       3             : 
       4             : // This library is free software; you can redistribute it and/or
       5             : // modify it under the terms of the GNU Lesser General Public
       6             : // License as published by the Free Software Foundation; either
       7             : // version 2.1 of the License, or (at your option) any later version.
       8             : 
       9             : // This library is distributed in the hope that it will be useful,
      10             : // but WITHOUT ANY WARRANTY; without even the implied warranty of
      11             : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      12             : // Lesser General Public License for more details.
      13             : 
      14             : // You should have received a copy of the GNU Lesser General Public
      15             : // License along with this library; if not, write to the Free Software
      16             : // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
      17             : 
      18             : 
      19             : 
      20             : #ifndef LIBMESH_EXPLICIT_SYSTEM_H
      21             : #define LIBMESH_EXPLICIT_SYSTEM_H
      22             : 
      23             : // Local Includes
      24             : #include "libmesh/system.h"
      25             : 
      26             : namespace libMesh
      27             : {
      28             : 
      29             : /**
      30             :  * \brief Manages consistently variables, degrees of freedom, and coefficient
      31             :  * vectors for explicit systems.
      32             :  *
      33             :  * The ExplicitSystem provides only "right hand side" storage, which
      34             :  * should be sufficient for solving most types of explicit problems, i.e.,
      35             :  * problems that do not need to store a sparse matrix.
      36             :  *
      37             :  * The ExplicitSystem class is meant for problems where a given right hand
      38             :  * side is directly applied to the (differential) operator. In this case the
      39             :  * assembly routine can directly compute the product A*x without constructing
      40             :  * a sparse matrix first.
      41             :  *
      42             :  * \note Additional vectors/matrices can be added via parent class
      43             :  * interfaces.
      44             :  *
      45             :  * \author Benjamin S. Kirk
      46             :  * \date 2004
      47             :  */
      48        2884 : class ExplicitSystem : public System
      49             : {
      50             : public:
      51             : 
      52             :   /**
      53             :    * Constructor.
      54             :    */
      55             :   ExplicitSystem (EquationSystems & es,
      56             :                   const std::string & name,
      57             :                   const unsigned int number);
      58             : 
      59             :   /**
      60             :    * Special functions.
      61             :    * - This class has the same restrictions/defaults as its base class.
      62             :    * - The destructor is defaulted out-of-line.
      63             :    */
      64             :   ExplicitSystem (const ExplicitSystem &) = delete;
      65             :   ExplicitSystem & operator= (const ExplicitSystem &) = delete;
      66             :   ExplicitSystem (ExplicitSystem &&) = default;
      67             :   ExplicitSystem & operator= (ExplicitSystem &&) = delete;
      68             :   virtual ~ExplicitSystem ();
      69             : 
      70             :   /**
      71             :    * The type of system.
      72             :    */
      73             :   typedef ExplicitSystem sys_type;
      74             : 
      75             :   /**
      76             :    * The type of the parent
      77             :    */
      78             :   typedef System Parent;
      79             : 
      80             :   /**
      81             :    * \returns A reference to *this.
      82             :    */
      83             :   sys_type & system () { return *this; }
      84             : 
      85             :   /**
      86             :    * Clear all the data structures associated with
      87             :    * the system.
      88             :    */
      89             :   virtual void clear () override;
      90             : 
      91             :   /**
      92             :    * Prepares \p qoi for quantity of interest assembly, then calls
      93             :    * user qoi function.
      94             :    * Can be overridden in derived classes.
      95             :    */
      96             :   virtual void assemble_qoi (const QoISet & qoi_indices = QoISet()) override;
      97             : 
      98             :   /**
      99             :    * Prepares \p adjoint_rhs for quantity of interest derivative assembly,
     100             :    * then calls user qoi derivative function.
     101             :    * Can be overridden in derived classes.
     102             :    */
     103             :   virtual void assemble_qoi_derivative (const QoISet & qoi_indices = QoISet(),
     104             :                                         bool include_liftfunc = true,
     105             :                                         bool apply_constraints = true) override;
     106             : 
     107             :   /**
     108             :    * For explicit systems, just assemble the system which should directly
     109             :    * compute A*x.
     110             :    */
     111             :   virtual void solve () override;
     112             : 
     113             :   /**
     114             :    * \returns \p "Explicit".  Helps in identifying
     115             :    * the system type in an equation system file.
     116             :    */
     117        1004 :   virtual std::string system_type () const override { return "Explicit"; }
     118             : 
     119             :   /**
     120             :    * The system matrix.  Implicit systems are characterized by
     121             :    * the need to solve the linear system Ax=b.  This is the
     122             :    * right-hand-side vector b.
     123             :    */
     124             :   NumericVector<Number> * rhs;
     125             : 
     126             : private:
     127             : 
     128             :   /**
     129             :    * Add the system right-hand-side vector to the \p _vectors data structure.
     130             :    * Useful in initialization.
     131             :    */
     132             :   void add_system_rhs ();
     133             : };
     134             : 
     135             : } // namespace libMesh
     136             : 
     137             : #endif // LIBMESH_EXPLICIT_SYSTEM_H

Generated by: LCOV version 1.14