libMesh
Loading...
Searching...
No Matches
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
15using namespace libMesh;
16
17#ifdef LIBMESH_ENABLE_DIRICHLET
18
44
45
47{
48public:
49
51 const std::string & name_in,
52 const unsigned int number_in) :
53 Parent(es, name_in, number_in),
54 u_var(0), v_var(0), w_var(0), var_order(FIRST),
56 ip_assembly(*this)
57 {}
58
62 virtual ~ElasticityRBConstruction () = default;
63
68
73
77 virtual void init_data()
78 {
79 unsigned int n_components = this->get_mesh().mesh_dimension();
80
81 libmesh_assert_less_equal(n_components, 3);
82
83 u_var = this->add_variable("u", var_order);
84 if (n_components > 1)
85 v_var = this->add_variable("v", var_order);
86 if (n_components > 2)
87 w_var = this->add_variable("w", var_order);
88
89 // Generate a DirichletBoundary object
91
92 // Set the Dirichlet boundary condition
93 dirichlet_bc->b.insert(BOUNDARY_ID_MIN_X); // Dirichlet boundary at x=0
94 dirichlet_bc->variables.push_back(u_var);
95 if (n_components > 1)
96 dirichlet_bc->variables.push_back(v_var);
97 if (n_components > 2)
98 dirichlet_bc->variables.push_back(w_var);
99
100 // Attach dirichlet_bc (must do this _before_ Parent::init_data)
102
104
105 // Set the rb_assembly_expansion for this Construction object
107
108 // We need to define an inner product matrix for this problem
110 }
111
115 virtual void init_context(FEMContext & c)
116 {
117 // For efficiency, we should prerequest all
118 // the data we will need to build the
119 // linear system before doing an element loop.
120 FEBase * elem_fe = nullptr;
121 c.get_element_fe(u_var, elem_fe);
122
123 elem_fe->get_JxW();
124 elem_fe->get_phi();
125 elem_fe->get_dphi();
126
127 FEBase * side_fe = nullptr;
128 c.get_side_fe(u_var, side_fe);
129 side_fe->get_JxW();
130 side_fe->get_phi();
131 }
132
136 unsigned int u_var;
137 unsigned int v_var;
138 unsigned int w_var;
140
145
150
154 std::unique_ptr<DirichletBoundary> dirichlet_bc;
155};
156
157#endif // LIBMESH_ENABLE_DIRICHLET
158
159#endif
unsigned int u_var
Variable numbers and approximation order.
Definition rb_classes.h:136
InnerProductAssembly ip_assembly
Object to assemble the inner product matrix.
Definition rb_classes.h:149
RBConstruction Parent
The type of the parent.
Definition rb_classes.h:72
std::unique_ptr< DirichletBoundary > dirichlet_bc
The object that defines which degrees of freedom are on a Dirichlet boundary.
Definition rb_classes.h:154
ElasticityRBConstruction(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
Definition rb_classes.h:50
virtual void init_context(FEMContext &c)
Pre-request all relevant element data.
Definition rb_classes.h:115
virtual void init_data()
Initialize data structures.
Definition rb_classes.h:77
ElasticityAssemblyExpansion elasticity_assembly_expansion
The object that stores the "assembly" expansion of the parameter dependent PDE.
Definition rb_classes.h:144
ElasticityRBConstruction sys_type
The type of system.
Definition rb_classes.h:67
virtual ~ElasticityRBConstruction()=default
Destructor.
virtual Real get_stability_lower_bound()
Return a "dummy" lower bound for the coercivity constant.
Definition rb_classes.h:36
ElasticityRBEvaluation(const Parallel::Communicator &comm)
Constructor.
Definition rb_classes.h:26
ElasticityThetaExpansion elasticity_theta_expansion
The object that stores the "theta" expansion of the parameter dependent PDE, i.e.
Definition rb_classes.h:42
void add_dirichlet_boundary(const DirichletBoundary &dirichlet_boundary)
Adds a copy of the specified Dirichlet boundary to the system.
This is the EquationSystems class.
virtual_for_inffe const std::vector< Real > & get_JxW() const
This class forms the foundation from which generic finite elements may be derived.
Definition fe_base.h:86
const std::vector< std::vector< OutputShape > > & get_phi() const
Definition fe_base.h:207
const std::vector< std::vector< OutputGradient > > & get_dphi() const
Definition fe_base.h:230
This class provides all data required for a physics package (e.g.
Definition fem_context.h:63
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in th...
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.
virtual void init_data() override
Initializes new data members of the system.
unsigned int mesh_dimension() const
Definition mesh_base.C:430
const Parallel::Communicator & comm() const
This class is part of the rbOOmit framework.
void set_inner_product_assembly(ElemAssembly &inner_product_assembly_in)
Set the rb_assembly_expansion object.
void set_rb_assembly_expansion(RBAssemblyExpansion &rb_assembly_expansion_in)
Set the rb_assembly_expansion object.
static std::unique_ptr< DirichletBoundary > build_zero_dirichlet_boundary_object()
It's helpful to be able to generate a DirichletBoundary that stores a ZeroFunction in order to impose...
This class is part of the rbOOmit framework.
void set_rb_theta_expansion(RBThetaExpansion &rb_theta_expansion_in)
Set the RBThetaExpansion object.
unsigned int add_variable(std::string_view var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
Adds the variable var to the list of variables for this system.
Definition system.C:1344
unsigned int n_components() const
Definition system.C:2694
const DofMap & get_dof_map() const
Definition system.h:2417
const MeshBase & get_mesh() const
Definition system.h:2401
The libMesh namespace provides an interface to certain functionality in the library.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real