LCOV - code coverage report
Current view: top level - src/Model/Solid/Linear - Laplacian.H (source / functions) Coverage Total Hit
Test: coverage_merged.info Lines: 100.0 % 22 22
Test Date: 2026-01-21 04:31:22 Functions: 100.0 % 10 10

            Line data    Source code
       1              : #ifndef MODEL_SOLID_LINEAR_LAPLACIAN_H_
       2              : #define MODEL_SOLID_LINEAR_LAPLACIAN_H_
       3              : 
       4              : #include <AMReX.H>
       5              : #include <AMReX_REAL.H>
       6              : #include <eigen3/Eigen/Core>
       7              : 
       8              : #include "Model/Solid/Solid.H"
       9              : #include "IO/ParmParse.H"
      10              : #include "Util/Util.H"
      11              : #include "Set/Set.H"
      12              : 
      13              : namespace Model
      14              : {
      15              : namespace Solid
      16              : {
      17              : namespace Linear
      18              : {
      19              : ///
      20              : /// Isotropic implements the following elastic model
      21              : /// \f[ \mathbb{C}_{ijkl} = \alpha\delta_{ik}\delta_{jl}  \f]
      22              : /// corresponding to the elastic model
      23              : /// \f[ \sigma_{ij} = \alpha\delta_{ik}\delta_{jl}u_{k,l} = \alpha u_{i,j} \f]
      24              : /// \f[ f_{i} = \mathbb{C}_{ijkl}u_{k,jl} = \alpha\delta_{ik}\delta_{jl}u_{k,jl} = \alpha u_{i,jj} \f]
      25              : ///
      26              : class Laplacian : public Model::Solid::Solid<Set::Sym::Diagonal>
      27              : {
      28              : public:
      29            4 :     void Define(Set::Scalar alpha = 1.0)
      30              :     {
      31            4 :         ddw = alpha*Set::Matrix4<AMREX_SPACEDIM,Set::Sym::Diagonal>::Ones();
      32            4 :     }
      33          260 :     Set::Scalar W(const Set::Matrix & gradu) const 
      34              :     {
      35          520 :         return ( 0.5 * gradu.transpose() * (ddw*gradu) ).trace();
      36              :     }
      37        18886 :     Set::Matrix DW(const Set::Matrix & gradu) const 
      38              :     {
      39        37772 :         return ddw*gradu;
      40              :     }
      41         8483 :     Set::Matrix4<AMREX_SPACEDIM,Set::Sym::Diagonal> DDW(const Set::Matrix & /*gradu*/) const 
      42              :     {
      43         8483 :         return ddw;
      44              :     }
      45              : public:
      46         8472 :     static Laplacian Zero()
      47              :     {
      48         8472 :         Laplacian ret;
      49         8472 :         ret.ddw = Set::Matrix4<AMREX_SPACEDIM,Set::Sym::Diagonal>::Zero();
      50         8472 :         return ret;
      51              :     }
      52            4 :     static void Parse(Laplacian &value,IO::ParmParse &pp)
      53              :     {
      54            4 :         Set::Scalar alpha = NAN;
      55              :         // Coefficient for the Laplacian
      56            4 :         pp_query_default("alpha",alpha,1.0);
      57            4 :         value.Define(alpha);
      58            4 :     }
      59              :     
      60              :     Set::Matrix4<AMREX_SPACEDIM,Set::Sym::Diagonal> ddw;
      61              :     static const KinematicVariable kinvar = KinematicVariable::gradu;
      62           42 :     static Laplacian Random()
      63              :     {
      64           42 :         Laplacian ret;
      65           42 :         ret.ddw.Randomize();
      66           42 :         return ret;
      67              :     }
      68              : 
      69              : #define OP_CLASS Laplacian
      70              : #define OP_VARS X(ddw)
      71              : #include "Model/Solid/InClassOperators.H"
      72              : };
      73              : #include "Model/Solid/ExtClassOperators.H"
      74              : 
      75              : }
      76              : }
      77              : }
      78              : #endif
        

Generated by: LCOV version 2.0-1