libMesh
eim_classes.h
Go to the documentation of this file.
1 #ifndef EIM_CLASSES_H
2 #define EIM_CLASSES_H
3 
4 // libMesh includes
5 #include "libmesh/rb_eim_construction.h"
6 #include "libmesh/rb_eim_evaluation.h"
7 
8 // Example includes
9 #include "assembly.h"
10 
11 // C++ includes
12 #include <memory>
13 
14 // Bring in bits from the libMesh namespace.
15 // Just the bits we're using, since this is a header.
19 
20 // A simple subclass of RBEIMEvaluation. Overload
21 // evaluate_parametrized_function to define the
22 // function that we "empirically" interpolate.
24 {
25 public:
26 
28  RBEIMEvaluation(comm)
29  {
30  set_parametrized_function(std::make_unique<ShiftedGaussian>());
31  }
32 
33  virtual bool use_eim_error_indicator() const override
34  {
35  // Indicate that we do use the EIM error indicator here.
36  return true;
37  }
38 };
39 
40 // A simple subclass of RBEIMConstruction.
42 {
43 public:
44 
49  const std::string & name_in,
50  const unsigned int number_in)
51  : RBEIMConstruction(es, name_in, number_in)
52  {
53  }
54 
58  virtual void init_data()
59  {
60  this->add_variable ("eim_var", libMesh::FIRST);
61 
62  RBEIMConstruction::init_data();
63  }
64 
68  virtual std::unique_ptr<ElemAssembly> build_eim_assembly(unsigned int index)
69  {
70  return std::make_unique<EIM_F>(*this, index);
71  }
72 };
73 
74 #endif
virtual std::unique_ptr< ElemAssembly > build_eim_assembly(unsigned int index)
Provide an implementation of build_eim_assembly.
Definition: eim_classes.h:68
This is the EquationSystems class.
This class is part of the rbOOmit framework.
SimpleEIMConstruction(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
Constructor.
Definition: eim_classes.h:48
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:1357
SimpleEIMEvaluation(const libMesh::Parallel::Communicator &comm)
Definition: eim_classes.h:27
virtual bool use_eim_error_indicator() const override
Definition: eim_classes.h:33
virtual void init_data()
Initialize data structures.
Definition: eim_classes.h:58
This class enables evaluation of an Empirical Interpolation Method (EIM) approximation.