libMesh
examples
reduced_basis
reduced_basis_ex5
rb_classes.h
Go to the documentation of this file.
1
#ifndef RB_CLASSES_H
2
#define RB_CLASSES_H
3
4
// local includes
5
#include "assembly.h"
6
7
// rbOOmit includes
8
#include "libmesh/rb_construction.h"
9
#include "libmesh/rb_evaluation.h"
10
11
// libMesh includes
12
#include "libmesh/fe_base.h"
13
#include "libmesh/dof_map.h"
14
15
using namespace
libMesh
;
16
17
#ifdef LIBMESH_ENABLE_DIRICHLET
18
19
class
ElasticityRBEvaluation
:
public
RBEvaluation
20
{
21
public
:
22
26
ElasticityRBEvaluation
(
const
Parallel::Communicator & comm)
27
:
RBEvaluation
(comm)
28
{
29
set_rb_theta_expansion(elasticity_theta_expansion);
30
}
31
36
virtual
Real
get_stability_lower_bound
() {
return
1.; }
37
42
ElasticityThetaExpansion
elasticity_theta_expansion
;
43
};
44
45
46
class
ElasticityRBConstruction
:
public
RBConstruction
47
{
48
public
:
49
50
ElasticityRBConstruction
(
EquationSystems
& es,
51
const
std::string & name_in,
52
const
unsigned
int
number_in) :
53
Parent
(es, name_in, number_in),
54
elasticity_assembly_expansion(*this),
55
ip_assembly(*this)
56
{}
57
61
virtual
~ElasticityRBConstruction
() {}
62
66
typedef
ElasticityRBConstruction
sys_type
;
67
71
typedef
RBConstruction
Parent
;
72
76
virtual
void
init_data
()
77
{
78
u_var = this->add_variable(
"u"
,
FIRST
);
79
v_var = this->add_variable(
"v"
,
FIRST
);
80
w_var = this->add_variable(
"w"
,
FIRST
);
81
82
// Generate a DirichletBoundary object
83
dirichlet_bc = build_zero_dirichlet_boundary_object();
84
85
// Set the Dirichlet boundary condition
86
dirichlet_bc->b.insert(BOUNDARY_ID_MIN_X);
// Dirichlet boundary at x=0
87
dirichlet_bc->variables.push_back(u_var);
88
dirichlet_bc->variables.push_back(v_var);
89
dirichlet_bc->variables.push_back(w_var);
90
91
// Attach dirichlet_bc (must do this _before_ Parent::init_data)
92
get_dof_map().add_dirichlet_boundary(*dirichlet_bc);
93
94
Parent::init_data();
95
96
// Set the rb_assembly_expansion for this Construction object
97
set_rb_assembly_expansion(elasticity_assembly_expansion);
98
99
// We need to define an inner product matrix for this problem
100
set_inner_product_assembly(ip_assembly);
101
}
102
106
virtual
void
init_context
(
FEMContext
& c)
107
{
108
// For efficiency, we should prerequest all
109
// the data we will need to build the
110
// linear system before doing an element loop.
111
FEBase
* elem_fe =
nullptr
;
112
c.
get_element_fe
(u_var, elem_fe);
113
114
elem_fe->
get_JxW
();
115
elem_fe->
get_phi
();
116
elem_fe->
get_dphi
();
117
}
118
122
unsigned
int
u_var
;
123
unsigned
int
v_var
;
124
unsigned
int
w_var
;
125
129
ElasticityAssemblyExpansion
elasticity_assembly_expansion
;
130
134
InnerProductAssembly
ip_assembly
;
135
139
std::unique_ptr<DirichletBoundary>
dirichlet_bc
;
140
};
141
142
#endif // LIBMESH_ENABLE_DIRICHLET
143
144
#endif
ElasticityRBEvaluation::get_stability_lower_bound
virtual Real get_stability_lower_bound()
Return a "dummy" lower bound for the coercivity constant.
Definition:
rb_classes.h:36
ElasticityRBConstruction::v_var
unsigned int v_var
Definition:
rb_classes.h:123
ElasticityRBConstruction::ip_assembly
InnerProductAssembly ip_assembly
Object to assemble the inner product matrix.
Definition:
rb_classes.h:134
ElasticityAssemblyExpansion
Definition:
assembly.h:279
ElasticityRBConstruction::dirichlet_bc
std::unique_ptr< DirichletBoundary > dirichlet_bc
The object that defines which degrees of freedom are on a Dirichlet boundary.
Definition:
rb_classes.h:139
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition:
factoryfunction.C:55
InnerProductAssembly
Definition:
assembly.h:233
libMesh::FEGenericBase
This class forms the foundation from which generic finite elements may be derived.
Definition:
exact_error_estimator.h:39
libMesh::FEAbstract::get_JxW
const std::vector< Real > & get_JxW() const
Definition:
fe_abstract.h:244
ElasticityRBEvaluation::elasticity_theta_expansion
ElasticityThetaExpansion elasticity_theta_expansion
The object that stores the "theta" expansion of the parameter dependent PDE, i.e.
Definition:
rb_classes.h:42
libMesh::FEGenericBase::get_dphi
const std::vector< std::vector< OutputGradient > > & get_dphi() const
Definition:
fe_base.h:214
ElasticityRBConstruction::elasticity_assembly_expansion
ElasticityAssemblyExpansion elasticity_assembly_expansion
The object that stores the "assembly" expansion of the parameter dependent PDE.
Definition:
rb_classes.h:129
ElasticityRBConstruction::~ElasticityRBConstruction
virtual ~ElasticityRBConstruction()
Destructor.
Definition:
rb_classes.h:61
ElasticityRBConstruction::w_var
unsigned int w_var
Definition:
rb_classes.h:124
libMesh::RBConstruction
This class is part of the rbOOmit framework.
Definition:
rb_construction.h:53
ElasticityRBConstruction
Definition:
rb_classes.h:46
libMesh::EquationSystems
This is the EquationSystems class.
Definition:
equation_systems.h:74
ElasticityRBEvaluation
Definition:
rb_classes.h:19
ElasticityRBConstruction::ElasticityRBConstruction
ElasticityRBConstruction(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
Definition:
rb_classes.h:50
libMesh::FEMContext::get_element_fe
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh.
Definition:
fem_context.h:275
ElasticityRBConstruction::init_data
virtual void init_data()
Initialize data structures.
Definition:
rb_classes.h:76
libMesh::RBEvaluation
This class is part of the rbOOmit framework.
Definition:
rb_evaluation.h:50
ElasticityRBConstruction::init_context
virtual void init_context(FEMContext &c)
Pre-request all relevant element data.
Definition:
rb_classes.h:106
ElasticityRBConstruction::Parent
RBConstruction Parent
The type of the parent.
Definition:
rb_classes.h:71
libMesh::FEGenericBase::get_phi
const std::vector< std::vector< OutputShape > > & get_phi() const
Definition:
fe_base.h:206
ElasticityRBEvaluation::ElasticityRBEvaluation
ElasticityRBEvaluation(const Parallel::Communicator &comm)
Constructor.
Definition:
rb_classes.h:26
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition:
libmesh_common.h:121
ElasticityRBConstruction::sys_type
ElasticityRBConstruction sys_type
The type of system.
Definition:
rb_classes.h:66
ElasticityThetaExpansion
Definition:
assembly.h:246
libMesh::FIRST
Definition:
enum_order.h:42
ElasticityRBConstruction::u_var
unsigned int u_var
Variable numbers.
Definition:
rb_classes.h:122
libMesh::FEMContext
This class provides all data required for a physics package (e.g.
Definition:
fem_context.h:62
Generated on Sat Jan 25 2020 12:06:51 for libMesh by
1.8.16