Alamo
Elastic.H
Go to the documentation of this file.
1 //
2 // Class of BC operators that work with :ref:`Operator::Elastic`.
3 //
4 
5 #ifndef BC_OPERATOR_ELASTIC_H
6 #define BC_OPERATOR_ELASTIC_H
7 
8 // #include "Operator/Elastic.H"
9 #include "IO/ParmParse.H"
11 
12 namespace BC
13 {
14 namespace Operator
15 {
16 namespace Elastic
17 {
18 class Elastic
19 {
20 public:
21  static const int min = 1, max = 2;
22 
23 public:
25 
26  #if AMREX_SPACEDIM==2
27  enum Face{
28  XLO, YLO, XHI, YHI,
29  XLO_YLO, XLO_YHI, XHI_YLO, XHI_YHI,
30  INT
31  };
32  #elif AMREX_SPACEDIM==3
33  enum Face{
34  XLO, YLO, ZLO, XHI, YHI, ZHI, // 6
35  YLO_ZLO, YLO_ZHI, YHI_ZLO, YHI_ZHI, // 12
36  ZLO_XLO, ZLO_XHI, ZHI_XLO, ZHI_XHI,
37  XLO_YLO, XLO_YHI, XHI_YLO, XHI_YHI,
38  XLO_YLO_ZLO, XLO_YLO_ZHI, XLO_YHI_ZLO, XLO_YHI_ZHI, // 8
39  XHI_YLO_ZLO, XHI_YLO_ZHI, XHI_YHI_ZLO, XHI_YHI_ZHI,
40  INT
41  };
42  #endif
43 
44  enum Direction {AMREX_D_DECL(X=0,Y=1,Z=2)};
45 
46  void
47  SetTime(const Set::Scalar a_time) {m_time = a_time;}
48 
49  virtual void
50  Init(amrex::MultiFab * a_rhs,
51  const amrex::Geometry &a_geom,
52  bool a_homogeneous = false) const = 0;
53 
54  virtual void
55  Init(amrex::FabArray<amrex::BaseFab<Set::Vector>> * a_rhs,
56  const amrex::Geometry &a_geom,
57  bool a_homogeneous = false) const = 0;
58 
59  void
61  const amrex::Vector<amrex::Geometry> &a_geom,
62  bool a_homogeneous = false) const
63  {
64  for (int ilev = 0; ilev <= a_rhs.finest_level; ilev++)
65  Init(a_rhs[ilev].get(),a_geom[ilev],a_homogeneous);
66  }
67 
68  void
70  const amrex::Vector<amrex::Geometry> &a_geom,
71  bool a_homogeneous = false) const
72  {
73  for (int ilev = 0; ilev <= a_rhs.finest_level; ilev++)
74  Init(a_rhs[ilev].get(),a_geom[ilev],a_homogeneous);
75  }
76 
77 #define SQRT3INV 0.57735026919
78 #define SQRT2INV 0.70710678118
79 
80  virtual
81  std::array<Type,AMREX_SPACEDIM> getType (
82  const int &i, const int &j, const int &k,
83  const amrex::Box &domain) = 0;
84 
85  virtual
87  const Set::Matrix &gradu,
88  const Set::Matrix &sigma,
89  const int &i, const int &j, const int &k,
90  const amrex::Box &domain) = 0;
91 
92 protected:
94 };
95 }
96 }
97 }
98 #endif
Model::Solid::gradu
@ gradu
Definition: Solid.H:26
BC::Operator::Elastic::Elastic::Direction
Direction
Definition: Elastic.H:44
BC::Operator::Elastic::Elastic::max
static const int max
Definition: Elastic.H:21
Linear.H
Operator
Documentation for operator namespace.
Definition: Diagonal.cpp:13
BC::Operator::Elastic::Elastic::Init
void Init(Set::Field< Set::Vector > &a_rhs, const amrex::Vector< amrex::Geometry > &a_geom, bool a_homogeneous=false) const
Definition: Elastic.H:69
BC::Operator::Elastic::Elastic::Neumann
@ Neumann
Definition: Elastic.H:24
Set::Field< Set::Scalar >
Definition: Set.H:236
X
#define X(name)
BC::Operator::Elastic::Elastic::m_time
Set::Scalar m_time
Definition: Elastic.H:93
Set::Vector
Eigen::Matrix< amrex::Real, AMREX_SPACEDIM, 1 > Vector
Definition: Base.H:20
ParmParse.H
BC::Operator::Elastic::Elastic::AMREX_D_DECL
@ AMREX_D_DECL
Definition: Elastic.H:44
BC::Operator::Elastic::Elastic::Periodic
@ Periodic
Definition: Elastic.H:24
Set::Scalar
amrex::Real Scalar
Definition: Base.H:19
BC::Operator::Elastic::Elastic::Type
Type
Definition: Elastic.H:24
Set::Matrix
Eigen::Matrix< amrex::Real, AMREX_SPACEDIM, AMREX_SPACEDIM > Matrix
Definition: Base.H:23
Set::Face
@ Face
Definition: Set.H:32
BC::Operator::Elastic::Elastic::None
@ None
Definition: Elastic.H:24
BC::Operator::Elastic::Elastic::getType
virtual std::array< Type, AMREX_SPACEDIM > getType(const int &i, const int &j, const int &k, const amrex::Box &domain)=0
BC::Operator::Elastic::Elastic::Init
void Init(Set::Field< Set::Scalar > &a_rhs, const amrex::Vector< amrex::Geometry > &a_geom, bool a_homogeneous=false) const
Definition: Elastic.H:60
BC::Operator::Elastic::Elastic
Definition: Elastic.H:18
BC::Operator::Elastic::Elastic::Displacement
@ Displacement
Definition: Elastic.H:24
BC::Operator::Elastic::Elastic::Traction
@ Traction
Definition: Elastic.H:24
BC
Collection of boundary condition (BC) objects.
Definition: BC.cpp:4
BC::Operator::Elastic::Elastic::Init
virtual void Init(amrex::MultiFab *a_rhs, const amrex::Geometry &a_geom, bool a_homogeneous=false) const =0
BC::Operator::Elastic::Elastic::SetTime
void SetTime(const Set::Scalar a_time)
Definition: Elastic.H:47
Set::Field::finest_level
int finest_level
Definition: Set.H:67
BC::Operator::Elastic::Elastic::min
static const int min
Definition: Elastic.H:21
Set::Field< Set::Vector >
BC::Operator::Elastic::Elastic::operator()
virtual Set::Vector operator()(const Set::Vector &u, const Set::Matrix &gradu, const Set::Matrix &sigma, const int &i, const int &j, const int &k, const amrex::Box &domain)=0
Set::Field< Set::Scalar >::finest_level
int finest_level
Definition: Set.H:256