libMesh
rb_classes.h
Go to the documentation of this file.
1 // rbOOmit: An implementation of the Certified Reduced Basis method.
2 // Copyright (C) 2009, 2010 David J. Knezevic
3 //
4 // This file is part of rbOOmit.
5 
6 // rbOOmit is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 
11 // rbOOmit is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20 #ifndef RB_CLASSES_H
21 #define RB_CLASSES_H
22 
23 #include "libmesh/rb_construction.h"
24 #include "assembly.h"
25 
26 #ifdef LIBMESH_ENABLE_DIRICHLET
27 
28 // Bring in bits from the libMesh namespace.
29 // Just the bits we're using, since this is a header.
33 
34 // A simple subclass of RBEvaluation.
35 class SimpleRBEvaluation : public RBEvaluation
36 {
37 public:
38 
42  SimpleRBEvaluation(const libMesh::Parallel::Communicator & comm) :
44  {
46  }
47 
53 };
54 
56 {
57 public:
58 
59  SimpleRBConstruction (EquationSystems & es,
60  const std::string & name_in,
61  const unsigned int number_in)
62  : Parent(es, name_in, number_in),
63  dirichlet_bc(std::unique_ptr<DirichletBoundary>())
64  {}
65 
69  virtual ~SimpleRBConstruction () {}
70 
75 
80 
84  virtual void init_data()
85  {
86  u_var = this->add_variable ("u", libMesh::FIRST);
87 
88  // Generate a DirichletBoundary object
90 
91  // Set the Dirichlet boundary IDs
92  // and the Dirichlet boundary variable numbers
93  dirichlet_bc->b.insert(0);
94  dirichlet_bc->b.insert(1);
95  dirichlet_bc->b.insert(2);
96  dirichlet_bc->b.insert(3);
97  dirichlet_bc->variables.push_back(u_var);
98 
99  // Attach dirichlet_bc (must do this _before_ Parent::init_data)
101 
103 
104  // Set the rb_assembly_expansion for this Construction object.
106 
107  // We need to define an inner product matrix for this problem
109  }
110 
114  virtual void init_context(FEMContext & c)
115  {
116  // For efficiency, we should prerequest all
117  // the data we will need to build the
118  // linear system before doing an element loop.
119  FEBase * elem_fe = nullptr;
120  c.get_element_fe(u_var, elem_fe);
121 
122  elem_fe->get_JxW();
123  elem_fe->get_phi();
124  elem_fe->get_dphi();
125  }
126 
130  unsigned int u_var;
131 
137 
144 
148  std::unique_ptr<DirichletBoundary> dirichlet_bc;
149 };
150 
151 #endif // LIBMESH_ENABLE_DIRICHLET
152 
153 #endif
SimpleRBConstruction
Definition: rb_classes.h:73
libMesh::DofMap::add_dirichlet_boundary
void add_dirichlet_boundary(const DirichletBoundary &dirichlet_boundary)
Adds a copy of the specified Dirichlet boundary to the system.
Definition: dof_map_constraints.C:4390
SimpleRBConstruction::u_var
unsigned int u_var
Variable number for u.
Definition: rb_classes.h:149
SimpleRBConstruction::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:161
SimpleRBEvaluation::SimpleRBEvaluation
SimpleRBEvaluation(const libMesh::Parallel::Communicator &comm)
Constructor.
Definition: rb_classes.h:42
SimpleRBEvaluation::eim_test_rb_theta_expansion
EimTestRBThetaExpansion eim_test_rb_theta_expansion
The object that stores the "theta" expansion of the parameter dependent PDE, i.e.
Definition: rb_classes.h:52
libMesh::ParallelObject::comm
const Parallel::Communicator & comm() const
Definition: parallel_object.h:94
SimpleRBConstruction::init_data
virtual void init_data()
Initialize data structures.
Definition: rb_classes.h:84
libMesh::RBConstructionBase< LinearImplicitSystem >::init_data
virtual void init_data()
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used.
Definition: rb_construction_base.C:74
libMesh::RBConstruction::build_zero_dirichlet_boundary_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...
Definition: rb_construction.C:2018
SimpleRBConstruction::sys_type
SimpleRBConstruction sys_type
The type of system.
Definition: rb_classes.h:74
libMesh::RBConstruction::set_inner_product_assembly
void set_inner_product_assembly(ElemAssembly &inner_product_assembly_in)
Set the rb_assembly_expansion object.
Definition: rb_construction.C:379
libMesh::RBEvaluation::set_rb_theta_expansion
void set_rb_theta_expansion(RBThetaExpansion &rb_theta_expansion_in)
Set the RBThetaExpansion object.
Definition: rb_evaluation.C:83
SimpleRBConstruction::eim_test_rb_assembly_expansion
EimTestRBAssemblyExpansion eim_test_rb_assembly_expansion
The object that stores the "assembly" expansion of the parameter dependent PDE, i....
Definition: rb_classes.h:143
SimpleRBConstruction::SimpleRBConstruction
SimpleRBConstruction(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
Definition: rb_classes.h:59
libMesh::FEBase
FEGenericBase< Real > FEBase
Definition: exact_error_estimator.h:39
libMesh::System::add_variable
unsigned int add_variable(const std::string &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:1069
EimTestRBThetaExpansion
Definition: assembly.h:148
libMesh::RBConstruction
This class is part of the rbOOmit framework.
Definition: rb_construction.h:53
libMesh::RBConstruction::set_rb_assembly_expansion
void set_rb_assembly_expansion(RBAssemblyExpansion &rb_assembly_expansion_in)
Set the rb_assembly_expansion object.
Definition: rb_construction.C:366
SimpleRBConstruction::~SimpleRBConstruction
virtual ~SimpleRBConstruction()
Destructor.
Definition: rb_classes.h:69
EimTestRBAssemblyExpansion::A0_assembly
A0 A0_assembly
Definition: assembly.h:174
SimpleRBConstruction::eim_test_rb_theta_expansion
EimTestRBThetaExpansion eim_test_rb_theta_expansion
The object that stores the "theta" expansion of the parameter dependent PDE, i.e.
Definition: rb_classes.h:136
SimpleRBEvaluation
Definition: rb_classes.h:45
SimpleRBConstruction::init_context
virtual void init_context(FEMContext &c)
Pre-request all relevant element data.
Definition: rb_classes.h:114
libMesh::RBEvaluation
This class is part of the rbOOmit framework.
Definition: rb_evaluation.h:50
std
Definition: float128_shims.h:27
libMesh::DirichletBoundary
This class allows one to associate Dirichlet boundary values with a given set of mesh boundary ids an...
Definition: dirichlet_boundaries.h:88
libMesh::System::get_dof_map
const DofMap & get_dof_map() const
Definition: system.h:2099
EimTestRBAssemblyExpansion
Definition: assembly.h:163
libMesh::FIRST
Definition: enum_order.h:42
SimpleRBConstruction::Parent
RBConstruction Parent
The type of the parent.
Definition: rb_classes.h:79