libMesh
eim_classes.h
Go to the documentation of this file.
1 #ifndef EIM_CLASSES_H
2 #define EIM_CLASSES_H
3 
4 // local includes
5 #include "libmesh/rb_eim_construction.h"
6 #include "libmesh/rb_eim_evaluation.h"
7 #include "assembly.h"
8 
9 // Bring in bits from the libMesh namespace.
10 // Just the bits we're using, since this is a header.
13 using libMesh::UniquePtr;
14 
15 // A simple subclass of RBEIMEvaluation. Overload
16 // evaluate_parametrized_function to define the
17 // function that we "empirically" interpolate.
19 {
20 public:
21 
23  RBEIMEvaluation(comm)
24  {
25  attach_parametrized_function(&sg);
26  }
27 
32 };
33 
34 // A simple subclass of RBEIMConstruction.
35 class SimpleEIMConstruction : public RBEIMConstruction
36 {
37 public:
38 
43  const std::string & name_in,
44  const unsigned int number_in)
45  : Parent(es, name_in, number_in)
46  {
47  }
48 
52  typedef RBEIMConstruction Parent;
53 
57  virtual UniquePtr<ElemAssembly> build_eim_assembly(unsigned int index)
58  {
59  return UniquePtr<ElemAssembly>(new EIM_F(*this, index));
60  }
61 
65  virtual void init_data()
66  {
67  Parent::init_data();
68 
69  set_inner_product_assembly(ip);
70  }
71 
75  virtual void init_implicit_system()
76  {
77  this->add_variable ("L2_proj_var", libMesh::FIRST);
78  }
79 
83  virtual void init_explicit_system()
84  {
85  u_var = get_explicit_system().add_variable ("f_EIM", libMesh::FIRST);
86  }
87 
91  unsigned int u_var;
92 
97 };
98 
99 #endif
This is the EquationSystems class.
Encapsulates the MPI_Comm object.
Definition: parallel.h:657
virtual UniquePtr< ElemAssembly > build_eim_assembly(unsigned int index)
Provide an implementation of build_eim_assembly.
Definition: eim_classes.h:57
unsigned int u_var
Variable number for u.
Definition: eim_classes.h:91
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
virtual void init_implicit_system()
Initialize the implicit system that is used to perform L2 projections.
Definition: eim_classes.h:75
EIM_IP_assembly ip
Inner product assembly object.
Definition: eim_classes.h:96
RBEIMConstruction Parent
The type of the parent.
Definition: eim_classes.h:52
SimpleEIMConstruction(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
Constructor.
Definition: eim_classes.h:42
ShiftedGaussian sg
Parametrized function that we approximate with EIM.
Definition: eim_classes.h:31
SimpleEIMEvaluation(const libMesh::Parallel::Communicator &comm)
Definition: eim_classes.h:22
virtual void init_explicit_system()
Initialize the explicit system that is used to store the basis functions.
Definition: eim_classes.h:83
virtual void init_data()
Initialize data structures.
Definition: eim_classes.h:65
This class is part of the rbOOmit framework.