libMesh
Loading...
Searching...
No Matches
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
15
16// A simple subclass of RBEIMEvaluation. Overload
17// evaluate_parametrized_function to define the
18// function that we "empirically" interpolate.
19class SimpleEIMEvaluation : public RBEIMEvaluation
20{
21public:
22
24 : RBEIMEvaluation(comm)
25 {
26 set_parametrized_function(std::make_unique<Gxyz>());
27 }
28
32 virtual std::unique_ptr<RBTheta> build_eim_theta(unsigned int index)
33 {
34 return std::make_unique<ThetaEIM>(*this, index);
35 }
36};
37
38// A simple subclass of RBEIMConstruction.
40{
41public:
42
46 SimpleEIMConstruction (EquationSystems & es,
47 const std::string & name_in,
48 const unsigned int number_in)
49 : RBEIMConstruction(es, name_in, number_in)
50 {
51 }
52
56 virtual std::unique_ptr<ElemAssembly> build_eim_assembly(unsigned int index)
57 {
58 return std::make_unique<AssemblyEIM>(*this, index);
59 }
60
64 virtual void init_data()
65 {
66 this->add_variable ("eim_var", libMesh::FIRST);
67
68 RBEIMConstruction::init_data();
69 }
70
71};
72
73#endif
virtual void init_data()
Initialize data structures.
Definition eim_classes.h:64
SimpleEIMConstruction(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
Constructor.
Definition eim_classes.h:46
virtual std::unique_ptr< ElemAssembly > build_eim_assembly(unsigned int index)
Provide an implementation of build_eim_assembly.
Definition eim_classes.h:56
SimpleEIMEvaluation(const libMesh::Parallel::Communicator &comm)
Definition eim_classes.h:23
virtual std::unique_ptr< RBTheta > build_eim_theta(unsigned int index)
Build a ThetaEIM rather than an RBEIMTheta.
Definition eim_classes.h:32
This class is part of the rbOOmit framework.
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