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