LCOV - code coverage report
Current view: top level - src/Integrator - ThermoElastic.H (source / functions) Hit Total Coverage
Test: coverage_merged.info Lines: 0 43 0.0 %
Date: 2024-11-18 05:28:54 Functions: 0 9 0.0 %

          Line data    Source code
       1             : #ifndef INTEGRATOR_THERMOELASTIC_H
       2             : #define INTEGRATOR_THERMOELASTIC_H
       3             : 
       4             : #include "Model/Solid/Affine/Isotropic.H"
       5             : #include "Integrator/Mechanics.H"
       6             : #include "Integrator/HeatConduction.H"
       7             : #include "Numeric/Stencil.H"
       8             : 
       9             : namespace Integrator
      10             : {
      11             : class ThermoElastic : 
      12             :     virtual public HeatConduction,
      13             :     virtual public Mechanics<Model::Solid::Affine::Isotropic>
      14             : {
      15             : public:
      16           0 :     ThermoElastic():
      17             :         HeatConduction(3),
      18           0 :         Mechanics<Model::Solid::Affine::Isotropic>()
      19           0 :     { }
      20           0 :     ThermoElastic(IO::ParmParse &pp) : ThermoElastic()
      21           0 :     {Parse(*this,pp);}
      22           0 :     static void Parse(ThermoElastic &value, IO::ParmParse &pp)
      23             :     {
      24           0 :         pp.queryclass<HeatConduction>("hc",value);
      25           0 :         pp.queryclass<Mechanics<Model::Solid::Affine::Isotropic>>("el",value);
      26             : 
      27           0 :         pp_queryarr("alpha",value.alpha); // Diffusion coefficient
      28           0 :     }
      29             : 
      30             : protected:
      31           0 :     void Initialize(int lev) override
      32             :     {
      33           0 :         HeatConduction::Initialize(lev);
      34           0 :         Mechanics<Model::Solid::Affine::Isotropic>::Initialize(lev);
      35           0 :     }
      36             : 
      37           0 :     void UpdateModel(int a_step, Set::Scalar a_time) override
      38             :     {
      39           0 :         Mechanics<Model::Solid::Affine::Isotropic>::UpdateModel(a_step, a_time);
      40             : 
      41             :         //Set::Scalar alpha[2];
      42             :         //alpha[0] = 0.001; alpha[1] = 0.002;
      43             :         
      44           0 :         for (int lev = 0; lev <= finest_level; ++lev)
      45             :         {
      46           0 :             for (MFIter mfi(*model_mf[lev], false); mfi.isValid(); ++mfi)
      47             :             {
      48           0 :                 amrex::Box bx = mfi.grownnodaltilebox();
      49           0 :                 amrex::Array4<Model::Solid::Affine::Isotropic> const &model = model_mf[lev]->array(mfi);
      50           0 :                 amrex::Array4<const Set::Scalar> const &eta = eta_mf[lev]->array(mfi);
      51           0 :                 amrex::Array4<const Set::Scalar> const &temp = temp_old_mf[lev]->array(mfi);
      52           0 :                 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
      53           0 :                     Set::Matrix F0 = Set::Matrix::Zero();
      54           0 :                     Set::Scalar tempavg = Numeric::Interpolate::CellToNodeAverage(temp,i,j,k,0);
      55           0 :                     for (int n = 0; n < eta.nComp(); n++)
      56             :                     {
      57           0 :                         F0 += (eta(i,j,k,n) * alpha[n]) * tempavg * Set::Matrix::Identity();
      58             :                     }
      59           0 :                     model(i, j, k).F0 = F0;
      60           0 :                 });
      61             :             }
      62             : 
      63           0 :             Util::RealFillBoundary(*model_mf[lev], geom[lev]);
      64             :         }
      65             : 
      66           0 :     }
      67             : 
      68           0 :     void TimeStepBegin(Set::Scalar a_time, int a_step) override
      69             :     {
      70           0 :         HeatConduction::TimeStepBegin(a_time, a_step);
      71           0 :         Mechanics<Model::Solid::Affine::Isotropic>::TimeStepBegin(a_time, a_step);
      72           0 :     }
      73             : 
      74           0 :     void Advance(int a_lev, amrex::Real a_time, amrex::Real a_dt) override
      75             :     {
      76           0 :         HeatConduction::Advance(a_lev, a_time, a_dt);
      77           0 :         Mechanics<Model::Solid::Affine::Isotropic>::Advance(a_lev, a_time, a_dt);
      78           0 :     }
      79             : 
      80           0 :     void TagCellsForRefinement(int a_lev, amrex::TagBoxArray& a_tags, Set::Scalar a_time, int a_ngrow) override
      81             :     {
      82           0 :         HeatConduction::TagCellsForRefinement(a_lev, a_tags, a_time, a_ngrow);
      83           0 :         Mechanics<Model::Solid::Affine::Isotropic>::TagCellsForRefinement(a_lev, a_tags, a_time, a_ngrow);
      84           0 :     }
      85             : 
      86             :     std::vector<Set::Scalar> alpha;
      87             : };
      88             : } // namespace Integrator
      89             : #endif

Generated by: LCOV version 1.14