libMesh
Loading...
Searching...
No Matches
rb_theta_expansion.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 LIBMESH_RB_THETA_EXPANSION_H
21#define LIBMESH_RB_THETA_EXPANSION_H
22
23// libMesh includes
24#include "libmesh/libmesh_common.h"
25#include "libmesh/reference_counted_object.h"
26
27// C++ includes
28#include <vector>
29#include <memory>
30
31namespace libMesh
32{
33
34class RBTheta;
35class RBParameters;
36
44class RBThetaExpansion : public ReferenceCountedObject<RBThetaExpansion>
45{
46public:
47
51 RBThetaExpansion() = default;
56 virtual ~RBThetaExpansion () = default;
57
63 virtual Number eval_A_theta(unsigned int q,
64 const RBParameters & mu) const;
65
69 virtual std::vector<Number> eval_A_theta(unsigned int q,
70 const std::vector<RBParameters> & mus) const;
71
75 virtual Number eval_F_theta(unsigned int q,
76 const RBParameters & mu) const;
77
81 virtual std::vector<Number> eval_F_theta(unsigned int q,
82 const std::vector<RBParameters> & mus) const;
83
87 virtual Number eval_output_theta(unsigned int output_index,
88 unsigned int q_l,
89 const RBParameters & mu) const;
90
94 virtual std::vector<Number> eval_output_theta(unsigned int output_index,
95 unsigned int q_l,
96 const std::vector<RBParameters> & mus) const;
97
102 unsigned int get_n_A_terms() const;
103
108 unsigned int get_n_F_terms() const;
109
113 unsigned int get_n_outputs() const;
114
118 unsigned int get_n_output_terms(unsigned int output_index) const;
119
123 unsigned int get_total_n_output_terms() const;
124
131 unsigned int output_index_1D(unsigned int n, unsigned int q_l) const;
132
137 virtual void attach_A_theta(RBTheta * theta_q_a);
138
143 virtual void attach_multiple_A_theta(std::vector<std::unique_ptr<RBTheta>> & theta_q_a);
144
149 virtual void attach_F_theta(RBTheta * theta_q_f);
150
155 virtual void attach_multiple_F_theta(std::vector<std::unique_ptr<RBTheta>> & theta_q_f);
156
161 virtual void attach_output_theta(std::vector<std::unique_ptr<RBTheta>> & theta_q_l);
162
167 virtual void attach_output_theta(std::vector<RBTheta*> theta_q_l);
168
173 virtual void attach_output_theta(RBTheta * theta_q_l);
174
175private:
176
180 std::vector<RBTheta *> _A_theta_vector;
181
185 std::vector<RBTheta *> _F_theta_vector;
186
190 std::vector<std::vector<RBTheta *>> _output_theta_vector;
191};
192
193}
194
195#endif // LIBMESH_RB_THETA_EXPANSION_H
This class is part of the rbOOmit framework.
This class stores the set of RBTheta functor objects that define the "parameter-dependent expansion" ...
RBThetaExpansion(const RBThetaExpansion &)=default
virtual Number eval_F_theta(unsigned int q, const RBParameters &mu) const
Evaluate theta_q_f at the current parameter.
virtual void attach_F_theta(RBTheta *theta_q_f)
Attach a pointer to a functor object that defines one of the theta_q_a terms.
unsigned int get_total_n_output_terms() const
Returns the total number of affine terms associated with all outputs.
std::vector< RBTheta * > _F_theta_vector
Vector storing the RBTheta functors for the affine expansion of the rhs.
virtual void attach_A_theta(RBTheta *theta_q_a)
Attach a pointer to a functor object that defines one of the theta_q_a terms.
unsigned int get_n_F_terms() const
Get Q_f, the number of terms in the affine expansion for the right-hand side.
unsigned int get_n_A_terms() const
Get Q_a, the number of terms in the affine expansion for the bilinear form.
std::vector< std::vector< RBTheta * > > _output_theta_vector
Vector storing the RBTheta functors for the affine expansion of the outputs.
unsigned int output_index_1D(unsigned int n, unsigned int q_l) const
Computes the one-dimensional index for output n, term q_l implied by a "row-major" ordering of the ou...
virtual Number eval_A_theta(unsigned int q, const RBParameters &mu) const
Evaluate theta_q_a at the current parameter.
std::vector< RBTheta * > _A_theta_vector
Vector storing the pointers to the RBTheta functors for A.
unsigned int get_n_output_terms(unsigned int output_index) const
Get the number of affine terms associated with the specified output.
virtual ~RBThetaExpansion()=default
RBThetaExpansion(RBThetaExpansion &&)=default
virtual void attach_multiple_A_theta(std::vector< std::unique_ptr< RBTheta > > &theta_q_a)
Attach a vector of pointers to functor objects that each define one of the theta_q_a terms.
unsigned int get_n_outputs() const
Get n_outputs, the number output functionals.
RBThetaExpansion()=default
All special functions can be defaulted for this simple class.
virtual void attach_multiple_F_theta(std::vector< std::unique_ptr< RBTheta > > &theta_q_f)
Attach a vector of pointers to functor objects that each define one of the theta_q_f terms.
virtual void attach_output_theta(std::vector< std::unique_ptr< RBTheta > > &theta_q_l)
Attach a vector of pointers to functor objects that define one of the outputs.
virtual Number eval_output_theta(unsigned int output_index, unsigned int q_l, const RBParameters &mu) const
Evaluate theta_q_l at the current parameter.
RBThetaExpansion & operator=(const RBThetaExpansion &)=default
This class is part of the rbOOmit framework.
Definition rb_theta.h:47
This class implements reference counting.
The libMesh namespace provides an interface to certain functionality in the library.