LCOV - code coverage report
Current view: top level - src/IC - IC.H (source / functions) Hit Total Coverage
Test: coverage_merged.info Lines: 13 19 68.4 %
Date: 2024-11-18 05:28:54 Functions: 4 10 40.0 %

          Line data    Source code
       1             : #ifndef IC_IC_H_
       2             : #define IC_IC_H_
       3             : 
       4             : #include <AMReX.H>
       5             : #include <AMReX_MultiFab.H>
       6             : #include "Util/Util.H"
       7             : #include "Set/Set.H"
       8             : 
       9             : namespace IC
      10             : {
      11             : /// \brief Pure abstract IC object from which all other IC objects inherit.
      12             : class IC
      13             : {
      14             : public:
      15          70 :     IC (amrex::Vector<amrex::Geometry> &_geom)
      16          70 :         : geom(_geom) {} ;
      17          50 :     virtual ~IC() {}
      18             : 
      19             :     virtual void Add(const int &lev, Set::Field<Set::Scalar> &field, Set::Scalar time) = 0;
      20           0 :     virtual void Add(const int &lev, Set::Field<Set::Scalar> &field)
      21             :     {
      22           0 :         Add(lev,field,0.0);
      23           0 :     }
      24           0 :     virtual void Add(const int &, Set::Field<Set::Vector> &, Set::Scalar) 
      25           0 :     {Util::Abort(INFO,"Not yet implemented");};
      26         330 :     void Initialize(const int &a_lev,
      27             :                     Set::Field<Set::Scalar> &a_field,
      28             :                     Set::Scalar a_time = 0.0)
      29             :     {
      30         660 :         Util::Assert(INFO,TEST(a_lev < a_field.size())," a_lev=",a_lev," size=",a_field.size());
      31         330 :         a_field[a_lev]->setVal(0.0);
      32         330 :         Add(a_lev,a_field,a_time);
      33         330 :     };
      34          14 :     void Initialize(const int &a_lev,
      35             :                     Set::Field<Set::Vector> &a_field,
      36             :                     Set::Scalar a_time = 0.0)
      37             :     {
      38          28 :         Util::Assert(INFO,TEST(a_lev < a_field.size())," a_lev=",a_lev," size=",a_field.size());
      39          14 :         a_field[a_lev]->setVal(Set::Vector::Zero());
      40          14 :         Add(a_lev,a_field,a_time);
      41          14 :     };
      42             : 
      43           0 :     virtual void SetComp(int a_comp) final {comp = a_comp;}
      44             : protected:
      45             :     amrex::Vector<amrex::Geometry> &geom;
      46             :     int comp = 0;
      47             : };
      48             : }
      49             : #endif

Generated by: LCOV version 1.14