waves
Basic FE playground
wPeriodic.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 University of Liège
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef WPERIODIC_H
18 #define WPERIODIC_H
19 
20 #include "heat.h"
21 #include "wObject.h"
22 #include <vector>
23 #include <string>
24 #include <list>
25 #include <memory>
26 #include <Eigen/Dense>
27 
28 using namespace tbox;
29 
30 namespace heat
31 {
32 
33 #ifndef SWIG
35 {
36 public:
37  Node *n;
38  Node *d;
39  NodePair(Node *_n, Node *_d, double tol = 1e-12);
40  friend HEAT_API std::ostream &operator<<(std::ostream &out, NodePair const &obj);
41 };
42 #endif //SWIG
43 
48 class HEAT_API Periodic : public fwk::wSharedObject
49 {
50  std::shared_ptr<heat::Problem> pbl;
51 
52 public:
53 #ifndef SWIG
54  double TM;
55  double dTxM;
56  double dTyM;
57  std::vector<NodePair> LR;
58  std::vector<NodePair> BT;
59  std::vector<Node *> corners;
60 #endif
61  Eigen::Vector3d qM;
62  bool verbose;
63 
64  Periodic(std::shared_ptr<heat::Problem> _pbl, double _TM, double _dTxM, double _dTyM);
65  virtual ~Periodic() { std::cout << "~Periodic()\n"; }
66 
67  void reset(double _TM, double _dTxM, double _dTyM);
68 
69 #ifndef SWIG
70  virtual void write(std::ostream &out) const override;
71 
72  void init();
73 #endif
74 
75 private:
76  std::vector<Node *>
77  nodesOnEdge(std::list<Node *> const &nlist, double lc, Eigen::Vector3d const &pt, int c, std::string const &name) const;
78 };
79 
80 } // namespace heat
81 
82 #endif //WPERIODIC_H
HEAT_API
#define HEAT_API
Definition: heat.h:29
heat::NodePair::n
Node * n
Definition: wPeriodic.h:37
operator<<
HEAT_API std::ostream & operator<<(std::ostream &out, NodePair const &obj)
Definition: wPeriodic.cpp:28
heat::Periodic::qM
Eigen::Vector3d qM
calculated mean flux
Definition: wPeriodic.h:61
heat
this namespace avoids conflicts with similar names in 'waves'
Definition: heat.h:38
heat::Periodic::~Periodic
virtual ~Periodic()
Definition: wPeriodic.h:65
heat::Periodic::dTyM
double dTyM
Definition: wPeriodic.h:56
heat::Periodic
manages periodic BCs
Definition: wPeriodic.h:48
heat::Periodic::TM
double TM
Definition: wPeriodic.h:54
heat::NodePair
Definition: wPeriodic.h:34
heat::Periodic::verbose
bool verbose
print on/off
Definition: wPeriodic.h:62
heat.h
heat::Periodic::BT
std::vector< NodePair > BT
bottom-top boundaries
Definition: wPeriodic.h:58
heat::Periodic::LR
std::vector< NodePair > LR
left-right boundaries
Definition: wPeriodic.h:57
heat::Periodic::pbl
std::shared_ptr< heat::Problem > pbl
Definition: wPeriodic.h:50
heat::Periodic::dTxM
double dTxM
Definition: wPeriodic.h:55
heat::NodePair::d
Node * d
Definition: wPeriodic.h:38
heat::Periodic::corners
std::vector< Node * > corners
corner nodes
Definition: wPeriodic.h:59