Loading...
Searching...
No Matches
PODConfiguration.H
1#pragma once
2#ifndef PODConfiguration_H
3#define PODConfiguration_H
4#include <Eigen/Eigen>
5#include "HashTable.H"
6
10class PODConfiguration
11{
12public:
13 PODConfiguration():
14 m_weightH1(0.0), m_weightBC(0.0) { }
15
16 const Foam::wordList& fieldlist() const { return m_fieldlist; }
17 const Foam::HashTable<Foam::label, Foam::word>& nModes() const { return m_nModes; }
18 const Foam::HashTable<Foam::word, Foam::word>& hilbertSpacePOD() const { return m_hilbertSpacePOD; }
19 const Foam::List<Foam::word>& field_name() const { return m_field_name; }
20 const Foam::List<Foam::word>& field_type() const { return m_field_type; }
21
22 const Foam::HashTable<double, Foam::word>& resolvedVaryingEnergy() const { return m_resolvedVaryingEnergy; }
23 const Foam::HashTable<double, Foam::word>& varyingEnergy() const { return m_varyingEnergy; }
24 const Foam::HashTable<double, Foam::word>& meanEnergy() const { return m_meanEnergy; }
25
26 const Eigen::VectorXd& eigenValues_U() const { return m_eigenValues_U; }
27 const Eigen::VectorXd& eigenValues_p() const { return m_eigenValues_p; }
28 const Eigen::VectorXd& lambda() const { return m_lambda; }
29
30 const double& weightH1() const { return m_weightH1; }
31 const double& weightBC() const { return m_weightBC; }
32 const Foam::word& patchBC() const { return m_patchBC; }
33
34 void set_fieldlist(const Foam::wordList& fl) { m_fieldlist = fl; }
35 void insert_nModes(const Foam::word& field_name, const Foam::label& n) { m_nModes.insert(field_name, n); }
36 void insert_hilbertSpacePOD(const Foam::word& field_name, const Foam::word& hilbertSp)
37 {
38 m_hilbertSpacePOD.insert(field_name, hilbertSp);
39 }
40 void set_field_name(const Foam::List<Foam::word>& fn) { m_field_name = fn; }
41 void set_field_type(const Foam::List<Foam::word>& ft) { m_field_type = ft; }
42
43 void set_resolvedVaryingEnergy(const Foam::word& field_name, const double& n)
44 {
45 m_resolvedVaryingEnergy.set(field_name, n);
46 }
47
48 void insert_resolvedVaryingEnergy(const Foam::word& field_name, const double& n)
49 {
50 m_resolvedVaryingEnergy.insert(field_name, n);
51 }
52
53 void set_varyingEnergy(const Foam::word& field_name, const double& n)
54 {
55 m_varyingEnergy.set(field_name, n);
56 }
57
58 void insert_varyingEnergy(const Foam::word& field_name, const double& n)
59 {
60 m_varyingEnergy.insert(field_name, n);
61 }
62
63 void insert_meanEnergy(const Foam::word& field_name, const double& n)
64 {
65 m_meanEnergy.insert(field_name, n);
66 }
67
68 void set_eigenValues_U(const Eigen::VectorXd& ev) { m_eigenValues_U = ev; }
69 void set_eigenValues_p(const Eigen::VectorXd& ev) { m_eigenValues_p = ev; }
70 void set_lambda(const Eigen::VectorXd& l) { m_lambda = l; }
71
72 void set_weightH1(const double& w) { m_weightH1 = w; }
73 void set_weightBC(const double& w) { m_weightBC = w; }
74 void set_patchBC(const Foam::word& p) { m_patchBC = p; }
75
76 void appendField(const Foam::word& fieldName, const Foam::word& fieldType)
77 {
78 m_field_name.append(fieldName);
79 m_field_type.append(fieldType);
80 }
81
82private:
83 Foam::wordList m_fieldlist;
84 Foam::HashTable<Foam::label, Foam::word> m_nModes;
85 Foam::HashTable<Foam::word, Foam::word> m_hilbertSpacePOD;
86 Foam::List<Foam::word> m_field_name;
87 Foam::List<Foam::word> m_field_type;
88
89 Foam::HashTable<double, Foam::word> m_resolvedVaryingEnergy;
90 Foam::HashTable<double, Foam::word> m_varyingEnergy;
91 Foam::HashTable<double, Foam::word> m_meanEnergy;
92
93 Eigen::VectorXd m_eigenValues_U;
94 Eigen::VectorXd m_eigenValues_p;
95 Eigen::VectorXd m_lambda;
96
97 double m_weightH1;
98 double m_weightBC;
99 Foam::word m_patchBC;
100};
101
102#endif